Branch Coverage

inc/Test/Builder.pm
Criterion Covered Total %
branch 119 352 33.8


line true false branch
11 0 72 if ($] < 5.008)
22 0 72 if ($] >= 5.008001 and $Test::Builder::Config{'useithreads'} and $INC{'threads.pm'}) { }
32 0 0 if ($type eq 'HASH') { }
0 0 elsif ($type eq 'ARRAY') { }
0 0 elsif ($type eq 'SCALAR') { }
47 0 0 if ($type eq 'HASH') { }
0 0 elsif ($type eq 'ARRAY') { }
0 0 elsif ($type eq 'SCALAR') { }
172 0 0 if ($$self{'Child_Name'})
188 0 0 if ($parent_in_todo)
216 0 0 if ('CODE' ne ref $subtests)
234 0 0 unless $self->_plan_handled
238 0 0 unless (eval { do { &$run_the_subtests() } })
251 0 0 if $error and not eval { do { $error->isa('Test::Builder::Exception') } }
310 0 0 unless $self->parent
311 0 0 if ($$self{'Child_Name'})
324 0 0 if ($$self{'Skip_All'}) { }
0 0 elsif (not @{$$self{'Test_Results'};}) { }
342 0 760 if (@_)
376 0 0 if ($self->parent and $$ == $$self{'Original_Pid'})
484 77 60 unless $cmd
488 0 60 if $$self{'Have_Plan'}
490 60 0 if (my $method = $plan_cmds{$cmd}) { }
506 63 0 if ($arg) { }
0 0 elsif (not defined $arg) { }
534 63 0 if (@_)
535 0 63 unless $max =~ /^\+?\d+$/
541 63 0 unless $self->no_header
557 0 0 if $arg
590 0 72 if $$self{'Have_Output_Plan'}
593 9 63 if defined $directive
594 9 63 if defined $reason
643 0 0 if (defined $num_tests) { }
650 0 0 if ($$self{'Done_Testing'})
658 0 0 if ($self->expected_tests and $num_tests != $self->expected_tests) { }
666 0 0 unless $$self{'Have_Output_Plan'}
671 0 0 if $$self{'Expected_Tests'} != $$self{'Curr_Test'}
674 0 0 if $$self{'Curr_Test'} == 0
693 677 0 if $$self{'Expected_Tests'}
694 0 0 if $$self{'No_Plan'}
710 0 9 $self->parent ? :
712 9 0 unless $self->no_header
713 0 9 if ($self->parent)
735 128 0 if (defined $pack)
765 0 71 if ($$self{'Child_Name'} and not $$self{'In_Destroy'})
766 0 0 unless defined $name
772 71 0 $test ? :
780 0 71 if defined $name and $name =~ /^[\d\s]+$/
789 0 71 if $in_todo
796 0 71 if (not $test) { }
798 0 0 $self->in_todo ? :
805 71 0 if $self->use_numbers
807 31 40 if (defined $name) { }
816 0 71 if ($self->in_todo) { }
831 0 71 unless ($test)
832 0 0 $self->in_todo ? :
833 0 0 if $ENV{'HARNESS_ACTIVE'}
836 0 0 if (defined $name) { }
845 0 71 unless $test or $self->in_todo
850 71 0 $test ? :
860 0 677 unless defined $plan
861 0 677 if $plan =~ /\D/
862 0 677 if $plan < $$self{'Curr_Test'}
873 4 1574 if ($self->_is_object($$thing))
874 4 0 if (my $string_meth = overload::Method($$thing, $type))
886 220 1358 if ref $thing
4 1574 $self->_try(sub { $thing->isa('UNIVERSAL') if ref $thing; } ) ? :
901 0 0 unless $self->_is_dualvar($$val)
913 0 0 if ref $val
917 0 0 $numval ne $val ? :
0 0 if return $numval != 0
944 6 403 unless (defined $got and defined $expect)
949 0 6 unless $test
960 0 0 unless (defined $got and defined $expect)
965 0 0 unless $test
975 4 0 if (defined $$val) { }
976 4 0 if ($type eq 'eq' or $type eq 'ne') { }
1037 0 0 unless (defined $got and defined $dont_expect)
1042 0 0 unless $test
1053 0 0 unless (defined $got and defined $dont_expect)
1058 0 0 unless $test
1132 0 403 $numeric_cmps{$type} ? :
1137 0 403 if $error
1144 2 401 unless ($ok)
1147 2 0 if ($type =~ /^(eq|==)$/) { }
0 0 elsif ($type =~ /^(ne|!=)$/) { }
1163 0 0 defined $got ? :
1164 0 0 defined $expect ? :
1180 178 0 if defined $file and defined $line
1252 0 0 if $self->use_numbers
1254 0 0 if length $why
1292 0 0 if $self->use_numbers
1358 0 178 unless defined $regex
1363 178 0 if (_is_qr($regex)) { }
0 0 elsif (($re, $opts) = $regex =~ m[^ /(.*)/ (\w*) $ ]sx or (undef, $re, $opts) = $regex =~ /^ m([^\w\s]) (.+) \1 (\w*) $/sx) { }
1371 0 0 length $opts ? :
1382 178 0 if defined &re::is_regexp
1391 0 178 unless (defined $usable_regex)
1408 0 178 if $cmp eq '!~'
1414 0 178 unless ($ok)
1415 0 0 defined $this ? :
1416 0 0 $cmp eq '=~' ? :
1463 0 3242 if $error and $opts{'die_on_fail'}
1465 8 3234 wantarray ? :
1482 0 216 unless defined $maybe_fh
1484 216 0 if ref $maybe_fh eq 'GLOB'
1485 0 0 if ref \$maybe_fh eq 'GLOB'
1525 0 2633 if (defined $level)
1557 0 677 if (defined $use_nums)
1593 0 155 if (defined $no)
1665 0 13 $self->in_todo ? :
1671 0 11 if $self->no_diag
1672 2 9 unless @msgs
1675 0 9 if $^C
1679 9 0 defined $_ ? :
1710 0 0 ref $_ ? :
1715 0 0 if $dumper->can('Sortkeys')
1744 0 760 if $^C
1756 4 756 unless $msg =~ /\n\z/
1797 72 749 if (defined $fh)
1806 72 13 if (defined $fh)
1815 72 0 if (defined $fh)
1826 216 0 if ($self->is_fh($file_or_fh)) { }
0 0 elsif (ref $file_or_fh eq 'SCALAR') { }
1831 0 0 if ($] >= 5.008) { }
1832 0 0 unless open $fh, '>>', $file_or_fh
1837 0 0 unless $fh = 'Test::Builder::IO::Scalar'->new($file_or_fh)
1842 0 0 unless open $fh, '>', $file_or_fh
1881 0 72 if $$self{'Opened_Testhandles'}
1885 0 72 unless open $Testout, '>&STDOUT'
1886 0 72 unless open $Testerr, '>&STDERR'
1904 144 0 if @src_layers
1914 144 144 if $_ ne 'unix'
1997 0 0 if (defined $num)
2002 0 0 if ($num > @$test_results) { }
0 0 elsif ($num < @$test_results) { }
2003 0 0 @$test_results ? :
2044 75 0 if (@_)
2150 0 677 if defined $$self{'Todo'}
2154 0 677 if defined $todo
2178 0 2050 unless $pack
2182 0 2050 if $set
2198 0 1373 defined $$self{'Todo'} || $self->find_TODO ? :
2246 0 0 @_ ? :
2249 0 0 if ($self->in_todo)
2269 0 0 unless ($$self{'Start_Todo'})
2275 0 0 if ($$self{'Start_Todo'} and @{$$self{'Todo_Stack'};}) { }
2309 583 2050 wantarray ? :
2353 0 0 if ($check)
2389 0 72 if $self->no_ending
2390 0 72 if $$self{'Ending'}++
2396 0 72 if ($$self{'Original_Pid'} != $$)
2401 0 72 if (not $$self{'Have_Plan'} and $$self{'Curr_Test'})
2408 9 63 unless ($$self{'Have_Plan'})
2413 0 63 if ($$self{'Bailed_Out'})
2419 63 0 if (@$test_results) { }
0 0 elsif ($$self{'Skip_All'}) { }
0 0 elsif ($real_exit_code) { }
2421 0 63 if ($$self{'No_Plan'})
2422 0 0 unless $self->no_header
2431 0 679 unless defined $$test_results[$idx]
2439 0 63 if ($num_extra != 0)
2440 0 0 $$self{'Expected_Tests'} == 1 ? :
2447 1 62 if ($num_failed)
2449 0 1 $num_failed == 1 ? :
2451 1 0 $num_extra == 0 ? :
2459 0 63 if ($real_exit_code)
2464 0 0 if _my_exit($real_exit_code)
2468 1 62 if ($num_failed) { }
0 62 elsif ($num_extra != 0) { }
2469 1 0 $num_failed <= 254 ? :
2478 63 0 if _my_exit($exit_code)
2481 0 0 if _my_exit(0)
2488 0 0 if _my_exit($real_exit_code)
2493 0 0 if _my_exit(255)
2501 72 0 if defined $Test