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 302 if ($output->[$i] =~ /No support for OS|OS unsupported/ism) { }
8 294 elsif ($output->[$i] =~ /^.?No tests defined/ms) { }
310 90 218 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 3243 if ($result->{'phase'} eq "test" and $line =~ m[open3: IO::Pipe: Can't spawn.*?TAP/Parser/Iterator/Process.pm])
601 0 3235 if ($line =~ /(?
612 6 3229 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'})
732 704 3168 if ($var =~ m[^/(.+)/$]) { }
736 352 2816 if exists $ENV{$var}
743 0 2497 unless defined $value
758 0 33 unless mkpath(dirname($target))
761 0 33 unless open FH, "<$source"
765 0 33 unless open FH, ">$target"
777 76 0 if ($Autoflush_Lib)
778 0 76 if length $perl5opt
779 76 0 if $] >= "5.008"
795 63 2310 if ($_ eq 't') { }
73 2237 elsif ($_ eq 'Makefile.PL') { }
812 0 47 unless my $fh = "IO::File"->new("Makefile")
826 0 173 unless (defined $output and defined $exit_value)
828 0 0 if (not defined $output || defined $exit_value) { }
0 0 elsif (defined $output and not defined $exit_value) { }
843 3 170 if ($dist->pretty_id =~ m[\w+/Perl6/])
850 166 4 ref $output eq 'ARRAY' ? :
863 112 58 $result->{'is_make'} ? :
864 112 58 $result->{'is_make'} ? :
868 170 0 defined $author ? :
869 170 0 defined $author ? :
880 126 64 $command =~ /\b(?:\S*make|Makefile.PL)\b/ism ? :
889 76 277 $command =~ /\b(?:Makefile|Build)\.PL\b/ism ? :
900 709 6331 if length $term > $max
916 74 220 if ($line =~ /^Result:\s+([A-Z]+)/) { }
2 218 elsif ($line =~ /Bailout called\.\s+Further testing stopped/ms) { }
917 20 54 if ($1 eq 'PASS') { }
51 3 elsif ($1 eq 'FAIL') { }
3 0 elsif ($1 eq 'NOTESTS') { }
943 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) { }
978 179 0 if (ref $prereq_pm eq "HASH")
981 0 711 if (defined $_ and ref $_ ne "HASH")
990 135 760 if keys %{$$prereq_pm{$sec};}
995 72 107 if ($dist->{'build_dir'} and -d $dist->{'build_dir'})
997 4 68 if (-f $meta_yml)
999 2 2 if ($@)
1004 2 2 if (ref $yaml[0] eq "HASH" and ref $yaml[0]{'configure_requires'} eq "HASH")
1014 758 137 unless ref $need{$section} eq "HASH"
1016 0 137 unless @prereq_list
1031 138 47 if $name_length > $name_width
1032 15 170 if $need_length > $need_width
1033 9 176 if $have_length > $have_width
1042 137 758 if (keys %{$need{$section};})
1052 129 56 $prereq_met{$section}{$module} ? :
1071 138 0 if defined $msg and length $msg
1094 10 318 if ($action =~ m[^ask/yes]i) { }
72 246 elsif ($action =~ m[^ask(/no)?]i) { }
1158 111 6 if ($ENV{'AUTOMATED_TESTING'})
1167 2 115 if (-d $confdir and -f $comment_file and -r $comment_file)
1168 0 2 unless open my $fh, "<:encoding(UTF-8)", $comment_file
1172 0 2 unless defined($text = readline $fh)
1180 5 112 if (scalar @comment_parts == 0)
1191 0 117 if (length $test_log > 1000000)
1266 0 176 if ($^O eq "MSWin32" and eval "require Win32")
1284 1 185 if (defined $cmd) { }
1309 0 500 unless defined $prefix
1368 0 0 if ($@)
1377 0 0 unless ("File::Spec"->file_name_is_absolute($program))
1381 0 0 unless ($path)
1483 0 116 if (@transport_args % 2 != 0) { }
1496 0 232 unless ($args{$key})
1508 0 116 if ($error)
1515 0 116 unless (-r $args{'id_file'})
1554 0 314 unless my $fh = "IO::File"->new($prereq_input, "w")
1565 0 3895 unless length $line
1567 0 3895 unless (defined $mod and defined $met and defined $have)