Branch Coverage

inc/Test/Builder.pm
Criterion Covered Total %
branch 141 370 38.1


line true false branch
11 0 32 if ($] < 5.008)
22 0 32 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') { }
186 0 0 if ($$self{'Child_Name'})
207 0 0 if ($parent_in_todo)
235 0 0 if ('CODE' ne ref $subtests)
258 0 0 unless $self->_plan_handled
262 0 0 unless (eval { do { &$run_the_subtests() } })
275 0 0 if $error and not eval { do { $error->isa('Test::Builder::Exception') } }
280 0 0 if $$child{'Bailed_Out'}
338 0 0 unless $self->parent
339 0 0 if ($$self{'Child_Name'})
352 0 0 unless ($$self{'Bailed_Out'})
353 0 0 if ($$self{'Skip_All'}) { }
0 0 elsif (not @{$$self{'Test_Results'};}) { }
372 0 799 if (@_)
406 0 0 if ($self->parent and $$ == $$self{'Original_Pid'})
527 25 32 unless $cmd
531 0 32 if $$self{'Have_Plan'}
533 32 0 if (my $method = $plan_cmds{$cmd}) { }
549 31 0 if ($arg) { }
0 0 elsif (not defined $arg) { }
577 31 0 if (@_)
578 0 31 unless $max =~ /^\+?\d+$/
584 31 0 unless $self->no_header
600 0 1 if $arg
633 0 32 if $$self{'Have_Output_Plan'}
636 0 32 if defined $directive
637 0 32 if defined $reason
686 0 0 if (defined $num_tests) { }
693 0 0 if ($$self{'Done_Testing'})
701 0 0 if ($self->expected_tests and $num_tests != $self->expected_tests) { }
709 0 0 unless $$self{'Have_Output_Plan'}
714 0 0 if $$self{'Expected_Tests'} != $$self{'Curr_Test'}
717 0 0 if $$self{'Curr_Test'} == 0
736 627 1 if $$self{'Expected_Tests'}
737 1 0 if $$self{'No_Plan'}
753 0 0 $self->parent ? :
755 0 0 unless $self->no_header
756 0 0 if ($self->parent)
778 44 0 if (defined $pack)
808 0 628 if ($$self{'Child_Name'} and not $$self{'In_Destroy'})
809 0 0 unless defined $name
815 593 35 $test ? :
823 0 628 if defined $name and $name =~ /^[\d\s]+$/
832 42 586 if $in_todo
839 35 593 if (not $test) { }
841 32 3 $self->in_todo ? :
848 628 0 if $self->use_numbers
850 442 186 if (defined $name) { }
859 42 586 if ($self->in_todo) { }
874 35 593 unless ($test)
875 32 3 $self->in_todo ? :
876 35 0 if $ENV{'HARNESS_ACTIVE'}
879 33 2 if (defined $name) { }
888 3 625 unless $test or $self->in_todo
893 593 35 $test ? :
903 0 628 unless defined $plan
904 1 627 if $plan =~ /\D/
905 0 627 if $plan < $$self{'Curr_Test'}
916 6 1382 if ($self->_is_object($$thing))
917 0 6 if (my $string_meth = overload::Method($$thing, $type))
929 70 1318 if ref $thing
6 1382 $self->_try(sub { $thing->isa('UNIVERSAL') if ref $thing; } ) ? :
944 0 0 unless $self->_is_dualvar($$val)
956 0 0 if ref $val
987 14 570 unless (defined $got and defined $expect)
992 3 11 unless $test
1003 0 0 unless (defined $got and defined $expect)
1008 0 0 unless $test
1018 62 3 if (defined $$val) { }
1019 62 0 if ($type eq 'eq' or $type eq 'ne') { }
1080 0 3 unless (defined $got and defined $dont_expect)
1085 0 0 unless $test
1096 0 0 unless (defined $got and defined $dont_expect)
1101 0 0 unless $test
1157 0 573 if ($cmp_ok_bl{$type})
1182 0 573 $numeric_cmps{$type} ? :
1187 0 573 if $error
1194 31 542 unless ($ok)
1197 28 3 if ($type =~ /^(eq|==)$/) { }
3 0 elsif ($type =~ /^(ne|!=)$/) { }
1213 0 0 defined $got ? :
1214 0 0 defined $expect ? :
1230 18 0 if defined $file and defined $line
1261 0 0 if ($self->parent)
1309 0 0 if $self->use_numbers
1311 0 0 if length $why
1349 0 0 if $self->use_numbers
1415 0 18 unless defined $regex
1420 18 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) { }
1428 0 0 length $opts ? :
1439 18 0 if defined &re::is_regexp
1448 0 18 unless (defined $usable_regex)
1470 3 15 if $cmp eq '!~'
1476 0 18 unless ($ok)
1477 0 0 defined $thing ? :
1478 0 0 $cmp eq '=~' ? :
1525 0 2774 if $error and $opts{'die_on_fail'}
1527 0 2774 wantarray ? :
1544 0 96 unless defined $maybe_fh
1546 96 0 if ref $maybe_fh eq 'GLOB'
1547 0 0 if ref \$maybe_fh eq 'GLOB'
1587 0 2522 if (defined $level)
1619 0 628 if (defined $use_nums)
1655 0 168 if (defined $no)
1727 126 13 $self->in_todo ? :
1733 0 104 if $self->no_diag
1734 0 104 unless @msgs
1737 0 104 if $^C
1741 104 0 defined $_ ? :
1772 0 0 ref $_ ? :
1777 0 0 if $dumper->can('Sortkeys')
1806 0 799 if $^C
1818 0 799 unless $msg =~ /\n\z/
1859 32 660 if (defined $fh)
1868 32 13 if (defined $fh)
1877 32 126 if (defined $fh)
1888 96 0 if ($self->is_fh($file_or_fh)) { }
0 0 elsif (ref $file_or_fh eq 'SCALAR') { }
1893 0 0 if ($] >= 5.008) { }
1894 0 0 unless open $fh, '>>', $file_or_fh
1899 0 0 unless $fh = 'Test::Builder::IO::Scalar'->new($file_or_fh)
1904 0 0 unless open $fh, '>', $file_or_fh
1943 0 32 if $$self{'Opened_Testhandles'}
1947 0 32 unless open $Testout, '>&STDOUT'
1948 0 32 unless open $Testerr, '>&STDERR'
1966 64 0 if @src_layers
1976 64 64 if $_ ne 'unix'
2059 0 0 if (defined $num)
2064 0 0 if ($num > @$test_results) { }
0 0 elsif ($num < @$test_results) { }
2065 0 0 @$test_results ? :
2106 36 0 if (@_)
2212 0 628 if defined $$self{'Todo'}
2216 44 584 if defined $todo
2240 0 1896 unless $pack
2244 0 1896 if $set
2260 306 1194 defined $$self{'Todo'} || $self->find_TODO ? :
2308 0 0 @_ ? :
2311 0 0 if ($self->in_todo)
2331 0 0 unless ($$self{'Start_Todo'})
2337 0 0 if ($$self{'Start_Todo'} and @{$$self{'Todo_Stack'};}) { }
2371 626 1896 wantarray ? :
2415 0 0 if ($check)
2451 0 32 if $self->no_ending
2452 0 32 if $$self{'Ending'}++
2458 0 32 if ($$self{'Original_Pid'} != $$)
2463 0 32 if (not $$self{'Have_Plan'} and $$self{'Curr_Test'})
2467 0 0 if ($real_exit_code)
2472 0 0 if _my_exit($real_exit_code)
2477 0 0 if (@$test_results)
2479 0 0 if ($num_failed > 0)
2481 0 0 $num_failed <= 254 ? :
2482 0 0 if _my_exit($exit_code)
2485 0 0 if _my_exit(254)
2490 0 32 unless ($$self{'Have_Plan'})
2495 0 32 if ($$self{'Bailed_Out'})
2501 32 0 if (@$test_results) { }
0 0 elsif ($$self{'Skip_All'}) { }
0 0 elsif ($real_exit_code) { }
2503 1 31 if ($$self{'No_Plan'})
2504 1 0 unless $self->no_header
2513 0 628 unless defined $$test_results[$idx]
2521 0 32 if ($num_extra != 0)
2522 0 0 $$self{'Expected_Tests'} == 1 ? :
2529 1 31 if ($num_failed)
2531 0 1 $num_failed == 1 ? :
2533 1 0 $num_extra == 0 ? :
2541 0 32 if ($real_exit_code)
2546 0 0 if _my_exit($real_exit_code)
2550 1 31 if ($num_failed) { }
0 31 elsif ($num_extra != 0) { }
2551 1 0 $num_failed <= 254 ? :
2560 32 0 if _my_exit($exit_code)
2563 0 0 if _my_exit(0)
2570 0 0 if _my_exit($real_exit_code)
2575 0 0 if _my_exit(255)
2583 32 0 if defined $Test