Branch Coverage

inc/Test/Builder.pm
Criterion Covered Total %
branch 115 370 31.0


line true false branch
11 0 14 if ($] < 5.008)
22 0 14 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 102 if (@_)
406 0 0 if ($self->parent and $$ == $$self{'Original_Pid'})
527 4 12 unless $cmd
531 0 12 if $$self{'Have_Plan'}
533 12 0 if (my $method = $plan_cmds{$cmd}) { }
549 12 0 if ($arg) { }
0 0 elsif (not defined $arg) { }
577 12 0 if (@_)
578 0 12 unless $max =~ /^\+?\d+$/
584 12 0 unless $self->no_header
600 0 0 if $arg
633 0 12 if $$self{'Have_Output_Plan'}
636 0 12 if defined $directive
637 0 12 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 63 0 if $$self{'Expected_Tests'}
737 0 0 if $$self{'No_Plan'}
753 0 0 $self->parent ? :
755 0 0 unless $self->no_header
756 0 0 if ($self->parent)
778 14 0 if (defined $pack)
808 0 63 if ($$self{'Child_Name'} and not $$self{'In_Destroy'})
809 0 0 unless defined $name
815 60 3 $test ? :
823 0 63 if defined $name and $name =~ /^[\d\s]+$/
832 0 63 if $in_todo
839 3 60 if (not $test) { }
841 0 3 $self->in_todo ? :
848 63 0 if $self->use_numbers
850 63 0 if (defined $name) { }
859 0 63 if ($self->in_todo) { }
874 3 60 unless ($test)
875 0 3 $self->in_todo ? :
876 3 0 if $ENV{'HARNESS_ACTIVE'}
879 3 0 if (defined $name) { }
888 3 60 unless $test or $self->in_todo
893 60 3 $test ? :
903 0 63 unless defined $plan
904 0 63 if $plan =~ /\D/
905 0 63 if $plan < $$self{'Curr_Test'}
916 0 126 if ($self->_is_object($$thing))
917 0 0 if (my $string_meth = overload::Method($$thing, $type))
929 0 126 if ref $thing
0 126 $self->_try(sub { $thing->isa('UNIVERSAL') if ref $thing; } ) ? :
944 0 0 unless $self->_is_dualvar($$val)
956 0 0 if ref $val
987 0 53 unless (defined $got and defined $expect)
992 0 0 unless $test
1003 0 0 unless (defined $got and defined $expect)
1008 0 0 unless $test
1018 0 0 if (defined $$val) { }
1019 0 0 if ($type eq 'eq' or $type eq 'ne') { }
1080 0 0 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 53 if ($cmp_ok_bl{$type})
1182 0 53 $numeric_cmps{$type} ? :
1187 0 53 if $error
1194 0 53 unless ($ok)
1197 0 0 if ($type =~ /^(eq|==)$/) { }
0 0 elsif ($type =~ /^(ne|!=)$/) { }
1213 0 0 defined $got ? :
1214 0 0 defined $expect ? :
1230 0 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 0 unless defined $regex
1420 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) { }
1428 0 0 length $opts ? :
1439 0 0 if defined &re::is_regexp
1448 0 0 unless (defined $usable_regex)
1470 0 0 if $cmp eq '!~'
1476 0 0 unless ($ok)
1477 0 0 defined $thing ? :
1478 0 0 $cmp eq '=~' ? :
1525 0 286 if $error and $opts{'die_on_fail'}
1527 6 280 wantarray ? :
1544 0 42 unless defined $maybe_fh
1546 42 0 if ref $maybe_fh eq 'GLOB'
1547 0 0 if ref \$maybe_fh eq 'GLOB'
1587 0 281 if (defined $level)
1619 0 63 if (defined $use_nums)
1655 0 50 if (defined $no)
1727 0 27 $self->in_todo ? :
1733 0 24 if $self->no_diag
1734 0 24 unless @msgs
1737 0 24 if $^C
1741 24 0 defined $_ ? :
1772 0 0 ref $_ ? :
1777 0 0 if $dumper->can('Sortkeys')
1806 0 102 if $^C
1818 2 100 unless $msg =~ /\n\z/
1859 14 75 if (defined $fh)
1868 14 27 if (defined $fh)
1877 14 0 if (defined $fh)
1888 42 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 14 if $$self{'Opened_Testhandles'}
1947 0 14 unless open $Testout, '>&STDOUT'
1948 0 14 unless open $Testerr, '>&STDERR'
1966 28 0 if @src_layers
1976 28 28 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 30 0 if (@_)
2212 0 63 if defined $$self{'Todo'}
2216 0 63 if defined $todo
2240 0 225 unless $pack
2244 0 225 if $set
2260 0 162 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 56 225 wantarray ? :
2415 0 0 if ($check)
2451 0 14 if $self->no_ending
2452 0 14 if $$self{'Ending'}++
2458 0 14 if ($$self{'Original_Pid'} != $$)
2463 0 14 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 2 12 unless ($$self{'Have_Plan'})
2495 0 12 if ($$self{'Bailed_Out'})
2501 6 6 if (@$test_results) { }
0 6 elsif ($$self{'Skip_All'}) { }
6 0 elsif ($real_exit_code) { }
2503 0 6 if ($$self{'No_Plan'})
2504 0 0 unless $self->no_header
2513 32 63 unless defined $$test_results[$idx]
2521 2 4 if ($num_extra != 0)
2522 0 2 $$self{'Expected_Tests'} == 1 ? :
2529 3 3 if ($num_failed)
2531 3 0 $num_failed == 1 ? :
2533 1 2 $num_extra == 0 ? :
2541 2 4 if ($real_exit_code)
2546 2 0 if _my_exit($real_exit_code)
2550 1 3 if ($num_failed) { }
0 3 elsif ($num_extra != 0) { }
2551 1 0 $num_failed <= 254 ? :
2560 4 0 if _my_exit($exit_code)
2563 0 0 if _my_exit(0)
2570 6 0 if _my_exit($real_exit_code)
2575 0 0 if _my_exit(255)
2583 14 0 if defined $Test