Branch Coverage

blib/lib/No/Worries/PidFile.pm
Criterion Covered Total %
branch 38 118 32.2


line true false branch
41 0 2 unless flock $fh, 2
43 0 2 unless sysseek $fh, 0, 0
49 0 4 unless defined $done
52 0 2 if ($noclose) { }
53 0 0 unless flock $fh, 8
56 0 2 unless close $fh
70 0 1 unless flock $fh, 2
72 0 1 unless sysseek $fh, 0, 0
74 0 1 unless truncate $fh, 0
80 0 1 unless defined $done
85 0 1 unless close $fh
96 1 0 if kill 0, $pid
97 0 0 if $! == 3
114 0 0 unless &_alive($pid)
115 0 0 if &Time::HiRes::time() > $maxtime
118 0 0 if (&_alive($pid)) { }
121 0 0 if ($option{'kill'}) { }
141 1 1 unless (sysopen $fh, $path, 2)
142 1 0 if ($! == 2)
149 0 1 unless @stat = stat $fh
152 0 1 if ($data eq "")
158 1 0 if ($data =~ /^(\d+)(\s+([a-z]+))?\s*$/s) { }
163 0 1 unless (&_alive($pid))
169 0 1 if ($option{'freshness'} and $stat[9] < &Time::HiRes::time() - $option{'freshness'})
193 0 2 if @_
195 1 1 unless sysopen $fh, $path, 193
212 0 2 if @_
214 1 1 unless sysopen $fh, $path, 2
217 1 0 if ($data =~ /^(\d+)\s*$/s) { }
0 0 elsif ($data =~ /^(\d+)\s+([a-z]+)\s*$/s) { }
225 0 1 unless $pid == $option{'pid'}
238 1 1 unless utime $now, $now, $path
249 1 1 unless (unlink $path)
250 1 0 if $! == 2
268 0 2 if @_
269 0 2 if ($option{'timeout'}) { }
274 0 0 if $status or &Time::HiRes::time() > $maxtime
281 0 2 if wantarray
299 1 0 if @_
302 1 0 unless (sysopen $fh, $path, 2)
303 1 0 if ($! == 2)
310 0 0 if ($data eq "")
316 0 0 if ($data =~ /^(\d+)(\s+([a-z]+))?\s*$/s) { }
324 0 0 unless (sysopen $fh, $path, 2)
325 0 0 if $! == 2
329 0 0 if $data eq ""
330 0 0 if ($data =~ /^(\d+)(\s+([a-z]+))?\s*$/s) { }
331 0 0 unless $1 == $pid
337 0 0 unless (unlink $path)
339 0 0 unless $! == 2
355 0 0 if @_
356 0 0 unless defined $option{'time'}
357 0 0 if ($path) { }
358 0 0 if $option{'time'}
360 0 0 if &pf_check($path) eq "quit"
362 0 0 unless $option{'time'}
364 0 0 if $sleep <= 0
365 0 0 if $sleep > 1
369 0 0 if $option{'time'}