Branch Coverage

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


line true false branch
19 19 3 unless defined $self->{'retries'}
21 17 5 unless ($self->{'pidfile'})
25 0 17 unless -w $dir
31 17 0 if $pidfile =~ /^\s*(.*)\s*/
56 167 0 unless $self->{'verbose'}
65 0 22 unless open PID, $pidfile
66 0 22 unless flock PID, 1
68 22 0 if (defined $pid and $pid =~ /([0-9]+)/) { }
85 0 3 if ($^O eq 'riscos') { }
107 2 1 if (_is_running($pid)) { }
111 0 2 if ($attempt <= $self->{'retries'})
121 1 1 if ($self->{'silent'}) { }
130 0 1 unless open PID, ">$pidfile"
137 19 1 unless (-e $pidfile)
139 0 19 unless open PID, ">$pidfile"
140 0 19 unless flock PID, 2
141 0 19 unless print PID "$$\n"
143 0 19 unless close PID
154 2 20 unless $self->{'created'}
157 19 1 if ($pidfile and -e $pidfile) { }
160 16 3 if ($pid == $$) { }
3 0 elsif ($^O ne 'MSWin32' and $^O ne 'riscos') { }
162 16 0 if $pidfile and -e $pidfile
168 0 3 if ($ppid != $pid)