Branch Coverage

blib/lib/Proc/Pidfile.pm
Criterion Covered Total %
branch 36 50 72.0


line true false branch
19 20 4 unless defined $self->{'retries'}
20 23 1 unless defined $self->{'backoff'}
22 19 5 unless ($self->{'pidfile'})
26 0 19 unless -w $dir
32 19 0 if $pidfile =~ /^\s*(.*)\s*/
57 175 25 unless $self->{'verbose'}
66 0 28 unless open PID, $pidfile
67 0 28 unless flock PID, 1
69 28 0 if (defined $pid and $pid =~ /([0-9]+)/) { }
86 0 8 if ($^O eq 'riscos') { }
108 7 1 if (_is_running($pid)) { }
112 4 3 if ($attempt <= $self->{'retries'})
122 1 2 if ($self->{'silent'}) { }
131 0 1 unless open PID, ">$pidfile"
138 20 1 unless (-e $pidfile)
140 0 20 unless open PID, ">$pidfile"
141 0 20 unless flock PID, 2
142 0 20 unless print PID "$$\n"
144 0 20 unless close PID
155 3 21 unless $self->{'created'}
158 20 1 if ($pidfile and -e $pidfile) { }
161 17 3 if ($pid == $$) { }
3 0 elsif ($^O ne 'MSWin32' and $^O ne 'riscos') { }
163 17 0 if $pidfile and -e $pidfile
169 0 3 if ($ppid != $pid)