Branch Coverage

blib/lib/IO/Async/Internals/ChildManager.pm
Criterion Covered Total %
branch 95 156 60.9


line true false branch
32 0 0 if $> == $uid
43 0 0 if $) == $gid
69 0 0 unless keys %gotgroups
80 0 41 unless my $loop = delete $params{'loop'}
101 4 334 if (%params)
105 4 330 if defined $command and defined $code
108 4 326 unless defined $command or defined $code
111 303 23 defined $setup ? :
122 0 324 unless ($readpipe, $writepipe) = "IO::Async::OS"->pipepair
126 123 201 if (defined $command)
127 114 9 ref $command ? :
154 1 302 unless ref $setup eq "ARRAY"
156 53 249 unless @$setup
166 14 417 if $key eq "stdin"
167 22 409 if $key eq "stdout"
168 3 428 if $key eq "stderr"
171 127 304 if ref $key and eval { do { $key->fileno; 1 } }
173 419 12 if ($key =~ /^fd(\d+)$/) { }
3 9 elsif ($key eq 'env') { }
1 8 elsif ($key eq 'nice') { }
1 7 elsif ($key eq 'chdir') { }
2 5 elsif ($key eq 'setuid') { }
2 3 elsif ($key eq 'setgid') { }
2 1 elsif ($key eq 'setgroups') { }
177 128 291 if (not $ref) { }
253 38 elsif ($ref eq 'ARRAY') { }
38 0 elsif ($ref eq 'GLOB' or eval { do { $value->isa('IO::Handle') } }) { }
191 0 419 unless grep {$_ eq $operation;} "open", "close", "dup", "keep"
195 0 3 unless ref $value eq "HASH"
198 0 1 unless $value =~ /^\d+$/
204 0 1 unless -d $value
207 0 2 unless $value =~ /^\d+$/
210 0 2 unless $value =~ /^\d+$/
211 0 2 if $has_setgroups
214 0 2 unless ref $value eq "ARRAY"
252 288 382 if (not defined $dollarbang) { }
191 191 elsif (not defined $dollarat) { }
253 194 94 if (length $$buffref >= 8)
260 191 0 if (length $$buffref >= $length_dollarat)
266 285 0 if ($eof)
267 94 191 unless defined $dollarbang
268 94 191 unless (defined $length_dollarat)
275 118 167 if (defined $exitcode)
288 166 121 if ($pipeclosed)
315 22 7 if (@$setup)
320 0 41 unless $key =~ /^fd(\d+)$/
323 27 14 if $fd > $max_fd
324 0 41 if $fd == fileno $writepipe
328 0 41 if ($operation eq "close")
333 39 2 if ($operation eq "dup")
344 2 39 if ($operation eq "keep")
351 128 222 if $fds_refcount{$_}
352 29 193 if $_ == fileno $writepipe
356 22 7 if (@$setup)
357 0 22 if ($writepipe_clashes)
360 0 0 unless dup2(fileno $writepipe, $max_fd)
362 0 0 unless open $writepipe, ">&=$max_fd"
368 41 0 if ($key =~ /^fd(\d+)$/) { }
0 0 elsif ($key eq 'env') { }
0 0 elsif ($key eq 'nice') { }
0 0 elsif ($key eq 'chdir') { }
0 0 elsif ($key eq 'setuid') { }
0 0 elsif ($key eq 'setgid') { }
0 0 elsif ($key eq 'setgroups') { }
372 39 2 if ($operation eq "dup")
375 39 0 if ($from != $fd)
376 0 39 if (exists $dup_from{$fd})
377 0 0 unless defined($dup_from{$fd} = dup($fd))
383 0 39 unless dup2($real_from, $fd)
387 39 0 unless ($fds_refcount{$from} or $fd_in_use{$from})
393 0 41 if ($operation eq "open")
395 0 0 unless open my $fh, $mode, $filename
398 0 0 unless dup2($from, $fd)
407 0 0 unless nice($value)
410 0 0 unless chdir $value
413 0 0 unless setuid($value)
416 0 0 unless setgid($value)
419 0 0 unless setgroups(@$value)