Branch Coverage

blib/lib/Test2/API/Instance.pm
Criterion Covered Total %
branch 98 124 79.0


line true false branch
44 91 116 unless $self->{'finalized'}
56 21 57 unless @_
98 89 5 unless ($self->{'formatter'})
100 15 74 if ($ENV{'T2_FORMATTER'}) { }
1 73 elsif (@{$self->{'formatters'};}) { }
103 15 0 if ($ENV{'T2_FORMATTER'} =~ /^(\+)?(.*)$/) { }
104 10 5 $1 ? :
119 60 29 unless (ref $formatter or $formatter->can('write'))
122 5 55 unless ($ok)
134 36 53 unless $INC{'Test2/IPC.pm'} or @{$self->{'ipc_drivers'};}
139 50 3 unless (@{$self->{'ipc_drivers'};})
141 0 50 unless $ok
146 1 52 unless $driver->can('is_viable') and $driver->is_viable
147 0 52 unless $self->{'ipc'} = $driver->new
148 52 0 if $self->{'ipc'}->use_shm
155 6 5 $_[0]{'formatter'} ? :
162 1 0 unless $self->{'finalized'}
177 0 3 unless $code and $rtype eq 'CODE'
189 0 57 unless $code and $rtype eq 'CODE'
201 0 4 unless $code and $rtype eq 'CODE'
213 5 13 unless $code and $rtype eq 'CODE'
217 8 5 if $self->{'loaded'}
222 62 5 unless ($self->{'loaded'})
227 0 62 unless eval 'END { Test2::API::test2_set_is_end() }; 1'
240 5 13 unless $code and $rtype eq 'CODE'
251 3 2 unless $self->{'finalized'}
267 2 602 unless $self->{'ipc_polling'}
268 10 592 unless $self->{'ipc_shm_id'}
272 0 592 unless shmread $self->{'ipc_shm_id'}, $val, 0, $self->{'ipc_shm_size'}
274 584 8 if $val eq $self->{'ipc_shm_last'}
280 54 2 unless defined $self->ipc_polling
288 25 27 if defined $self->{'ipc_shm_id'}
294 27 0 $self->{'ipc'}->can('shm_size') ? :
295 4 23 unless my $shm_id = shmget($ipc_key, $shm_size, 438)
298 0 23 unless shmwrite $shm_id, $initial, 0, $shm_size
310 0 0 unless defined $self->{'ipc_shm_id'}
312 0 0 unless shmread $self->{'ipc_shm_id'}, $val, 0, $self->{'ipc_shm_size'}
313 0 0 if $val eq $self->{'ipc_shm_last'}
321 13 20 unless defined $self->{'ipc_shm_id'}
325 0 20 unless $val
333 1 2 unless defined $self->{'ipc_polling'}
343 23 14 if $pid == -1
344 8 6 unless $err
364 17 6 unless $fail
374 3 88 if ($INC{'Test/Builder.pm'} and $Test::Builder::VERSION ne $Test2::API::VERSION)
391 4 1 unless $ctx
393 0 1 if $ctx->_aborted and ${$ctx->_aborted;}
397 0 1 unless $trace->pid == $$
403 0 1 if $hub->bailed_out
404 0 1 if defined $hub->skip_reason
413 13 78 if ($self->{'pid'} != $$ or $self->{'tid'} != 0)
418 78 0 $self->{'stack'} ? :
420 16 50 if (@hubs and $self->{'ipc'} and not $self->{'no_wait'})
424 0 16 unless my $ipc = $hub->ipc
425 0 16 if $seen{$ipc}++
434 66 12 if (my $root = shift @hubs)
444 6 60 if (@hubs)
449 63 3 unless ($root->no_ending)
451 23 40 unless $root->ended
457 3 75 if $new_exit > 255
459 22 56 if ($new_exit)
463 3 19 if (@warn)