Branch Coverage

blib/lib/Proc/SafeExec.pm
Criterion Covered Total %
branch 85 158 53.8


line true false branch
234 11 9 unless defined $$options{'stdin'}
235 2 18 unless defined $$options{'stdout'}
236 20 0 unless defined $$options{'stderr'}
237 0 20 unless $$options{'exec'} or $$options{'fork'}
238 0 20 if $$options{'exec'} and $$options{'fork'}
239 0 20 if $$self{'debug'} and $$options{'exec'}
240 20 0 if ($$options{'exec'})
243 0 20 unless defined $$options{'exec'}[$count]
252 5 15 if (ref $$options{'stdin'}) { }
4 11 elsif ($$options{'stdin'} eq 'new') { }
0 11 elsif ($$options{'stdin'} eq 'close') { }
11 0 elsif ($$options{'stdin'} eq 'default') { }
258 0 4 unless pipe $$options{'stdin'}, $$self{'stdin'}
268 12 8 if (ref $$options{'stdout'}) { }
6 2 elsif ($$options{'stdout'} eq 'new') { }
0 2 elsif ($$options{'stdout'} eq 'close') { }
2 0 elsif ($$options{'stdout'} eq 'default') { }
274 0 6 unless pipe $$self{'stdout'}, $$options{'stdout'}
284 0 20 if (ref $$options{'stderr'}) { }
0 20 elsif ($$options{'stderr'} eq 'new') { }
0 20 elsif ($$options{'stderr'} eq 'close') { }
20 0 elsif ($$options{'stderr'} eq 'default') { }
290 0 0 unless pipe $$self{'stderr'}, $$options{'stderr'}
303 0 20 unless pipe my $error_pipe_r, my $error_pipe_w
309 0 20 unless defined $$self{'child_pid'}
311 15 5 if ($$self{'child_pid'})
316 7 8 if ref $$options{'stdin'}
317 14 1 if ref $$options{'stdout'}
318 0 15 if ref $$options{'stderr'}
322 1 14 if (defined(my $err = <$error_pipe_r>))
346 2 3 if (ref $$options{'stdin'}) { }
0 3 elsif ($$options{'stdin'} eq 'close') { }
3 0 elsif ($$options{'stdin'} eq 'default') { }
349 0 2 unless open STDIN, '<&', $$options{'stdin'}
353 0 0 unless open STDIN, '<', '/dev/null'
359 4 1 if (ref $$options{'stdout'}) { }
0 1 elsif ($$options{'stdout'} eq 'close') { }
1 0 elsif ($$options{'stdout'} eq 'default') { }
362 0 4 unless open STDOUT, '>&', $$options{'stdout'}
366 0 0 unless open STDOUT, '>', '/dev/null'
372 0 5 if (ref $$options{'stderr'}) { }
0 5 elsif ($$options{'stderr'} eq 'close') { }
5 0 elsif ($$options{'stderr'} eq 'default') { }
375 0 0 unless open STDERR, '>&', $$options{'stderr'}
379 0 0 unless open STDERR, '>', '/dev/null'
399 0 5 if $$options{'child_callback'}
401 5 0 if ($$options{'exec'})
402 5 0 unless defined $$options{'real_arg0'}
405 0 5 if ($$options{'untaint_args'})
420 0 0 if ($$options{'fork'})
426 0 0 if ($@)
432 0 0 unless print $error_pipe_w $@
443 0 13 if defined $$self{'exit_status'}
445 13 0 unless ($$options{'no_close'} or $$options{'nonblock'})
449 2 11 if ref $$self{'stdin'}
450 4 9 if ref $$self{'stdout'}
451 0 13 if ref $$self{'stderr'}
454 0 13 $$options{'nonblock'} ? :
455 0 13 if $waitpid == -1
456 0 13 if $waitpid == 0
459 0 13 if $$self{'debug'}
470 1 12 if ($$self{'need_wait'} and not $$self{'no_autowait'} and not defined $$self{'exit_status'})
474 0 13 if ($$self{'exit_status'} and not $$self{'fetched_exit_status'})
502 12 0 if defined $_[0]{'exit_status'}
513 0 60 unless $fcntl = fcntl($fh, 3, 0)
514 0 60 unless $fcntl = fcntl($fh, 4, $fcntl | 1)
532 0 0 if wantarray
544 0 4 unless $ls->wait
545 0 4 unless $sort->wait
546 0 4 if $ls->exit_status
547 0 4 if $sort->exit_status
550 0 4 if $@
559 0 2 unless $ls->wait
560 0 2 unless $sort->wait
561 0 2 if $ls->exit_status
562 0 2 if $sort->exit_status
565 0 2 if $@
574 0 1 unless $@
578 0 1 if $@