Branch Coverage

blib/lib/Test2/IPC/Driver/Files.pm
Criterion Covered Total %
branch 102 136 75.0


line true false branch
31 0 83 unless $tmpdir
36 1 82 if $ENV{'T2_KEEP_TEMPDIR'}
62 1 37 unless my $type = &blessed($e)
64 1 36 unless $type->isa('Test2::Event')
82 1 91 if -e $hfile
85 0 91 unless open my $fh, '>', $hfile
97 1 55 unless -e $hfile
100 0 55 unless open my $fh, '<', $hfile
104 0 55 unless $pid == $$
107 0 55 unless 0 == $tid
110 1 54 if ($ENV{'T2_KEEP_TEMPDIR'}) { }
112 0 1 unless $ok
116 0 54 unless $ok
119 0 55 unless opendir my $dh, $tdir
123 2 167 if $file =~ /\.complete$/
124 166 1 unless $file =~ /^$hid/
126 0 1 unless eval { do { $bad{$file} = $self->read_event_file('File::Spec'->catfile($tdir, $file)); 1 } }
130 54 1 unless keys %bad
147 0 1 unless defined $data
174 36 0 if defined $blocked
185 21 18 $global ? :
187 1 38 unless $global or -f $hfile
203 21 15 if ($global)
216 35 1 if ($ok) { }
217 0 35 unless $ren_ok
253 0 0 unless eval { do { my $abort = 'File::Spec'->catfile($self->{'tempdir'}, 'ABORT'); die "Could not open abort file: $!" unless open my $fh, '>>', $abort; print $fh $msg, "\n"; die "Could not close abort file: $!" unless close $fh; 1 } }
255 0 0 unless open my $fh, '>>', $abort
257 0 0 unless close $fh
268 0 743 unless opendir my $dh, $tempdir
275 13 13 unless ($info->{'global'})
280 0 13 if ($next != $info->{'eid'})
282 0 0 unless 5 < time - $$timeouts{$info->{'file'}}
294 13 13 if $info->{'global'}
296 1 12 if ($ENV{'T2_KEEP_TEMPDIR'}) { }
299 0 1 unless $ok
303 0 12 unless $ok
316 5 125 if my $complete = substr($file, -9, 9) eq '.complete' || 0
317 124 6 if my $ready = substr($file, -6, 6) eq '.ready' || 0
320 104 26 $parts[0] eq 'GLOBAL' ? :
341 1486 1175 if substr($file, 0, 1) eq '.'
342 1052 123 if substr($file, 0, 3) eq 'HUB'
343 0 123 if $file eq 'ABORT'
347 3 120 if $parsed->{'complete'}
348 4 116 unless $parsed->{'ready'}
349 1 115 unless $parsed->{'global'} or $parsed->{'hid'} eq $hid
351 85 30 if $parsed->{'global'} and $self->{'globals'}{$hid}{$file}++
355 0 30 if ${^TAINT}
364 8 38 if $Test2::IPC::Driver::Files::a->{'global'} and not $Test2::IPC::Driver::Files::b->{'global'}
365 3 35 if $Test2::IPC::Driver::Files::b->{'global'} and not $Test2::IPC::Driver::Files::a->{'global'}
377 1 30 unless &blessed($obj)
380 2 28 unless ($obj->isa('Test2::Event'))
385 1 1 unless $ok
388 1 0 unless $obj->isa('Test2::Event')
410 1 57 unless defined $self->pid
411 1 56 unless defined $self->tid
413 2 54 unless $$ == $self->pid
414 1 53 unless 0 == $self->tid
420 0 53 if (-e $abort_file)
423 0 0 unless $ok
426 0 53 unless opendir my $dh, $tempdir
428 104 8 if $file =~ /^\.+$/
429 2 6 if $file =~ /\.complete$/
433 5 1 if ($aborted or $file =~ /^(GLOBAL|HUB$sep)/)
436 1 4 if $ENV{'T2_KEEP_TEMPDIR'}
438 0 4 unless $ok
446 1 51 if ($ENV{'T2_KEEP_TEMPDIR'})
452 0 51 if -e $abort
453 0 51 unless rmdir $tempdir