← Back to index

lib/BDD/Behave/Formatter/Progress.rakumod

38 / 38 lines covered (100.0%)

1use BDD::Behave::Colors;2use BDD::Behave::Failures;3use BDD::Behave::Formatter;4use BDD::Behave::Formatter::Tree;56unit class BDD::Behave::Formatter::Progress is BDD::Behave::Formatter::Tree;78has Bool $!multi-file = False;9has Int  $!total      = 0;10has Int  $!shown      = 0;1112method name(--> Str) { 'progress' }1314method needs-whole-files(--> Bool) { False }1516method set-total(Int $total) {17  $!total = $total;18}1920method !maybe-print-total {21  return unless $!total > 0;22  $!shown++;23  print " ({$!shown}/{$!total})\n";24}2526method suite-loading(Str :$file) { }2728method suite-start($suite, Bool :$multi-file = False) {29  $!multi-file = $multi-file;30}3132method group-start($group) { }33method group-end($group)   { }34method group-around-skipped($group) {35  print light-blue('S');36}3738method example-start($example, Bool :$auto = False) { }39method example-auto-description($example, Str :$description) { }4041method example-pass($example) {42  print green('.');43  self!maybe-print-total;44}4546method example-fail($example, :$failure-info) {47  print red('F');48  self!maybe-print-total;49}5051method example-pending($example) {52  print light-blue('*');53  self!maybe-print-total;54}5556method example-skipped($example) {57  print light-blue('S');58  self!maybe-print-total;59}6061method example-around-skipped($example) {62  print light-blue('S');63  self!maybe-print-total;64}6566method example-retry($example, Int :$attempt, Int :$max-attempts) {67  print yellow('R');68}6970method example-slow($example, Real :$threshold) { }7172method run-summary(73  $result,74  Bool :$aborted   = False,75  Int  :$fail-fast = 0,76  Str  :$order     = 'defined',77  Int  :$seed,78  Bool :$show-seed = False,79) {80  return if $!multi-file;81  callsame;82}8384method multi-file-overall(85  $result,86  Str :$order = 'defined',87  Int :$seed,88  Bool :$show-seed = False,89) {90  say '';91  Failures.say;92  callsame;93}