Branch Coverage

blib/lib/Test2/API.pm
Criterion Covered Total %
branch 114 150 76.0


line true false branch
22 0 749 @_ ? :
25 502 247 if $before
26 0 247 unless $ENDING
28 0 247 unless $INST
29 0 247 unless my $stack = $INST->stack
30 1 246 unless my $root = $stack->root
32 28 218 unless $root->count
34 7 211 unless $$ == $INST->pid
35 0 211 unless &get_tid() == $INST->tid
62 0 0 if $init and $load
71 0 237 unless eval 'END { test2_set_is_end() }; 1'
76 246 0 if ($] ge '5.014' or $ENV{'T2_CHECK_DEPTH'} or $Test2::API::DO_DEPTH_CHECK) { }
213 0 2 unless $INST
216 0 2 unless my $stack = $INST->stack
219 0 2 unless @$stack
223 0 2 unless my $root_hub = $stack->[0]
226 1 1 if $root_hub->ended
233 2 3 if @_
269 1 0 if @_
289 18 249 if ($ENV{'T2_FORMATTER'} and $ENV{'T2_FORMATTER'} =~ /^(\+)?(.*)$/)
290 0 18 $1 ? :
303 1 1 unless $formatter
304 1 0 if $INST->formatter_set
328 2 2 defined $want ? :
1 4 $want ? :
337 2 3 unless $ok
339 1 2 if $want
340 1 1 if defined $want
356 0 3 unless $ok
371 104 13258 unless $INST->{'loaded'}
373 1 13361 unless defined wantarray
382 0 13361 if (not $hub || exists $params{'hub'} and @$stack)
399 88 13273 if $hub->{'_context_acquire'}
407 53 13308 $end_phase ? :
408 515 12846 unless ($pkg or $end_phase)
409 1 514 unless $params{'fudge'}
418 1 5026 if ($current and $params{'on_release'} and $depth_ok)
424 5024 8336 if $current and $depth_ok
437 3 8333 if ($current)
438 2 1 unless (${$current->{'_aborted'};})
440 0 2 unless $current->{'_is_canon'}
442 2 0 unless $depth_ok
446 3 0 if $current->{'_is_canon'}
467 43 8293 $$UUID_VIA ? :
487 2 8334 $params{'on_release'} ? :
496 49 8287 if $hub->{'_context_init'}
498 2 8334 if $params{'on_init'}
584 13 51 if (my $global_ipc = test2_ipc())
611 0 55 if (not $ok and $err =~ /Label not found for "last T2_SUBTEST_WRAPPER"/ or &blessed($err) and $err->isa('Test2::Hub::Interceptor::Terminator'))
624 1 62 unless $ok
626 2 60 if $ok and not $hub->no_ending and not $hub->ended
641 103 19 unless ref $params
651 16 106 unless $buffered
663 106 16 if ($buffered)
664 80 26 if (my $format = $hub->format)
665 79 1 $format->can('hide_buffered') ? :
666 78 2 if $hide
670 5 117 if ($inherit_trace)
690 0 119 if (not $ok and $err =~ /Label not found for "last T2_SUBTEST_WRAPPER"/ or &blessed($err) and &blessed($err) eq 'Test::Builder::Exception') { }
699 2 119 if ($params->{'no_fork'}) { }
0 119 elsif (not $parent->is_local || $parent->ipc) { }
700 1 1 if ($$ != $ctx->trace->pid)
701 0 1 $ok ? :
705 0 1 if (0 != $ctx->trace->tid)
706 0 0 $ok ? :
711 0 0 $ok ? :
721 2 118 unless ($finished)
722 0 2 if ($bailed and not $buffered) { }
2 0 elsif ($bailed and $buffered) { }
731 0 0 if $code
735 120 0 if $ok and not $hub->no_ending and not $hub->ended
755 12 108 unless $e->pass
757 0 120 unless $ok
759 1 119 if defined $plan_ok and not $plan_ok
762 2 118 if $bailed and $buffered