Branch Coverage

inc/Test/Builder.pm
Criterion Covered Total %
branch 113 352 32.1


line true false branch
11 0 7 if ($] < 5.008)
22 0 7 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 842 if ($$self{'Child_Name'})
188 0 842 if ($parent_in_todo)
216 0 842 if ('CODE' ne ref $subtests)
234 47 795 unless $self->_plan_handled
238 0 842 unless (eval { do { &$run_the_subtests() } })
251 0 842 if $error and not eval { do { $error->isa('Test::Builder::Exception') } }
310 0 842 unless $self->parent
311 0 842 if ($$self{'Child_Name'})
324 0 842 if ($$self{'Skip_All'}) { }
0 842 elsif (not @{$$self{'Test_Results'};}) { }
342 842 4127 if (@_)
376 0 842 if ($self->parent and $$ == $$self{'Original_Pid'})
484 6 1 unless $cmd
488 0 1 if $$self{'Have_Plan'}
490 1 0 if (my $method = $plan_cmds{$cmd}) { }
506 0 0 if ($arg) { }
0 0 elsif (not defined $arg) { }
534 0 847 if (@_)
535 0 0 unless $max =~ /^\+?\d+$/
541 0 0 unless $self->no_header
557 0 1 if $arg
590 0 849 if $$self{'Have_Output_Plan'}
593 1 848 if defined $directive
594 1 848 if defined $reason
643 0 847 if (defined $num_tests) { }
650 0 847 if ($$self{'Done_Testing'})
658 0 847 if ($self->expected_tests and $num_tests != $self->expected_tests) { }
666 847 0 unless $$self{'Have_Output_Plan'}
671 0 847 if $$self{'Expected_Tests'} != $$self{'Curr_Test'}
674 0 847 if $$self{'Curr_Test'} == 0
693 0 2437 if $$self{'Expected_Tests'}
694 7 2430 if $$self{'No_Plan'}
710 0 1 $self->parent ? :
712 1 0 unless $self->no_header
713 0 1 if ($self->parent)
735 6 0 if (defined $pack)
765 0 2436 if ($$self{'Child_Name'} and not $$self{'In_Destroy'})
766 0 0 unless defined $name
772 2436 0 $test ? :
780 0 2436 if defined $name and $name =~ /^[\d\s]+$/
789 0 2436 if $in_todo
796 0 2436 if (not $test) { }
798 0 0 $self->in_todo ? :
805 2436 0 if $self->use_numbers
807 2419 17 if (defined $name) { }
816 0 2436 if ($self->in_todo) { }
831 0 2436 unless ($test)
832 0 0 $self->in_todo ? :
833 0 0 if $ENV{'HARNESS_ACTIVE'}
836 0 0 if (defined $name) { }
845 0 2436 unless $test or $self->in_todo
850 2436 0 $test ? :
860 2429 7 unless defined $plan
861 7 0 if $plan =~ /\D/
862 0 0 if $plan < $$self{'Curr_Test'}
873 0 8380 if ($self->_is_object($$thing))
874 0 0 if (my $string_meth = overload::Method($$thing, $type))
886 3508 4872 if ref $thing
0 8380 $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 0 28 unless (defined $got and defined $expect)
949 0 0 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 28 $numeric_cmps{$type} ? :
1137 0 28 if $error
1144 0 28 unless ($ok)
1147 0 0 if ($type =~ /^(eq|==)$/) { }
0 0 elsif ($type =~ /^(ne|!=)$/) { }
1163 0 0 defined $got ? :
1164 0 0 defined $expect ? :
1180 0 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 0 unless defined $regex
1363 0 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 0 0 if defined &re::is_regexp
1391 0 0 unless (defined $usable_regex)
1408 0 0 if $cmp eq '!~'
1414 0 0 unless ($ok)
1415 0 0 defined $this ? :
1416 0 0 $cmp eq '=~' ? :
1463 0 16704 if $error and $opts{'die_on_fail'}
1465 0 16704 wantarray ? :
1482 0 2547 unless defined $maybe_fh
1484 2547 0 if ref $maybe_fh eq 'GLOB'
1485 0 0 if ref \$maybe_fh eq 'GLOB'
1525 0 9862 if (defined $level)
1557 0 2436 if (defined $use_nums)
1593 0 851 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 3285 if $^C
1756 0 3285 unless $msg =~ /\n\z/
1797 849 3285 if (defined $fh)
1806 849 0 if (defined $fh)
1815 849 0 if (defined $fh)
1826 2547 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 849 if $$self{'Opened_Testhandles'}
1885 0 849 unless open $Testout, '>&STDOUT'
1886 0 849 unless open $Testerr, '>&STDERR'
1904 1698 0 if @src_layers
1914 1698 1698 if $_ ne 'unix'
1997 0 847 if (defined $num)
2002 0 0 if ($num > @$test_results) { }
0 0 elsif ($num < @$test_results) { }
2003 0 0 @$test_results ? :
2044 849 1684 if (@_)
2150 0 2436 if defined $$self{'Todo'}
2154 0 2436 if defined $todo
2178 0 9834 unless $pack
2182 1684 8150 if $set
2198 0 5714 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 28 9834 wantarray ? :
2353 0 0 if ($check)
2389 0 849 if $self->no_ending
2390 0 849 if $$self{'Ending'}++
2396 0 849 if ($$self{'Original_Pid'} != $$)
2401 0 849 if (not $$self{'Have_Plan'} and $$self{'Curr_Test'})
2408 1 848 unless ($$self{'Have_Plan'})
2413 0 848 if ($$self{'Bailed_Out'})
2419 848 0 if (@$test_results) { }
0 0 elsif ($$self{'Skip_All'}) { }
0 0 elsif ($real_exit_code) { }
2421 1 847 if ($$self{'No_Plan'})
2422 1 0 unless $self->no_header
2431 0 2436 unless defined $$test_results[$idx]
2439 0 848 if ($num_extra != 0)
2440 0 0 $$self{'Expected_Tests'} == 1 ? :
2447 0 848 if ($num_failed)
2449 0 0 $num_failed == 1 ? :
2451 0 0 $num_extra == 0 ? :
2459 0 848 if ($real_exit_code)
2464 0 0 if _my_exit($real_exit_code)
2468 0 848 if ($num_failed) { }
0 848 elsif ($num_extra != 0) { }
2469 0 0 $num_failed <= 254 ? :
2478 848 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 7 0 if defined $Test