Branch Coverage

blib/lib/CPAN/Reporter.pm
Criterion Covered Total %
branch 226 306 73.8


line true false branch
54 1 15 unless my $result = _init_result('make', @args)
56 4 11 if ($result->{'grade'} eq 'discard') { }
62 1 3 unless CPAN::Reporter::History::_is_duplicate($result)
67 9 2 if ($result->{'grade'} ne 'pass')
74 1 33 unless my $result = _init_result('PL', @args)
76 9 24 if ($result->{'grade'} eq 'discard') { }
82 2 7 unless CPAN::Reporter::History::_is_duplicate($result)
87 18 6 if ($result->{'grade'} ne 'pass')
94 1 118 unless my $result = _init_result('test', @args)
96 15 103 if ($result->{'grade'} eq 'discard') { }
102 3 12 unless CPAN::Reporter::History::_is_duplicate($result)
117 170 16 if (-r CPAN::Reporter::Config::_get_config_file())
120 170 0 if $config_obj
131 15 171 if ($timeout)
132 0 15 $^O eq 'MSWin32' ? :
137 171 15 unless ($wrap_code)
148 0 186 unless my $wrapper_fh = 'IO::File'->new($wrapper_name, 'w')
156 1 185 if defined $redirect
160 39 147 if _is_PL($command)
165 186 0 unless $ENV{'PERL_CR_NO_CLEANUP'}
168 0 186 unless (@cmd_output)
177 186 0 if ($cmd_output[-1] =~ /exited with/)
183 0 186 if (not defined $exit_value) { }
0 186 elsif ($exit_value == -1) { }
216 13 2 if ($result->{'exit_value'}) { }
238 23 10 if ($result->{'exit_value'}) { }
279 16 102 if ($result->{'is_make'} and -f 'test.pl' || _has_recursive_make()) { }
280 10 6 if ($result->{'exit_value'}) { }
294 102 0 'CPAN::Version'->vgt($harness_version, '2.99_01') ? :
299 6 270 if ($output->[$i] =~ /No support for OS|OS unsupported/ism) { }
8 262 elsif ($output->[$i] =~ /^.?No tests defined/ms) { }
310 90 186 if $grade
313 12 90 unless ($grade)
314 6 6 $result->{'exit_value'} ? :
316 9 3 $result->{'is_make'} ? :
6 6 $result->{'exit_value'} ? :
347 126 5 if $config_obj
349 5 126 unless ($config->{'email_from'})
373 3 123 unless (grep {length $_;} @format_checks)
386 3 0 unless $is_duplicate
395 4 119 if ($config->{'send_skipfile'} and -r $config->{'send_skipfile'})
401 4 7 if substr($pattern, 0, 1) eq '#'
403 4 3 unless $dist_id =~ /$pattern/i
423 120 0 if $Test::Reporter::VERSION >= 1.54
426 74 46 if ($is_duplicate)
427 2 72 if (_prompt($config, 'send_duplicates', $tr->grade) =~ /^n/)
442 0 118 if defined $config->{'debug'}
444 0 118 unless (defined $transport and length $transport)
456 116 2 if ($transport_args[0] eq 'Metabase')
458 0 116 unless (@transport_args)
465 1 117 if ($@)
482 0 117 if (_prompt($config, 'edit_report', $tr->grade) =~ /^y/)
484 0 0 if $editor
489 9 108 defined $$config{"send_${phase}_report"} ? :
492 114 3 if (_prompt($config, $send_config, $tr->grade) =~ /^y/) { }
495 114 0 if ($tr->send) { }
496 43 71 unless $is_duplicate
502 0 0 if ($config->{'retry_submission'})
508 0 0 if ($tr->send) { }
509 0 0 unless $is_duplicate
528 2 127 if ($result->{'exit_value'} == 9)
531 2 0 if $config_obj
534 0 2 if ($config->{'_store_problems_in_dir'})
537 0 0 if (open my $to_log_fh, '>>', $config->{'_store_problems_in_dir'} . '/' . $file) { }
547 0 2 if ($config->{'_problem_log'})
549 0 0 if (open my $to_log_fh, '>>', $config->{'_problem_log'}) { }
575 6 163 if $grade eq 'na'
576 34 129 if $grade eq 'pass' and $result->{'phase'} ne 'PL'
584 2 127 if ($result->{'exit_value'} & 127)
595 2 3612 if ($result->{'phase'} eq 'test' and $line =~ m[open3: IO::Pipe: Can't spawn.*?TAP/Parser/Iterator/Process.pm])
601 0 3604 if ($line =~ /(?<!skipped: )Perl .*? required.*?--this is only/ism or $line =~ /Perl version .*? or higher required\. We run/ism or $line =~ /ERROR: perl: Version .*? is installed, but we need version/ism or $line =~ /ERROR: perl \(.*?\) is installed, but we need version/ism or $line =~ /Error evaling version line 'BEGIN/ism or $line =~ /Could not eval '/ism)
612 6 3598 if ($line =~ /No support for OS|OS unsupported/ism)
619 2 125 if ($harness_error) { }
12 113 elsif ($version_error or $result->{'prereq_pm'} =~ /^\s+!\s+perl\s/ism) { }
6 107 elsif ($unsupported) { }
1 106 elsif ($result->{'is_make'} and $result->{'phase'} eq 'test' and not _has_test_target()) { }
14 92 elsif ($grade ne 'pass' and $result->{'prereq_pm'} =~ m[n/a]ism) { }
8 84 elsif ($grade ne 'pass' and $result->{'prereq_pm'} =~ /^\s+!/ism) { }
2 82 elsif ($result->{'phase'} eq 'PL' and $grade eq 'pass' and not -f 'Makefile' and not -f 'Build') { }
2 80 elsif ($result->{'command'} =~ /Build.*?-j/) { }
1 128 elsif ($result->{'is_make'} and $result->{'phase'} eq 'make' and grep {/Makefile out-of-date with respect to Makefile.PL/;} @$output) { }
686 187 167 if $result->{'expanded'}++
690 37 130 if _is_PL($result->{'command'})
727 704 2288 if ($var =~ m[^/(.+)/$]) { }
731 352 1936 if exists $ENV{$var}
738 0 2145 unless defined $value
753 0 33 unless mkpath(dirname($target))
756 0 33 unless open FH, "<$source"
760 0 33 unless open FH, ">$target"
772 76 0 if ($Autoflush_Lib)
773 0 76 if length $perl5opt
774 76 0 if $] >= 5.008
790 63 2255 if ($_ eq 't') { }
73 2182 elsif ($_ eq 'Makefile.PL') { }
807 0 47 unless my $fh = 'IO::File'->new('Makefile')
821 0 173 unless (defined $output and defined $exit_value)
823 0 0 if (not defined $output || defined $exit_value) { }
0 0 elsif (defined $output and not defined $exit_value) { }
838 3 170 if ($dist->pretty_id =~ m[\w+/Perl6/])
845 166 4 ref $output eq 'ARRAY' ? :
858 112 58 $result->{'is_make'} ? :
859 112 58 $result->{'is_make'} ? :
863 170 0 defined $author ? :
864 170 0 defined $author ? :
875 126 64 $command =~ /\b(?:\S*make|Makefile.PL)\b/ism ? :
884 76 277 $command =~ /\b(?:Makefile|Build)\.PL\b/ism ? :
895 603 6085 if length $term > $max
911 74 188 if ($line =~ /^Result:\s+([A-Z]+)/) { }
2 186 elsif ($line =~ /Bailout called\.\s+Further testing stopped/ms) { }
912 20 54 if ($1 eq 'PASS') { }
51 3 elsif ($1 eq 'FAIL') { }
3 0 elsif ($1 eq 'NOTESTS') { }
938 0 0 if ($line =~ /^All tests successful/ms) { }
0 0 elsif ($line =~ /^FAILED--no tests were run/ms) { }
0 0 elsif ($line =~ /^FAILED--.*--no output/ms) { }
0 0 elsif ($line =~ /FAILED--Further testing stopped/ms) { }
0 0 elsif ($line =~ /^Failed /ms) { }
973 179 0 if (ref $prereq_pm eq 'HASH')
976 0 711 if (defined $_ and ref $_ ne 'HASH')
985 135 760 if keys %{$$prereq_pm{$sec};}
990 72 107 if ($dist->{'build_dir'} and -d $dist->{'build_dir'})
992 4 68 if (-f $meta_yml)
994 2 2 if ($@)
999 2 2 if (ref $yaml[0] eq 'HASH' and ref $yaml[0]{'configure_requires'} eq 'HASH')
1009 758 137 unless ref $need{$section} eq 'HASH'
1011 0 137 unless @prereq_list
1026 135 50 if $name_length > $name_width
1027 14 171 if $need_length > $need_width
1028 8 177 if $have_length > $have_width
1037 137 758 if (keys %{$need{$section};})
1047 129 56 $prereq_met{$section}{$module} ? :
1066 138 0 if defined $msg and length $msg
1089 10 318 if ($action =~ m[^ask/yes]i) { }
72 246 elsif ($action =~ m[^ask(/no)?]i) { }
1153 111 6 if ($ENV{'AUTOMATED_TESTING'})
1162 2 115 if (-d $confdir and -f $comment_file and -r $comment_file)
1163 0 2 unless open my $fh, '<:encoding(UTF-8)', $comment_file
1167 0 2 unless defined($text = <$fh>)
1175 5 112 if (scalar @comment_parts == 0)
1186 0 117 if (length $test_log > 1000000)
1260 0 176 if ($^O eq 'MSWin32' and eval 'require Win32')
1278 1 185 if (defined $cmd) { }
1303 0 500 unless defined $prefix
1362 0 0 if ($@)
1371 0 0 unless ('File::Spec'->file_name_is_absolute($program))
1375 0 0 unless ($path)
1476 0 116 if (@transport_args % 2 != 0) { }
1489 0 232 unless ($args{$key})
1501 0 116 if ($error)
1508 0 116 unless (-r $args{'id_file'})
1547 0 314 unless my $fh = 'IO::File'->new($prereq_input, 'w')
1558 0 3719 unless length $line
1560 0 3719 unless (defined $mod and defined $met and defined $have)