Branch Coverage

inc/Test/Builder.pm
Criterion Covered Total %
branch 141 372 37.9


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)
238 0 0 if ('CODE' ne ref $subtests)
261 0 0 unless $self->_plan_handled
265 0 0 unless (eval { do { &$run_the_subtests() } })
278 0 0 if $error and not eval { do { $error->isa('Test::Builder::Exception') } }
283 0 0 if $$child{'Bailed_Out'}
341 0 0 unless $self->parent
342 0 0 if ($$self{'Child_Name'})
355 0 0 unless ($$self{'Bailed_Out'})
356 0 0 if ($$self{'Skip_All'}) { }
0 0 elsif (not @{$$self{'Test_Results'};}) { }
375 0 799 if (@_)
409 0 0 if ($self->parent and $$ == $$self{'Original_Pid'})
530 25 32 unless $cmd
534 0 32 if $$self{'Have_Plan'}
536 32 0 if (my $method = $plan_cmds{$cmd}) { }
552 31 0 if ($arg) { }
0 0 elsif (not defined $arg) { }
580 31 0 if (@_)
581 0 31 unless $max =~ /^\+?\d+$/
587 31 0 unless $self->no_header
603 0 1 if $arg
636 0 32 if $$self{'Have_Output_Plan'}
639 0 32 if defined $directive
640 0 32 if defined $reason
689 0 0 if (defined $num_tests) { }
696 0 0 if ($$self{'Done_Testing'})
704 0 0 if ($self->expected_tests and $num_tests != $self->expected_tests) { }
712 0 0 unless $$self{'Have_Output_Plan'}
717 0 0 if $$self{'Expected_Tests'} != $$self{'Curr_Test'}
720 0 0 if $$self{'Curr_Test'} == 0
739 627 1 if $$self{'Expected_Tests'}
740 1 0 if $$self{'No_Plan'}
756 0 0 $self->parent ? :
758 0 0 unless $self->no_header
759 0 0 if ($self->parent)
781 44 0 if (defined $pack)
811 0 628 if ($$self{'Child_Name'} and not $$self{'In_Destroy'})
812 0 0 unless defined $name
818 593 35 $test ? :
826 0 628 if defined $name and $name =~ /^[\d\s]+$/
835 42 586 if $in_todo
842 35 593 if (not $test) { }
844 32 3 $self->in_todo ? :
851 628 0 if $self->use_numbers
853 442 186 if (defined $name) { }
862 42 586 if ($self->in_todo) { }
877 35 593 unless ($test)
878 32 3 $self->in_todo ? :
879 35 0 if $ENV{'HARNESS_ACTIVE'}
882 33 2 if (defined $name) { }
891 3 625 unless $test or $self->in_todo
896 593 35 $test ? :
906 0 628 unless defined $plan
907 1 627 if $plan =~ /\D/
908 0 627 if $plan < $$self{'Curr_Test'}
919 6 1382 if ($self->_is_object($$thing))
920 0 6 if (my $string_meth = overload::Method($$thing, $type))
932 70 1318 if ref $thing
6 1382 $self->_try(sub { $thing->isa('UNIVERSAL') if ref $thing; } ) ? :
947 0 0 unless $self->_is_dualvar($$val)
959 0 0 if ref $val
990 14 570 unless (defined $got and defined $expect)
995 3 11 unless $test
1006 0 0 unless (defined $got and defined $expect)
1011 0 0 unless $test
1021 62 3 if (defined $$val) { }
1022 62 0 if ($type eq 'eq' or $type eq 'ne') { }
1083 0 3 unless (defined $got and defined $dont_expect)
1088 0 0 unless $test
1099 0 0 unless (defined $got and defined $dont_expect)
1104 0 0 unless $test
1160 0 573 if ($cmp_ok_bl{$type})
1186 0 573 $numeric_cmps{$type} ? :
1191 0 573 unless $succ
1198 31 542 unless ($ok)
1201 28 3 if ($type =~ /^(eq|==)$/) { }
3 0 elsif ($type =~ /^(ne|!=)$/) { }
1217 0 0 defined $got ? :
1218 0 0 defined $expect ? :
1234 18 0 if defined $file and defined $line
1265 0 0 if ($self->parent)
1297 0 0 unless defined $name
1314 0 0 if $self->use_numbers
1316 0 0 if length $why
1354 0 0 if $self->use_numbers
1420 0 18 unless defined $regex
1425 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) { }
1433 0 0 length $opts ? :
1444 18 0 if defined &re::is_regexp
1453 0 18 unless (defined $usable_regex)
1475 3 15 if $cmp eq '!~'
1481 0 18 unless ($ok)
1482 0 0 defined $thing ? :
1483 0 0 $cmp eq '=~' ? :
1530 0 2774 if $error and $opts{'die_on_fail'}
1532 0 2774 wantarray ? :
1549 0 96 unless defined $maybe_fh
1551 96 0 if ref $maybe_fh eq 'GLOB'
1552 0 0 if ref \$maybe_fh eq 'GLOB'
1592 0 2522 if (defined $level)
1624 0 628 if (defined $use_nums)
1660 0 168 if (defined $no)
1732 126 13 $self->in_todo ? :
1738 0 104 if $self->no_diag
1739 0 104 unless @msgs
1742 0 104 if $^C
1746 104 0 defined $_ ? :
1777 0 0 ref $_ ? :
1782 0 0 if $dumper->can('Sortkeys')
1811 0 799 if $^C
1823 0 799 unless $msg =~ /\n\z/
1864 32 660 if (defined $fh)
1873 32 13 if (defined $fh)
1882 32 126 if (defined $fh)
1893 96 0 if ($self->is_fh($file_or_fh)) { }
0 0 elsif (ref $file_or_fh eq 'SCALAR') { }
1898 0 0 if ($] >= 5.008) { }
1899 0 0 unless open $fh, '>>', $file_or_fh
1904 0 0 unless $fh = 'Test::Builder::IO::Scalar'->new($file_or_fh)
1909 0 0 unless open $fh, '>', $file_or_fh
1948 0 32 if $$self{'Opened_Testhandles'}
1952 0 32 unless open $Testout, '>&STDOUT'
1953 0 32 unless open $Testerr, '>&STDERR'
1971 64 0 if @src_layers
1981 64 64 if $_ ne 'unix'
2064 0 0 if (defined $num)
2069 0 0 if ($num > @$test_results) { }
0 0 elsif ($num < @$test_results) { }
2070 0 0 @$test_results ? :
2111 36 0 if (@_)
2217 0 628 if defined $$self{'Todo'}
2221 44 584 if defined $todo
2245 0 1896 unless $pack
2249 0 1896 if $set
2265 306 1194 defined $$self{'Todo'} || $self->find_TODO ? :
2313 0 0 @_ ? :
2316 0 0 if ($self->in_todo)
2336 0 0 unless ($$self{'Start_Todo'})
2342 0 0 if ($$self{'Start_Todo'} and @{$$self{'Todo_Stack'};}) { }
2376 626 1896 wantarray ? :
2420 0 0 if ($check)
2456 0 32 if $self->no_ending
2457 0 32 if $$self{'Ending'}++
2463 0 32 if ($$self{'Original_Pid'} != $$)
2468 0 32 if (not $$self{'Have_Plan'} and $$self{'Curr_Test'})
2472 0 0 if ($real_exit_code)
2477 0 0 if _my_exit($real_exit_code)
2482 0 0 if (@$test_results)
2484 0 0 if ($num_failed > 0)
2486 0 0 $num_failed <= 254 ? :
2487 0 0 if _my_exit($exit_code)
2490 0 0 if _my_exit(254)
2495 0 32 unless ($$self{'Have_Plan'})
2500 0 32 if ($$self{'Bailed_Out'})
2506 32 0 if (@$test_results) { }
0 0 elsif ($$self{'Skip_All'}) { }
0 0 elsif ($real_exit_code) { }
2508 1 31 if ($$self{'No_Plan'})
2509 1 0 unless $self->no_header
2518 0 628 unless defined $$test_results[$idx]
2526 0 32 if ($num_extra != 0)
2527 0 0 $$self{'Expected_Tests'} == 1 ? :
2534 1 31 if ($num_failed)
2536 0 1 $num_failed == 1 ? :
2538 1 0 $num_extra == 0 ? :
2546 0 32 if ($real_exit_code)
2551 0 0 if _my_exit($real_exit_code)
2555 1 31 if ($num_failed) { }
0 31 elsif ($num_extra != 0) { }
2556 1 0 $num_failed <= 254 ? :
2565 32 0 if _my_exit($exit_code)
2568 0 0 if _my_exit(0)
2575 0 0 if _my_exit($real_exit_code)
2580 0 0 if _my_exit(255)
2588 32 0 if defined $Test