Branch Coverage

blib/lib/Test/Cmd.pm
Criterion Covered Total %
branch 119 196 60.7


line true false branch
404 0 42 if ($] < 5.003) { }
412 0 42 if ($iswin32) { }
431 0 42 unless ($Test::Cmd::TMPDIR)
433 0 0 unless defined $_ and -d $_ and -w $_
455 0 42 if (defined $ENV{'PRESERVE'}) { }
474 0 42 if $SIG{'HUP'}
520 49 15 if (defined $self->{'workdir'})
521 1 48 unless ($self->workdir($self->{'workdir'}))
526 7 56 if (defined $self->{'subdir'})
527 1 6 unless ($self->subdir($self->{'subdir'}))
564 12 58 if ($prog)
566 12 0 unless ($self->file_name_is_absolute($prog))
586 1 4 unless $self->{'prog'}
601 1 0 if defined $interpreter
616 1 3 if defined $string
630 49 0 unless -e $name
648 54 43 if (defined $workdir)
651 2 52 unless (mkdir $wdir, 493)
679 1 29 unless $self->{'workdir'}
703 8 9 ref $_ ? :
704 15 2 unless ($self->file_name_is_absolute($newdir))
707 15 2 if (mkdir $newdir, 493)
729 5 32 if ref $file
730 28 9 unless ($self->file_name_is_absolute($file))
733 3 34 unless (open OUT, ">$file")
736 0 34 unless (print OUT @_)
760 0 115 if ref $destref ne "SCALAR" and ref $destref ne "ARRAY"
761 4 111 if ref $file
762 8 107 unless ($self->file_name_is_absolute($file))
765 2 113 unless (open IN, "<$file")
769 0 113 unless (close IN)
772 5 108 if (ref $destref eq 'SCALAR') { }
797 1 55 unless defined $flag
799 54 2 if ($flag) { }
801 0 286 if (not chmod(0755, $_))
808 0 8 if (not chmod(0555, $_))
830 3 0 @_ ? :
842 208 70 unless -d $_
843 18 260 if -d $_ and $_ ne "."
869 4 0 $self->{'failed'} == 0 ? :
4 70 unless $cond
870 5 69 if ($self->{'preserve'}{$cond})
871 0 5 if $self->{'verbose'}
950 6 61 if ($args{'chdir'})
952 6 0 unless ($self->file_name_is_absolute($args{"chdir"}))
955 0 6 if $self->{'verbose'}
956 2 4 unless (chdir $args{'chdir'})
964 44 21 if ($args{'prog'}) { }
965 7 37 unless ($self->file_name_is_absolute($args{"prog"}))
969 4 40 if $args{'interpreter'}
972 2 19 if ($args{'interpreter'}) { }
15 4 elsif ($self->{'interpreter'}) { }
978 12 53 if $args{'args'}
981 0 65 if $self->{'verbose'}
982 0 65 unless (open RUN, $cmd)
987 40 25 if ($args{'stdin'})
988 1 39 ref $args{'stdin'} ? :
992 4 61 if $oldcwd
1000 0 0 (ref $v || '') eq 'CODE' ? :
1016 0 0 if @_ == 0
1018 0 0 unless _to_value($cond)
1019 0 0 if $funcref
1040 0 0 if @_ == 0
1042 0 0 unless _to_value($cond)
1043 0 0 if $funcref
1044 0 0 unless defined $caller
1046 0 0 if (ref $self)
1048 0 0 if ($basename)
1050 0 0 if ($self->{'string'})
1085 0 0 if @_ == 0
1087 0 0 unless _to_value($cond)
1088 0 0 if $funcref
1089 0 0 unless defined $caller
1091 0 0 if (ref $self)
1093 0 0 if ($basename)
1095 0 0 if ($self->{'string'})
1142 1 55 @_ ? :
1143 2 54 unless $Run_Count
1145 0 54 unless ($self->read(\@lines, $self->_stdout_file($count)))
1148 0 54 wantarray ? :
1165 1 49 @_ ? :
1166 1 49 unless $Run_Count
1168 0 49 unless ($self->read(\@lines, $self->_stderr_file($count)))
1171 0 49 wantarray ? :
1180 31 40 if (ref $lines) { }
1186 31 40 if (ref $matches) { }
1218 2 50 if @$lines != @$matches
1223 20 56 unless (&{$sub;}($lines->[$i], $matches->[$i]))
1278 0 0 @_ == 1 ? :
1293 0 0 if defined $output
1295 0 0 if @diffs == 0
1296 0 0 if (defined $output)
1302 0 0 if (not @deletions) { }
0 0 elsif (not @additions) { }
1334 19 0 if defined $output
1335 8 11 if _matcher($matches, $lines, $sub)
1336 11 0 if (defined $output)
1462 67 0 if defined $funcref