Branch Coverage

blib/lib/IPC/System/Options.pm
Criterion Covered Total %
branch 93 194 47.9


line true false branch
23 4 0 if ($_[$i] =~ /\A(system|readpipe|backtick|run|start|import)\z/) { }
0 0 elsif ($_[$i] =~ /\A-(.+)/) { }
27 0 0 unless $i < @_ - 1
38 0 2 if (@_ == 1)
41 0 2 if ($^O eq 'MSWin32') { }
44 0 0 ref $_ eq 'SCALAR' ? :
49 1 7 ref $_ eq 'SCALAR' ? :
56 15 2 ref $_[0] eq 'HASH' ? :
58 0 0 unless defined $opts->{$_}
64 1 19 unless /\A( capture_stdout|capture_stderr|capture_merged| tee_stdout|tee_stderr|tee_merged| chdir|dies?|dry_run|env|lang|log|max_log_output|shell| exit_code_success_criteria| fail_log_level| stdin # XXX: only for run() )\z/x
87 0 14 if (defined $opts->{'exit_code_success_criteria'}) { }
88 0 0 if (ref $opts->{'exit_code_success_criteria'} eq '') { }
0 0 elsif (ref $opts->{'exit_code_success_criteria'} eq 'ARRAY') { }
0 0 elsif (ref $opts->{'exit_code_success_criteria'} eq 'Regexp') { }
0 0 elsif (ref $opts->{'exit_code_success_criteria'} eq 'CODE') { }
89 0 0 grep({$exit_code == $_;} @{$$opts{'exit_code_success_criteria'};}) ? :
98 0 16 if ($opts->{'log'})
107 2 14 if ($opts->{'chdir'})
110 0 2 unless (defined $cwd)
111 0 0 if $log
118 1 1 unless (chdir $opts->{'chdir'})
119 0 1 if $log
131 0 15 if ($opts->{'lang'})
136 1 14 if ($opts->{'env'})
139 1 14 if (%set_env)
156 0 13 if ($opts->{'capture_stdout'} and $opts->{'capture_stderr'}) { }
1 12 elsif ($opts->{'capture_merged'}) { }
3 9 elsif ($opts->{'capture_stdout'}) { }
1 8 elsif ($opts->{'capture_stderr'}) { }
0 8 elsif ($opts->{'tee_stdout'} and $opts->{'tee_stderr'}) { }
1 7 elsif ($opts->{'tee_merged'}) { }
1 6 elsif ($opts->{'tee_stdout'}) { }
1 5 elsif ($opts->{'tee_stderr'}) { }
194 10 5 if ($which eq 'system') { }
3 2 elsif ($which eq 'readpipe') { }
2 0 elsif ($which eq 'run' or $which eq 'start') { }
196 0 10 if ($opts->{'log'} or $opts->{'dry_run'})
197 0 0 if ($opts->{'log'}) { }
201 0 0 if ($opts->{'dry_run'}) { }
211 0 0 if ($opts->{'dry_run'})
220 0 10 if ($opts->{'shell'}) { }
0 10 elsif (defined $opts->{'shell'}) { }
231 2 8 $? < 0 ? :
240 0 3 if ($opts->{'log'} or $opts->{'dry_run'})
241 0 0 if ($opts->{'log'}) { }
245 0 0 if ($opts->{'dry_run'}) { }
255 0 0 if ($opts->{'dry_run'})
265 1 2 if (defined $opts->{'shell'} and not $opts->{'shell'})
268 0 1 if $opts->{'capture_merged'} or $opts->{'tee_stdout'} or $opts->{'tee_stderr'} or $opts->{'tee_merged'}
269 1 0 unless ($opts->{'capture_stdout'})
276 1 2 if ($emulate_backtick) { }
284 0 2 if ($wa) { }
290 0 3 $? < 0 ? :
291 0 3 $? < 0 ? :
296 1 2 if ($emulate_backtick)
298 1 0 $capture_stdout_was_false ? :
299 0 1 if $wa
300 1 0 if $capture_stdout_was_false
304 0 3 if ($opts->{'log'})
306 0 0 if (defined $opts->{'max_log_output'})
308 0 0 if ($wa) { }
310 0 0 if (length($res_show) + length($_) >= $opts->{'max_log_output'}) { }
320 0 0 if (length $res > $opts->{'max_log_output'})
328 0 0 defined $res_show ? :
0 0 defined $res_show ? :
0 0 if $exit_code_is_success
334 0 2 if ($opts->{'log'} or $opts->{'dry_run'})
335 0 0 if ($opts->{'log'}) { }
339 0 0 if ($opts->{'dry_run'}) { }
350 0 0 if ($opts->{'dry_run'})
359 1 1 $which eq 'run' ? :
364 2 0 if ($opts->{'capture_stdout'}) { }
365 0 2 if (ref $opts->{'capture_stdout'} eq 'CODE') { }
375 0 0 if ($opts->{'capture_stderr'}) { }
376 0 0 if (ref $opts->{'capture_sderr'} eq 'CODE') { }
385 2 0 defined $opts->{'stdin'} ? :
386 1 1 if ($which eq 'run') { }
388 0 1 $? < 0 ? :
399 1 14 if (%save_env)
401 0 1 if (defined $save_env{$_}) { }
410 1 14 if ($cwd)
411 0 1 unless (chdir $cwd)
412 0 0 if $log
421 3 13 unless ($exit_code_is_success)
422 2 1 if ($opts->{'log'} or $opt_die)
437 1 1 defined $extra_error ? :
1 1 defined $extra_error ? :
0 0 defined ${$$opts{'capture_stdout'};} ? :
0 2 ref $opts->{'capture_stdout'} ? :
0 0 defined ${$$opts{'capture_stderr'};} ? :
0 2 ref $opts->{'capture_stderr'} ? :
0 0 defined ${$$opts{'capture_merged'};} ? :
0 2 ref $opts->{'capture_merged'} ? :
439 0 2 if $opts->{'log'}
440 2 0 if $opt_die
444 13 1 if ($which ne 'start')
448 0 14 $wa && $which ne 'run' && $which ne 'start' ? :