File Coverage

blib/lib/TAP/Formatter/JUnit/PrintTxtStdout.pm
Criterion Covered Total %
statement 12 29 41.3
branch 0 8 0.0
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 17 43 39.5


line stmt bran cond sub pod time code
1             package TAP::Formatter::JUnit::PrintTxtStdout;
2             # ABSTRACT: ...
3              
4 1     1   235083 use strict;
  1         3  
  1         74  
5 1     1   8 use warnings;
  1         2  
  1         79  
6 1     1   715 use Moose;
  1         705345  
  1         7  
7 1     1   11255 use Path::Tiny;
  1         18993  
  1         443  
8             extends qw(TAP::Formatter::JUnit);
9              
10             our $VERSION = '0.001';
11              
12             =head1 NAME
13              
14             TAP::Formatter::JUnit::PrintTxtStdout - improve TAP::Formatter::JUnit to print txt result to stdout
15              
16             =head1 SYNOPSIS
17              
18             prove --formatter TAP::Formatter::JUnit::PrintTxtStdout ...
19              
20             =head1 DESCRIPTION
21              
22             =cut
23              
24             =head1 METHODS
25              
26             =head1 summary
27              
28             Prints the summary report (in txt) after all tests are run.
29              
30             =cut
31              
32             sub summary {
33 0     0 1   my $self = shift;
34 0 0         return if $self->silent();
35              
36 0           my @suites = @{$self->testsuites};
  0            
37 0 0         if ($ENV{PERL_TEST_HARNESS_DUMP_TAP}) {
38 0           my $iter = path($ENV{PERL_TEST_HARNESS_DUMP_TAP})->iterator({recurse => 1});
39 0           while (my $f = $iter->()) {
40 0 0         next if $f->is_dir;
41 0 0         next unless $f->basename =~ /\.t$/;
42 0           print {$self->stdout} "-" x 80, "\n";
  0            
43 0           print {$self->stdout} "$f\n";
  0            
44 0           print {$self->stdout} $f->slurp_utf8;
  0            
45             }
46              
47             } else {
48 0           print {$self->stdout} $self->xml->testsuites(@suites);
  0            
49             }
50             }
51              
52             1;
53              
54             =head1 SEE ALSO
55              
56             =over 4
57              
58             =item *
59              
60             =back
61