Branch Coverage

lib/IPC/Open3/Utils.pm
Criterion Covered Total %
branch 105 144 72.9


line true false branch
36 47 0 ref $cmd[-1] eq 'HASH' ? :
39 14 33 if (ref $$arg_hr{'handler'} ne 'CODE')
42 0 0 if ($is_stderr) { }
58 1 46 if (ref $$arg_hr{'autoflush'} eq 'HASH')
59 1 0 if $$arg_hr{'autoflush'}{'stdout'}
60 1 0 if $$arg_hr{'autoflush'}{'stderr'}
61 0 1 if $$arg_hr{'autoflush'}{'stdin'}
65 0 47 exists $SIG{'PIPE'} && defined $SIG{'PIPE'} ? :
67 7 40 if (exists $$arg_hr{'pre_read_print_to_stdin'})
72 2 0 if defined $stdin and ref $stdin eq 'IO::Handle'
78 0 2 if $current_sig_pipe and ref $current_sig_pipe eq 'CODE'
88 11 36 if ($@)
89 2 9 if ($@ =~ /not enough arguments/) { }
9 0 elsif ($@ =~ /open3: exec of .* failed at/) { }
97 4 7 if (ref $$arg_hr{'open3_error'} eq 'SCALAR') { }
104 0 11 if ($$arg_hr{'carp_open3_errors'})
112 13 23 exists $$arg_hr{'timeout'} ? :
122 12 24 if ($$arg_hr{'timeout'}) { }
123 4 8 if ($$arg_hr{'timeout_is_microseconds'}) { }
124 0 4 if (defined &Time::HiRes::ualarm) { }
128 0 4 defined &Time::HiRes::alarm ? :
130 2 2 if $$arg_hr{'timeout'} < 1
135 0 8 defined &Time::HiRes::alarm ? :
142 12 0 if (exists $$arg_hr{'_timeout_info'} and ref $$arg_hr{'_timeout_info'} eq 'HASH')
143 0 12 defined &Time::HiRes::ualarm ? :
0 12 defined &Time::HiRes::alarm ? :
165 6 30 if (exists $$arg_hr{'_pre_run_sleep'})
166 6 0 if (my $sec = int $$arg_hr{'_pre_run_sleep'})
174 7 29 if (exists $$arg_hr{'pre_read_print_to_stdin'})
175 2 5 if (my $type = ref $$arg_hr{'pre_read_print_to_stdin'}) { }
176 1 1 if ($type eq 'ARRAY') { }
1 0 elsif ($type eq 'CODE') { }
192 3 33 if ($$arg_hr{'close_stdin'})
204 0 36 if (my $byte_size = int($$arg_hr{'read_length_bytes'} || 0))
206 0 0 if $byte_size < 128
216 50 39 if ($fh->eof)
222 18 21 $fh eq $stderr ? :
226 18 25 $is_stderr ? :
2 41 if $$arg_hr{'ignore_handle'} eq ($is_stderr ? 'stderr' : 'stdout')
228 0 41 if $is_stderr and $cur_line =~ /^open3:/
229 0 41 if ($is_open3_err)
230 0 0 if (ref $$arg_hr{'open3_error'} eq 'SCALAR') { }
237 0 0 if ($$arg_hr{'carp_open3_errors'})
242 0 0 if ($cur_line =~ /open3: exec of .* failed at/)
249 1 39 unless $return_bool
250 0 39 if $is_open3_err and $$arg_hr{'stop_read_on_open3_err'}
251 1 38 if $short_circuit_loop
258 0 28 if $odd_errno == 0 and $! == 9
262 1 27 if $stdout->opened
263 2 26 if $stderr->opened
264 24 1 if defined $stdin and ref $stdin eq 'IO::Handle' and $stdin->opened
273 12 24 if ($$arg_hr{'timeout'} and defined $original_alarm)
277 8 28 if ($@)
286 0 0 if ($is_open3_err and $open3_err_is_exec and $? != -1)
290 4 24 if $is_open3_err or not $return_bool or not child_error_ok($?)
297 13 5 ref $cmd[-1] eq 'HASH' ? :
304 18 0 !defined($cmd[-1]) || ref $cmd[-1] ? :
305 8 10 !defined($cmd[-1]) || ref $cmd[-1] ? :
310 12 17 $is_stderr ? :
311 2 27 unless defined $mod
313 19 8 if (ref $mod eq 'SCALAR') { }
331 30 3 @_ ? :
332 26 7 if $sysrc == 0
337 22 2 @_ ? :
342 2 2 @_ ? :
343 0 4 if child_error_failed_to_execute($sysrc)
348 2 2 @_ ? :
349 0 4 if child_error_failed_to_execute($sysrc)
354 6 2 @_ ? :
355 0 8 if child_error_failed_to_execute($sysrc)
360 2 2 @_ ? :
361 0 4 if child_error_failed_to_execute($sysrc)