Branch Coverage

blib/lib/Unix/PID/Tiny.pm
Criterion Covered Total %
branch 89 106 83.9


line true false branch
18 78 5 unless exists $args_hr->{'minimum_pid'} and $args_hr->{'minimum_pid'} =~ /\A\d+\z/ms
20 25 58 if (defined $args_hr->{'ps_path'}) { }
21 20 5 unless $args_hr->{'ps_path'} =~ m[/$]
22 15 10 unless (-d $args_hr->{'ps_path'} and -x "$args_hr->{'ps_path'}ps")
41 10 10 if defined $give_kill_a_chance
44 5 15 if ($pid < $min)
53 10 5 if ($self->is_pid_running($pid))
63 5 5 if ($give_kill_a_chance)
66 5 5 if $self->is_pid_running($pid)
75 35 36 if not $check_pid or $check_pid < 0
77 11 25 if $> == 0 and _kill(0, $check_pid)
80 5 20 if -e "/proc/$$" and -r "/proc/$$" and -r "/proc/$check_pid"
85 5 15 if defined $outp[1]
92 30 15 if not $pid or $pid < 0
98 5 10 wantarray ? :
105 20 5 wantarray ? :
112 15 53 unless -e $pid_file
114 0 53 unless open my $pid_fh, '<', $pid_file
126 0 5 unless scalar @{$right;} == $count
129 0 10 unless $left->[$i] eq $right->[$i]
139 0 25 unless my(@pidfile_st) = stat $pid_file
141 5 20 if (defined $since)
142 5 0 if $pidfile_st[9] < $since
145 10 10 if ($self->{'check_proc_open_fds'}) { }
149 5 5 unless opendir my $dh, $dir
152 10 5 if $dirent eq '.' or $dirent eq '..'
155 0 5 unless my $dest = readlink $path
156 0 5 unless my(@st) = stat $dest
158 5 0 if (_sets_match([@pidfile_st[0, 1]], [@st[0, 1]]))
167 0 5 unless $found
170 5 5 unless $self->is_pid_running($pid)
178 17 5 unless $newpid
181 7 15 if ($rc and $newpid == $$)
186 0 7 if ($self->{'unlink_end_use_current_pid_only'}) { }
188 0 0 if ($self->{'carp_unlink_end'})
195 0 5 if 'Unix::PID::Tiny'->get_pid_from_pidfile($pid_file) eq $$
196 0 7 if ($self->{'carp_unlink_end'})
204 7 15 if defined $rc and $rc == 1
205 5 10 if defined $rc and $rc == 0
217 1 14 unless $newpid
219 1 14 if (ref $retry_conf eq 'ARRAY') { }
3 11 elsif (ref $retry_conf eq 'HASH') { }
222 1 5 if ref $retry_conf->[$idx] eq 'CODE'
240 7 28 if (-e $pid_file)
246 3 4 if int $curpid == $$ and $newpid == $$
247 3 1 if int $curpid == $$
248 1 0 if $self->is_pid_running(int $curpid)
255 25 3 unless ($pid_fh)
256 5 20 if $passes >= $retry_conf->[0]
257 1 19 if (ref $retry_conf->[$passes] eq 'CODE') { }
261 12 7 if $retry_conf->[$passes]
268 0 3 if ($self->{'keep_open'}) { }
280 0 3 unless sysopen my $pid_fh, $pid_file, 193