Branch Coverage

blib/lib/Run.pm
Criterion Covered Total %
branch 128 232 55.1


line true false branch
48 0 20 if ($^O eq 'os2') { }
0 20 elsif ($^O eq 'MSWin32' or $^O eq 'VMS') { }
49 0 0 if (@_ == 1 and $_[0] =~ /[\`|\"\'\$&;*?\{\}\[\]\(\)<>\s~]/ || $_[0] =~ /^\s*\w+=/)
61 0 20 if $Debug
63 0 20 unless defined $pid
64 15 5 if $pid
66 0 5 if $Debug
67 0 0 unless exec @_
73 42 0 ref $fh ? :
76 0 0 $mode == 2 ? :
0 0 $mode == 1 ? :
0 42 if $Debug
82 0 42 unless my $ret = fcntl($fh, $mode, $flag)
86 0 42 if $Debug
95 0 32 if $Debug
97 0 32 if not $res and $Debug
99 32 0 if ($res or $no_error_on_unwind_close and $how eq 'unwind: ')
109 17 22 ref $fh2 ? :
111 9 30 $mode eq 'r' ? :
113 0 39 if $Debug
115 39 0 if ($res = open($fh1, "$omode&$fd2")) { }
116 0 39 if $Debug
127 22 2 ref $fh ? :
128 22 2 ref $fh ? :
130 0 24 if $Debug
132 22 2 if ($res)
133 0 22 if $Debug
137 0 2 if $Debug
153 0 42 unless @$close_in_child
158 0 42 if $$redirected{$fd}
159 0 42 unless my $fl = xfcntl($fd, 1, 1, $errs)
160 42 0 if $fl & 1
161 0 0 unless xfcntl $fd, 2, $fl | 1, $errs
176 0 34 if ($$cmd[0] eq 'fset') { }
17 17 elsif ($$cmd[0] eq 'close') { }
17 0 elsif ($$cmd[0] eq 'fdopen') { }
177 0 0 unless xfcntl $$cmd[1], 2, $$cmd[2], $errs, 'unwind: '
180 0 17 unless xclose $$cmd[1], $errs, 'unwind: '
183 0 17 unless xfdopen $$cmd[1], $$cmd[2], $$cmd[3], $errs, 'unwind: '
187 0 0 if $Debug
201 0 50 if ($file)
213 0 0 if $Debug
214 0 0 unless $fh = 'IO::File'->new($file)
218 0 0 if $Debug
224 0 0 $file =~ /^\s*(\+\s*)?[>|]/ ? :
239 22 0 if (exists $fd_hash{$fd} and defined fileno $fd_hash{$fd} and fileno $fd_hash{$fd} == $fd and fcntl $fd_hash{$fd}, 1, 1)
243 12 10 if ref $fd_hash{$fd} eq 'GLOB'
244 0 22 if $Debug
252 0 2 if (not defined $fh and $! =~ /bad\s+file\s+number/i)
253 0 0 if $Debug
259 0 0 unless $tmp_fh = xnew_from_fd($old, $mode, $errs, 'intermed fd: ')
260 0 0 if fileno $tmp_fh == $fd
263 0 0 unless ($ok)
265 0 0 if $Debug
268 0 0 unless defined $$fds{$fd}{'tmp_filehandles'}
272 0 0 unless process_close_in_kid(\@tmp, $unwind, $fds, $errs)
283 26 0 if $fd > $max_fd
285 0 25 unless $max_fd > -1
287 0 25 unless cvt_2filehandle($fds, $unwind, $errs)
291 3 22 if $max_fd > $^F
299 2 22 unless $$fd_data{'pre_filehandle'} = fd_2filehandle($fd, $$fd_data{'mode'}, $fds, $unwind, $errs)
304 0 22 unless $$fd_data{'pre_filehandle_save'} = xnew_from_fd($$fd_data{'pre_filehandle'}, $$fd_data{'mode'}, $errs, 'savecopy: ')
310 0 22 unless xfdopen $$fd_data{'pre_filehandle'}, fileno $$fd_data{'filehandle'}, $$fd_data{'mode'}, $errs, 'final: '
319 0 22 unless process_close_in_kid(\@close_in_child, $unwind, $fds, $errs)
326 2 44 unless defined $_[1]
330 6 40 if exists $$data{'env'}
334 2 138 ref $_ ? :
336 0 45 if $has_undef
341 37 8 $print_errs ? :
343 25 20 if (defined $$data{'redir'})
345 2 22 unless ($res)
346 0 2 if defined $max_fd and $max_fd > $^F and $use_longer_control_F
350 0 2 if $print_errs and @$errs
354 0 0 if defined $max_fd and $max_fd > $^F and $use_longer_control_F
358 20 22 if ($do_spawn or $$data{'spawn'}) { }
360 15 0 if defined $res
361 0 15 unless defined $res
364 6 16 if $res
365 6 16 if $res
366 16 6 $res == 0 ? :
369 17 20 if @$unwind
371 0 37 if $print_errs and @$errs
385 1 2 unless defined $_[1]
389 0 3 if $$data{'spawn'}
392 0 6 unless defined $res
398 1 2 unless defined $_[1]
401 0 3 if $$data{'spawn'}
404 2 3 unless defined $res
410 1 2 unless defined $_[1]
413 0 3 if $$data{'spawn'}
416 2 3 if defined $res
422 3 1 unless defined $_[1]
426 3 1 unless defined $$data{'env'}
437 3 21 unless defined $_[1]
441 23 1 unless defined $$data{'redir'}
448 24 0 $print_errs ? :
450 24 0 if (cvt_2filehandle($redir, $unwind, $errs))
452 1 23 if (%{$$data{'redir'};})
455 1 0 unless exists $$data{'redir'}{$rfd}
462 18 0 unless @$unwind
464 0 0 if @$unwind
466 0 0 if $print_errs and @$errs
472 11 9 unless defined $_[1]
480 0 20 if $Debug
481 0 20 unless pipe $rpipe, $wpipe
483 0 20 if $Debug
484 0 20 if $Debug
487 15 5 if ($dir eq 'r') { }
499 0 15 unless $redir->run($data)
504 0 15 unless xclose $toclose, [], 'pipe::run: '
510 4 0 unless defined $_[1]
513 0 3 unless my $pipe = 'Run::pipe'->new('r', $cmd)->run($data)
519 5 0 unless defined $_[1]
522 0 3 unless my $pipe = 'Run::pipe'->new('r', $cmd)->run($data)
534 0 48 unless @_ == 2
540 0 9 unless @_ == 1