Branch Coverage

blib/lib/Proc/PersistentControl.pm
Criterion Covered Total %
branch 78 180 43.3


line true false branch
241 0 7 if ($^O =~ /^MSWin/)
261 7 0 unless ($self->{'sdir'})
262 7 0 if (not $^O =~ /^MSWin/) { }
264 7 0 -d '/var/tmp' ? :
274 7 0 unless -d $sdir
275 0 7 unless -d $sdir
278 0 7 if ($opthash{'debug'})
281 0 0 if ($size and $size > 102400)
284 0 0 unless open $_debugfh, '>>', $file
288 0 0 if ($@)
294 0 7 if (-e $rdir and not -d $rdir)
298 7 0 unless (-d $rdir)
299 0 7 unless mkpath($rdir)
307 132 0 unless $_debugfh
312 0 0 unless $msg =~ /\n$/
313 0 0 $INC{'Time/HiRes.pm'} ? :
326 0 3 if not $pid or $pid <= 0
328 3 0 unless ($^O =~ /^MSWin/)
336 0 0 if (Win32::Process::Open($process, $pid, 0))
341 0 0 if ($RC == Win32::Process::STILL_ACTIVE())
364 0 0 if ($_unix_grandch_pid)
376 3 0 if ($child == $_unix_grandch_pid)
380 0 3 unless open RC, '>', $_unix_grandch_dir . "/RC=$RC"
383 0 3 unless open I, '>>', $_unix_grandch_dir . '/info'
402 0 15 unless defined $childpid
404 6 9 if ($childpid == 0)
409 0 6 unless open I, '>', $pdir . '/info'
423 0 6 unless open STDOUT, '>', $pdir . '/STDOUT'
425 0 6 unless open STDERR, '>', $pdir . '/STDERR'
428 6 0 if ($opt->{'_closefdmax'} >= 3)
430 60 0 unless $_debugfh and $fd == fileno $_debugfh
442 3 3 if ($_unix_grandch_pid == 0)
455 3 0 if -e $pdir . '/pstart'
462 0 0 unless (exec @cmd)
468 0 3 unless defined $_unix_grandch_pid
479 1 2 $opt->{'timeout'} ? :
489 2 1 if $remain > 60
492 3 0 if $_unix_grandch_pid
499 1 2 if ($_unix_grandch_pid and kill 0, $_unix_grandch_pid)
501 0 1 unless open I, '>>', $pdir . '/info'
526 0 0 if $_debugfh
527 0 0 $opt->{'timeout'} ? :
528 0 0 if $timeout > 0
539 0 0 unless Win32::Process::Create($process, $^X, $Arg, 0, 0, '.')
546 0 0 unless open I, '>', $pdir . '/info'
568 1 1 if kill -15, $p and select(undef, undef, undef, 0.2), kill(-3, $p)
572 0 2 if kill 15, $p and select(undef, undef, undef, 0.2), kill(3, $p)
575 2 0 unless kill 0, $p
603 10 67 if /^pid=(\d+)/
604 7 70 if /^RC=(\d+)/
607 7 3 defined $RC ? :
614 0 0 unless opendir D, $sdir
616 0 0 if ($d =~ /^PPC-/ and -f "$sdir/$d/info")
633 1 0 if (opendir DD, $pdir) { }
636 1 6 if $f =~ /pid=(\d+)$/
639 0 1 unless $pid
656 0 2 unless open I, $infofile
660 17 0 if /([^=]+)=(.*)/
665 0 2 if $^O =~ /^MSWin/
676 0 2 unless opendir D, $pdir
679 2 14 if /^pid=(\d+)/
680 2 14 if /^RC=(\d+)/
683 2 0 if exists $ret{'_RC'}
684 0 0 if ($ret{'_pid'})
686 0 0 if $pidalive
691 2 0 if (exists $ret{'_RC'}) { }
694 0 0 if ($pidalive) { }
723 0 0 if (not $in[0]) { }
729 0 0 if -f $pdir . '/info'
752 0 27 if $o =~ /=/
753 0 27 if $o =~ /^_/
760 0 15 unless $psd and -d $psd
769 15 0 !($^O =~ /^MSWin/) ? :
781 9 9 if -e $psd . '/start' or -e $psd . '/fail'
786 0 9 if (-e $psd . '/fail') { }
9 0 elsif (-e $psd . '/start') { }
787 0 0 unless open FA, $psd . '/fail'
819 0 0 unless $i
820 0 0 if $key and $i->{$key} ne $val
845 0 0 unless (&_UID_alive($self->{'sdir'}, $UID))
878 0 1 unless &Proc::PersistentControl::_UID_alive($self->{'_controller'}{'sdir'}, $self->{'_PPCUID'})
884 1 0 !($^O =~ /^MSWin/) ? :
890 1 0 unless $self->IsAlive
894 0 1 if $self->IsAlive
928 0 2 unless $self->IsRipe
936 2 0 if (not -d $target) { }
937 0 0 unless rename $source, $target or move($source, $target) or Proc::PersistentControl::debug("rename/1st move($source, $target) failed, trying again"), select(undef, undef, undef, 0.2), move($source, $target) or Proc::PersistentControl::debug("2nd move($source, $target) failed, trying again"), select(undef, undef, undef, 0.8), move($source, $target)
950 0 2 unless -d $target
964 2 4 if (-d $pdir)
965 0 2 unless rmtree($pdir)