Branch Coverage

inc/Test/Builder.pm
Criterion Covered Total %
branch 92 372 24.7


line true false branch
11 0 19 if ($] < 5.008)
22 0 19 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 280 if (@_)
409 0 0 if ($self->parent and $$ == $$self{'Original_Pid'})
530 2 4 unless $cmd
534 0 4 if $$self{'Have_Plan'}
536 4 0 if (my $method = $plan_cmds{$cmd}) { }
552 17 0 if ($arg) { }
0 0 elsif (not defined $arg) { }
580 17 0 if (@_)
581 0 17 unless $max =~ /^\+?\d+$/
587 17 0 unless $self->no_header
603 0 0 if $arg
636 0 19 if $$self{'Have_Output_Plan'}
639 2 17 if defined $directive
640 2 17 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 261 0 if $$self{'Expected_Tests'}
740 0 0 if $$self{'No_Plan'}
756 0 2 $self->parent ? :
758 2 0 unless $self->no_header
759 0 2 if ($self->parent)
781 19 0 if (defined $pack)
811 0 261 if ($$self{'Child_Name'} and not $$self{'In_Destroy'})
812 0 0 unless defined $name
818 261 0 $test ? :
826 0 261 if defined $name and $name =~ /^[\d\s]+$/
835 0 261 if $in_todo
842 0 261 if (not $test) { }
844 0 0 $self->in_todo ? :
851 261 0 if $self->use_numbers
853 247 14 if (defined $name) { }
862 0 261 if ($self->in_todo) { }
877 0 261 unless ($test)
878 0 0 $self->in_todo ? :
879 0 0 if $ENV{'HARNESS_ACTIVE'}
882 0 0 if (defined $name) { }
891 0 261 unless $test or $self->in_todo
896 261 0 $test ? :
906 0 261 unless defined $plan
907 0 261 if $plan =~ /\D/
908 0 261 if $plan < $$self{'Curr_Test'}
919 0 522 if ($self->_is_object($$thing))
920 0 0 if (my $string_meth = overload::Method($$thing, $type))
932 0 522 if ref $thing
0 522 $self->_try(sub { $thing->isa('UNIVERSAL') if ref $thing; } ) ? :
947 0 0 unless $self->_is_dualvar($$val)
959 0 0 if ref $val
990 1 146 unless (defined $got and defined $expect)
995 0 1 unless $test
1006 0 0 unless (defined $got and defined $expect)
1011 0 0 unless $test
1021 0 0 if (defined $$val) { }
1022 0 0 if ($type eq 'eq' or $type eq 'ne') { }
1083 0 0 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 146 if ($cmp_ok_bl{$type})
1186 0 146 $numeric_cmps{$type} ? :
1191 0 146 unless $succ
1198 0 146 unless ($ok)
1201 0 0 if ($type =~ /^(eq|==)$/) { }
0 0 elsif ($type =~ /^(ne|!=)$/) { }
1217 0 0 defined $got ? :
1218 0 0 defined $expect ? :
1234 0 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 0 unless defined $regex
1425 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) { }
1433 0 0 length $opts ? :
1444 0 0 if defined &re::is_regexp
1453 0 0 unless (defined $usable_regex)
1475 0 0 if $cmp eq '!~'
1481 0 0 unless ($ok)
1482 0 0 defined $thing ? :
1483 0 0 $cmp eq '=~' ? :
1530 0 1092 if $error and $opts{'die_on_fail'}
1532 10 1082 wantarray ? :
1549 0 57 unless defined $maybe_fh
1551 57 0 if ref $maybe_fh eq 'GLOB'
1552 0 0 if ref \$maybe_fh eq 'GLOB'
1592 0 929 if (defined $level)
1624 0 261 if (defined $use_nums)
1660 0 38 if (defined $no)
1732 0 0 $self->in_todo ? :
1738 0 0 if $self->no_diag
1739 0 0 unless @msgs
1742 0 0 if $^C
1746 0 0 defined $_ ? :
1777 0 0 ref $_ ? :
1782 0 0 if $dumper->can('Sortkeys')
1811 0 280 if $^C
1823 0 280 unless $msg =~ /\n\z/
1864 19 280 if (defined $fh)
1873 19 0 if (defined $fh)
1882 19 0 if (defined $fh)
1893 57 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 19 if $$self{'Opened_Testhandles'}
1952 0 19 unless open $Testout, '>&STDOUT'
1953 0 19 unless open $Testerr, '>&STDERR'
1971 38 0 if @src_layers
1981 38 38 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 19 0 if (@_)
2217 0 261 if defined $$self{'Todo'}
2221 0 261 if defined $todo
2245 0 783 unless $pack
2249 0 783 if $set
2265 0 522 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 146 783 wantarray ? :
2420 0 0 if ($check)
2456 0 19 if $self->no_ending
2457 0 19 if $$self{'Ending'}++
2463 0 19 if ($$self{'Original_Pid'} != $$)
2468 0 19 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 2 17 unless ($$self{'Have_Plan'})
2500 0 17 if ($$self{'Bailed_Out'})
2506 17 0 if (@$test_results) { }
0 0 elsif ($$self{'Skip_All'}) { }
0 0 elsif ($real_exit_code) { }
2508 0 17 if ($$self{'No_Plan'})
2509 0 0 unless $self->no_header
2518 0 261 unless defined $$test_results[$idx]
2526 0 17 if ($num_extra != 0)
2527 0 0 $$self{'Expected_Tests'} == 1 ? :
2534 0 17 if ($num_failed)
2536 0 0 $num_failed == 1 ? :
2538 0 0 $num_extra == 0 ? :
2546 0 17 if ($real_exit_code)
2551 0 0 if _my_exit($real_exit_code)
2555 0 17 if ($num_failed) { }
0 17 elsif ($num_extra != 0) { }
2556 0 0 $num_failed <= 254 ? :
2565 17 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 19 0 if defined $Test