Branch Coverage

blib/lib/Test2/API/Instance.pm
Criterion Covered Total %
branch 126 154 81.8


line true false branch
52 281 434 unless $self->{'finalized'}
66 27 246 unless @_
77 0 1 if $self->{'finalized'} or $self->{'loaded'}
85 0 1 unless $self->{'preload'}
99 0 1 unless exists $self->{'add_uuid_via'}
107 0 1 $ENV{'T2_NO_IPC'} ? :
109 0 1 unless defined $self->{'ipc_timeout'}
134 2 353 $ENV{'T2_NO_IPC'} ? :
136 303 52 unless defined $self->{'ipc_timeout'}
157 0 284 if $self->{'preload'}
161 49 235 unless defined $self->{'_pid'}
162 49 235 unless defined $self->{'_tid'}
164 279 5 unless ($self->{'formatter'})
166 34 245 if ($ENV{'T2_FORMATTER'}) { }
159 86 elsif (@{$self->{'formatters'};}) { }
169 34 0 if ($ENV{'T2_FORMATTER'} =~ /^(\+)?(.*)$/) { }
170 10 24 $1 ? :
185 88 191 unless (ref $formatter or $formatter->can('write'))
188 5 83 unless ($ok)
200 4 275 if $self->{'ipc_disabled'}
201 217 58 unless $INC{'Test2/IPC.pm'} or @{$self->{'ipc_drivers'};}
206 55 3 unless (@{$self->{'ipc_drivers'};})
208 0 55 unless $ok
213 1 57 unless $driver->can('is_viable') and $driver->is_viable
214 0 57 unless $self->{'ipc'} = $driver->new
221 6 5 $_[0]{'formatter'} ? :
228 160 2 unless $self->{'finalized'}
243 0 165 unless $code and $rtype eq 'CODE'
255 0 62 unless $code and $rtype eq 'CODE'
267 0 3 unless $code and $rtype eq 'CODE'
279 5 175 unless $code and $rtype eq 'CODE'
283 10 165 if $self->{'loaded'}
292 5 12 unless $code and $rtype eq 'CODE'
300 265 267 unless ($self->{'loaded'})
302 0 265 if $self->{'preload'}
304 255 10 unless defined $self->{'_pid'}
305 255 10 unless defined $self->{'_tid'}
311 0 265 unless eval 'END { Test2::API::test2_set_is_end() }; 1'
324 5 175 unless $code and $rtype eq 'CODE'
334 1 3 if $self->{'ipc'}
344 7 2 unless $self->{'finalized'}
356 1 60 unless defined $self->{'_pid'}
357 1 60 unless defined $self->{'_tid'}
363 2 691 unless $self->{'ipc_polling'}
364 0 691 unless $self->{'ipc'}
365 0 691 unless $self->{'ipc'}->pending
368 59 2 unless defined $self->ipc_polling
375 0 0 unless $self->{'ipc'}
387 6 29 unless $self->{'ipc'}
390 0 29 unless $val
398 1 2 unless defined $self->{'ipc_polling'}
406 10 19 unless defined $timeout
409 29 0 if (&CAN_FORK())
416 28 17 if $pid == -1
417 8 9 unless $err
455 19 10 if $ok and not $fail
456 1 9 unless $ok
463 0 280 if $self->{'preload'}
468 3 277 if ($INC{'Test/Builder.pm'} and $Test::Builder::VERSION ne $Test2::API::VERSION)
485 29 1 unless $ctx
487 0 1 if $ctx->_aborted and ${$ctx->_aborted;}
491 0 1 unless $trace->pid and $trace->pid == $$
497 0 1 if $hub->bailed_out
498 0 1 if defined $hub->skip_reason
507 14 249 if (not defined $self->{'_pid'} && defined $self->{'_tid'} or $self->{'_pid'} != $$ or $self->{'_tid'} != 0)
512 249 0 $self->{'stack'} ? :
514 18 225 if (@hubs and $self->{'ipc'} and not $self->{'no_wait'})
518 0 18 unless my $ipc = $hub->ipc
519 0 18 if $seen{$ipc}++
528 243 6 if (my $root = shift @hubs)
538 6 237 if (@hubs)
543 224 19 unless ($root->no_ending)
545 101 123 unless $root->ended
548 9 215 unless $root->is_passing
552 3 246 if $new_exit > 255
554 24 225 if ($new_exit and eval {
557 3 21 if (@warn)