Branch Coverage

inc/Test/Builder.pm
Criterion Covered Total %
branch 101 352 28.6


line true false branch
11 0 34 if ($] < 5.008)
22 0 34 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 2966 if (@_)
376 0 0 if ($self->parent and $$ == $$self{'Original_Pid'})
484 9 20 unless $cmd
488 0 20 if $$self{'Have_Plan'}
490 20 0 if (my $method = $plan_cmds{$cmd}) { }
506 31 0 if ($arg) { }
0 0 elsif (not defined $arg) { }
534 31 0 if (@_)
535 0 31 unless $max =~ /^\+?\d+$/
541 31 0 unless $self->no_header
557 0 3 if $arg
590 0 34 if $$self{'Have_Output_Plan'}
593 0 34 if defined $directive
594 0 34 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 2863 65 if $$self{'Expected_Tests'}
694 65 0 if $$self{'No_Plan'}
710 0 0 $self->parent ? :
712 0 0 unless $self->no_header
713 0 0 if ($self->parent)
735 34 0 if (defined $pack)
765 0 2928 if ($$self{'Child_Name'} and not $$self{'In_Destroy'})
766 0 0 unless defined $name
772 2928 0 $test ? :
780 0 2928 if defined $name and $name =~ /^[\d\s]+$/
789 0 2928 if $in_todo
796 0 2928 if (not $test) { }
798 0 0 $self->in_todo ? :
805 2928 0 if $self->use_numbers
807 389 2539 if (defined $name) { }
816 0 2928 if ($self->in_todo) { }
831 0 2928 unless ($test)
832 0 0 $self->in_todo ? :
833 0 0 if $ENV{'HARNESS_ACTIVE'}
836 0 0 if (defined $name) { }
845 0 2928 unless $test or $self->in_todo
850 2928 0 $test ? :
860 0 2928 unless defined $plan
861 65 2863 if $plan =~ /\D/
862 0 2863 if $plan < $$self{'Curr_Test'}
873 0 6382 if ($self->_is_object($$thing))
874 0 0 if (my $string_meth = overload::Method($$thing, $type))
886 510 5872 if ref $thing
0 6382 $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 31 769 unless (defined $got and defined $expect)
949 0 31 unless $test
960 0 0 unless (defined $got and defined $expect)
965 0 0 unless $test
975 0 0 if (defined $$val) { }
976 0 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 769 $numeric_cmps{$type} ? :
1137 0 769 if $error
1144 0 769 unless ($ok)
1147 0 0 if ($type =~ /^(eq|==)$/) { }
0 0 elsif ($type =~ /^(ne|!=)$/) { }
1163 0 0 defined $got ? :
1164 0 0 defined $expect ? :
1180 2 0 if defined $file and defined $line
1252 4 0 if $self->use_numbers
1254 4 0 if length $why
1292 0 0 if $self->use_numbers
1358 0 2 unless defined $regex
1363 2 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 2 0 if defined &re::is_regexp
1391 0 2 unless (defined $usable_regex)
1408 0 2 if $cmp eq '!~'
1414 0 2 unless ($ok)
1415 0 0 defined $this ? :
1416 0 0 $cmp eq '=~' ? :
1463 0 12575 if $error and $opts{'die_on_fail'}
1465 4 12571 wantarray ? :
1482 0 102 unless defined $maybe_fh
1484 102 0 if ref $maybe_fh eq 'GLOB'
1485 0 0 if ref \$maybe_fh eq 'GLOB'
1525 0 9555 if (defined $level)
1557 0 2932 if (defined $use_nums)
1593 0 68 if (defined $no)
1665 0 0 $self->in_todo ? :
1671 0 0 if $self->no_diag
1672 0 0 unless @msgs
1675 0 0 if $^C
1679 0 0 defined $_ ? :
1710 0 0 ref $_ ? :
1715 0 0 if $dumper->can('Sortkeys')
1744 0 2966 if $^C
1756 0 2966 unless $msg =~ /\n\z/
1797 34 2966 if (defined $fh)
1806 34 0 if (defined $fh)
1815 34 0 if (defined $fh)
1826 102 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 34 if $$self{'Opened_Testhandles'}
1885 0 34 unless open $Testout, '>&STDOUT'
1886 0 34 unless open $Testerr, '>&STDERR'
1904 68 0 if @src_layers
1914 68 68 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 34 0 if (@_)
2150 0 2928 if defined $$self{'Todo'}
2154 0 2928 if defined $todo
2178 0 8784 unless $pack
2182 0 8784 if $set
2198 0 5856 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 771 8784 wantarray ? :
2353 0 0 if ($check)
2389 0 34 if $self->no_ending
2390 0 34 if $$self{'Ending'}++
2396 0 34 if ($$self{'Original_Pid'} != $$)
2401 0 34 if (not $$self{'Have_Plan'} and $$self{'Curr_Test'})
2408 0 34 unless ($$self{'Have_Plan'})
2413 0 34 if ($$self{'Bailed_Out'})
2419 34 0 if (@$test_results) { }
0 0 elsif ($$self{'Skip_All'}) { }
0 0 elsif ($real_exit_code) { }
2421 3 31 if ($$self{'No_Plan'})
2422 3 0 unless $self->no_header
2431 0 2932 unless defined $$test_results[$idx]
2439 0 34 if ($num_extra != 0)
2440 0 0 $$self{'Expected_Tests'} == 1 ? :
2447 0 34 if ($num_failed)
2449 0 0 $num_failed == 1 ? :
2451 0 0 $num_extra == 0 ? :
2459 0 34 if ($real_exit_code)
2464 0 0 if _my_exit($real_exit_code)
2468 0 34 if ($num_failed) { }
0 34 elsif ($num_extra != 0) { }
2469 0 0 $num_failed <= 254 ? :
2478 34 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 34 0 if defined $Test