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 13254 unless $INST->{'loaded'}
373 1 13357 unless defined wantarray
382 0 13357 if (not $hub || exists $params{'hub'} and @$stack)
399 88 13269 if $hub->{'_context_acquire'}
407 53 13304 $end_phase ? :
408 515 12842 unless ($pkg or $end_phase)
409 1 514 unless $params{'fudge'}
418 1 5025 if ($current and $params{'on_release'} and $depth_ok)
424 5023 8333 if $current and $depth_ok
437 3 8330 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 8290 $$UUID_VIA ? :
487 2 8331 $params{'on_release'} ? :
496 49 8284 if $hub->{'_context_init'}
498 2 8331 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 102 19 unless ref $params
651 16 105 unless $buffered
663 105 16 if ($buffered)
664 79 26 if (my $format = $hub->format)
665 78 1 $format->can('hide_buffered') ? :
666 77 2 if $hide
670 5 116 if ($inherit_trace)
690 0 118 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 118 if ($params->{'no_fork'}) { }
0 118 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 117 unless ($finished)
722 0 2 if ($bailed and not $buffered) { }
2 0 elsif ($bailed and $buffered) { }
731 0 0 if $code
735 119 0 if $ok and not $hub->no_ending and not $hub->ended
755 12 107 unless $e->pass
757 0 119 unless $ok
759 1 118 if defined $plan_ok and not $plan_ok
762 2 117 if $bailed and $buffered