Branch Coverage

blib/lib/Parallel/MPM/Prefork.pm
Criterion Covered Total %
branch 37 140 26.4


line true false branch
105 0 3 if ($max_servers <= 0 or $max_spare_servers <= 0 or $min_spare_servers <= 0 or $start_servers <= 0)
110 0 3 if ($max_servers < $min_spare_servers)
115 0 3 if ($max_spare_servers < $min_spare_servers)
120 0 3 if ($start_servers > $max_servers) { }
0 3 elsif ($start_servers < $min_spare_servers) { }
129 2 1 if (defined($child_data_hook = $opts{'child_data_hook'}))
130 0 2 unless ref $child_data_hook eq 'CODE'
137 2 1 if ($child_data_hook)
139 2 0 if ($dhook_in_main) { }
156 0 3 if ($@)
168 0 0 if $done
170 0 0 if ($start_servers) { }
0 0 elsif ((my $lack = $min_spare_servers - $num_idle) > 0) { }
0 0 elsif ((my $plus = $num_idle - $max_spare_servers) > 0) { }
174 0 0 if $debug
176 0 0 if (_spawn($code, $args) // (return undef)) < 0
180 0 0 if $debug
184 0 0 if $debug
192 2 0 if ($start_servers) { }
0 0 elsif ((my $lack = $min_spare_servers - $num_idle) > 0) { }
0 0 elsif ((my $plus = $num_idle - $max_spare_servers) > 0) { }
197 0 0 if $debug
199 0 0 if not defined $pid or $pid >= 0
202 0 0 if $debug
206 0 0 if $debug
214 0 0 if not $am_parent
218 0 0 if not $am_parent
224 0 1 if $am_parent or not $parent_data_fh && ref $data
232 1 0 $thaw ? :
240 0 1 if $am_parent
252 0 2 if not $am_parent or $done++
261 0 2 unless $child_stat_fh
264 2 1 if $pid >= 0
266 0 3 unless $pid or $nbytes
269 0 2 if defined $exitcode
283 0 0 unless ref $child_sigh eq 'HASH'
285 0 0 if (%$child_sigh)
288 0 0 if (defined $code and ref $code ne 'CODE' and not $code =~ /^(?:DEFAULT|IGNORE)$/)
293 0 0 exists $SIG{$_} ? :
304 0 5 unless socketpair $_[0], $_[1], 1, 1, 0
316 0 0 if ($cpid)
328 0 0 if defined $hnd and $sig ne 'FPE'
343 0 2 if ($num_idle + $num_busy >= $max_servers)
355 1 1 if ($cpid) { }
1 0 elsif (defined $cpid) { }
366 0 1 if $child_sigh
368 0 1 if ($code)
388 0 0 if ($pid == $dhook_pid) { }
393 0 0 if delete $busy{$pid}
394 0 0 if delete $idle{$pid}
395 0 0 if $debug
405 0 0 if (select my $rfds = $child_fds, undef, undef, $timeout)
407 0 0 if ($dhook_in_main and unpack '%32b*', $rfds & $child_data_fd)
411 0 0 if $status_changed
423 0 0 unless $busy{$pid} or $idle{$pid}
424 0 0 if ($status eq 'R') { }
0 0 elsif ($status eq 'S') { }
0 0 elsif ($status ne '0') { }
425 0 0 if delete $idle{$pid}
426 0 0 unless $busy{$pid}++
429 0 0 if delete $busy{$pid}
430 0 0 unless $idle{$pid}++
440 1 2 unless $child_data_fh and fileno $child_data_fh
443 2 0 $dhook_in_main ? :
453 0 1 if ($pid <= 1 or $exitcode > 256 or $thaw > 1 or $data_len < 3)
469 0 1 if ($cbytes != $data_len)
479 1 0 $thaw ? :
1 0 $exitcode <= 255 ? :
486 1 0 if $chunks
504 0 0 $count == 1 ? :