Branch Coverage

blib/lib/Proc/Pidfile.pm
Criterion Covered Total %
branch 32 48 66.6


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