Branch Coverage

blib/lib/Container/Buildah/Subcommand.pm
Criterion Covered Total %
branch 94 242 38.8


line true false branch
34 5 24 if (exists $defs->{'extract'})
35 1 4 if (ref $defs->{'extract'} ne 'ARRAY')
39 5 3 if (exists $params->{$argname})
54 2 26 if (exists $defs->{'arg_init'})
55 0 2 if (not ref $defs->{'arg_init'}) { }
1 1 elsif (ref $defs->{'arg_init'} eq 'ARRAY') { }
72 3 24 if (exists $defs->{'exclusive'})
73 1 2 if (ref $defs->{'exclusive'} ne 'ARRAY')
77 2 0 if (exists $params->{$argname})
79 1 1 if (scalar keys %$params > 1)
97 2 23 if (exists $defs->{'arg_flag'})
98 1 1 if (ref $defs->{'arg_flag'} ne 'ARRAY')
102 1 0 if (exists $params->{$argname})
103 0 1 if (ref $params->{$argname})
120 4 20 if (exists $defs->{'arg_flag_str'})
121 1 3 if (ref $defs->{'arg_flag_str'} ne 'ARRAY')
125 3 0 if (exists $params->{$argname})
126 0 3 if (ref $params->{$argname})
129 1 2 if ($params->{$argname} ne 'true' and $params->{$argname} ne 'false')
146 4 18 if (exists $defs->{'arg_str'})
147 1 3 if (ref $defs->{'arg_str'} ne 'ARRAY')
151 4 1 if (exists $params->{$argname})
152 1 3 if (ref $params->{$argname})
169 4 16 if (exists $defs->{'arg_array'})
170 1 3 if (ref $defs->{'arg_array'} ne 'ARRAY')
174 3 0 if (exists $params->{$argname})
175 1 2 if (not ref $params->{$argname}) { }
1 1 elsif (ref $params->{$argname} eq 'ARRAY') { }
199 4 14 if (exists $defs->{'arg_list'})
200 1 3 if (ref $defs->{'arg_list'} ne 'ARRAY')
204 3 0 if (exists $params->{$argname})
205 1 2 if (not ref $params->{$argname}) { }
1 1 elsif (ref $params->{$argname} eq 'ARRAY') { }
267 1 15 if (%$params)
297 2 16 unless (exists $cb->{'prog'})
303 1 17 unless (defined $progname)
308 5 12 if (exists $prog->{$progname})
314 1 11 if (exists $ENV{$envprog} and -x $ENV{$envprog})
322 10 34 if (-x "$path/$progname")
330 1 10 unless (defined $found)
345 10 0 ref $class_or_obj ? :
346 10 0 exists $opts->{'name'} ? :
358 2 7 if ($opts->{'capture_output'} // 0) { }
0 7 elsif ($opts->{'suppress_output'} // 0) { }
363 0 9 if ($opts->{'suppress_error'} // 0)
369 0 8 if ($? == -1)
372 0 8 if ($? & 127)
373 0 0 $? & 128 ? :
377 8 0 if (exists $opts->{'save_retcode'} and ref $opts->{'save_retcode'} eq 'SCALAR')
380 4 4 if ($retcode != 0) { }
1 6 elsif (exists $opts->{'zero'} and ref $opts->{'zero'} eq 'CODE') { }
383 2 2 if (exists $opts->{'nonzero'} and ref $opts->{'nonzero'} eq 'CODE') { }
393 4 6 unless (eval { do { Container::Buildah::disallow_undef(\@in_args); $cb->debug({'level', 4}, "cmd $name " . join(' ', @in_args)); my $outdest = \*STDOUT; my $errdest = \*STDERR; if ($opts->{'capture_output'} // 0) { $outdest = \$outstr; } elsif ($opts->{'suppress_output'} // 0) { $outdest = '/dev/null'; } ; if ($opts->{'suppress_error'} // 0) { $errdest = '/dev/null'; } ; IPC::Run::run(\@in_args, '<', \(undef), '>', $outdest, '2>', $errdest); if ($? == -1) { confess('failed to execute command (' . join(' ', @in_args) . "): $!"); } ; if ($? & 127) { confess(sprintf('command (' . join(' ', @in_args) . " child died with signal %d, %s coredump\n", $? & 127, $? & 128 ? 'with' : 'without')); } ; my $retcode = $? >> 8; if (exists $opts->{'save_retcode'} and ref $opts->{'save_retcode'} eq 'SCALAR') { ${$$opts{'save_retcode'};} = $retcode; } ; if ($retcode != 0) { if (exists $opts->{'nonzero'} and ref $opts->{'nonzero'} eq 'CODE') { &{$opts->{'nonzero'};}($retcode); } else { confess("non-zero status ($retcode) from cmd " . join(' ', @in_args)); } ; } elsif (exists $opts->{'zero'} and ref $opts->{'zero'} eq 'CODE') { &{$opts->{'zero'};}(); } ; 1 } })
394 4 0 if ($@)
408 1 0 ref $class_or_obj ? :
413 0 1 if (defined $test_result)
425 1 0 if ($sysname eq 'Linux')
426 1 0 if ($kmajor >= 3) { }
0 0 elsif ($kmajor == 2 and $kminor >= 8) { }
445 0 0 ref $class_or_obj ? :
448 0 0 unless $cb->container_compat_check
452 0 0 if (ref $in_args[0] eq 'HASH')
473 0 0 ref $class_or_obj ? :
475 0 0 if (ref $in_args[0] eq 'HASH')
505 0 0 ref $class_or_obj ? :
507 0 0 if (ref $in_args[0] eq 'HASH')
528 0 0 ref $class_or_obj ? :
530 0 0 if (ref $in_args[0] eq 'HASH')
549 0 0 unless (defined $image)
564 0 0 ref $class_or_obj ? :
566 0 0 if (ref $in_args[0] eq 'HASH')
588 0 0 ref $class_or_obj ? :
590 0 0 if (ref $in_args[0] eq 'HASH')
614 0 0 ref $class_or_obj ? :
616 0 0 if (ref $in_args[0] eq 'HASH')
622 0 0 unless (defined $object_id)
642 0 0 ref $class_or_obj ? :
644 0 0 if (ref $in_args[0] eq 'HASH')
650 0 0 unless (defined $list_or_index)
654 0 0 unless (defined $image)
675 0 0 ref $class_or_obj ? :
677 0 0 if (ref $in_args[0] eq 'HASH')
683 0 0 unless (defined $list_or_index)
687 0 0 unless (defined $digest)
708 0 0 ref $class_or_obj ? :
710 0 0 if (ref $in_args[0] eq 'HASH')
716 0 0 unless (defined $list_or_index)
739 0 0 ref $class_or_obj ? :
741 0 0 if (ref $in_args[0] eq 'HASH')
747 0 0 unless (defined $list_or_index)
765 0 0 ref $class_or_obj ? :
767 0 0 if (ref $in_args[0] eq 'HASH')
773 0 0 unless (defined $list_or_index)
796 0 0 ref $class_or_obj ? :
798 0 0 if (ref $in_args[0] eq 'HASH')
804 0 0 unless (defined $list_or_index)
808 0 0 unless (defined $image_manifest_digest)
827 0 0 ref $class_or_obj ? :
829 0 0 if (ref $in_args[0] eq 'HASH')
851 0 0 ref $class_or_obj ? :
853 0 0 if (ref $in_args[0] eq 'HASH')
859 0 0 unless (defined $image)
882 0 0 ref $class_or_obj ? :
884 0 0 if (ref $in_args[0] eq 'HASH')
909 0 0 ref $class_or_obj ? :
911 0 0 if (ref $in_args[0] eq 'HASH')
932 0 0 ref $class_or_obj ? :
934 0 0 if (ref $in_args[0] eq 'HASH')
943 0 0 unless my $image = $extract->{'image'}
958 0 0 ref $class_or_obj ? :
960 0 0 if (ref $in_args[0] eq 'HASH')
985 0 0 ref $class_or_obj ? :
987 0 0 if (ref $in_args[0] eq 'HASH')
1010 0 0 ref $class_or_obj ? :
1012 0 0 if (ref $in_args[0] eq 'HASH')
1035 0 0 ref $class_or_obj ? :
1037 0 0 if (ref $in_args[0] eq 'HASH')
1049 0 0 if (exists $extract->{'container'})
1050 0 0 if (exists $extract->{'envname'}) { }
1071 0 0 ref $class_or_obj ? :
1073 0 0 if (ref $in_args[0] eq 'HASH')