Branch Coverage

inc/File/Temp.pm
Criterion Covered Total %
branch 50 364 13.7


line true false branch
333 0 3 unless scalar @_ >= 1
354 0 3 if (ref $template)
361 0 3 if (scalar(@_) % 2 != 0)
368 3 0 if @_
374 0 0 if ($options{'open'} and $options{'mkdir'})
389 0 3 if (substr($template, $start - 4 + 1, 4) ne "XXXX")
410 3 0 if ($options{'mkdir'}) { }
420 0 3 if ($#dirs == 0) { }
424 0 3 if ($^O eq 'VMS') { }
426 0 0 if $parent eq ""
447 0 0 unless $directories ne ""
457 0 3 unless (-e $parent)
461 0 3 unless (-d $parent)
470 0 3 if ('File::Temp'->safe_level == 1) { }
0 3 elsif ('File::Temp'->safe_level == 2) { }
472 0 0 unless (_is_safe($parent, \$safeerr))
478 0 0 unless (_is_verysafe($parent, \$safeerr))
486 3 0 unless $has_perms
492 0 3 if ($options{'open'}) { }
3 0 elsif ($options{'mkdir'}) { }
496 0 0 if ($] < "5.006")
507 0 0 if ($^O eq 'VMS' and ($options{'unlink_on_close'} and not $KEEP_ALL)) { }
512 0 0 $options{'unlink_on_close'} && !$KEEP_ALL ? :
515 0 0 if defined $LOCKFLAG and $options{'use_exlock'}
518 0 0 if ($open_success) { }
521 0 0 unless $has_perms
530 0 0 unless ($!{'EEXIST'})
541 3 0 if (mkdir $path, 448) { }
550 0 0 unless ($!{'EEXIST'})
564 0 0 unless -e $path
595 0 0 if ($counter > $MAX_GUESS)
621 0 3 unless scalar @_ == 2
630 3 0 $] >= 5.006 ? :
632 0 3 if ($ignore) { }
674 0 0 unless (scalar @info)
679 0 0 if $^O eq "VMS"
684 0 0 if ($info[4] > "File::Temp"->top_system_uid and $info[4] != $>)
689 0 0 if ref $err_ref
699 0 0 if ($info[2] & &Fcntl::S_IWGRP or $info[2] & &Fcntl::S_IWOTH)
702 0 0 unless (-d $path)
703 0 0 if ref $err_ref
708 0 0 unless (-k $path)
709 0 0 if ref $err_ref
734 0 0 if $DEBUG
735 0 0 if $^O eq "VMS"
744 0 0 if eval { do { &POSIX::_PC_CHOWN_RESTRICTED(); 1 } }
747 0 0 if (defined $chown_restricted)
750 0 0 if POSIX::sysconf($chown_restricted)
760 0 0 unless ("File::Spec"->file_name_is_absolute($path))
782 0 0 if $DEBUG
785 0 0 unless _is_safe($dir, $err_ref)
803 0 0 if (grep(($^O eq $_), ('MSWin32', 'os2', 'VMS', 'dos', 'MacOS', 'haiku'))) { }
824 0 0 if $level == 0
827 0 0 if ($^O eq 'MSWin32' or $^O eq 'os2' or $^O eq 'cygwin' or $^O eq 'dos' or $^O eq 'MacOS' or $^O eq 'mpeix') { }
879 0 3 unless defined $at_exit
880 0 3 if @k
882 3 0 if (not $KEEP_ALL)
885 0 3 exists $files_to_unlink{$$} ? :
893 0 0 if (-f $file->[1])
895 0 0 unless unlink $file->[1]
900 3 0 exists $dirs_to_unlink{$$} ? :
903 3 0 if (-d $dir)
909 3 0 if ($at_exit)
910 3 0 unless defined $cwd
912 0 3 if ($abs eq $cwd)
918 0 0 if $@ and $^W
922 0 3 if (defined $cwd_to_remove)
925 0 0 unless chdir $cwd_to_remove
927 0 0 unless chdir $updir
929 0 0 if $@ and $^W
934 0 3 if exists $files_to_unlink{$$}
936 3 0 if exists $dirs_to_unlink{$$}
947 0 3 unless scalar @_ == 3
952 0 3 if $DEBUG
962 3 0 if ($isdir) { }
964 3 0 if (-d $fname) { }
968 0 3 if $^O eq "VMS"
970 3 0 unless exists $dirs_to_unlink{$$}
974 0 0 if $^W
979 0 0 if (-f $fname) { }
983 0 0 unless exists $files_to_unlink{$$}
987 0 0 if $^W
999 0 3 scalar(@_) % 2 == 1 ? :
1007 0 3 $leading_template ? :
0 3 exists $args{'TEMPLATE'} ? :
1076 0 0 exists $args->{'UNLINK'} ? :
1085 0 0 if $DEBUG
1133 0 0 exists $args->{'CLEANUP'} ? :
1205 0 0 if (@_)
1244 0 0 if (exists $FILES_CREATED_BY_OBJECT{$$}{$file})
1249 0 0 if (do { *$self }->{'UNLINK'} and not $KEEP_ALL)
1250 0 0 if $DEBUG
1253 0 0 unless $was_created_by_proc
1262 0 0 unless unlink1($self, $file)
1384 0 0 if (@_ and $_[0] eq "File::Temp")
1403 0 0 @$maybe_template ? :
1409 0 0 unless ($options{'OPEN'})
1411 0 0 if $^W
1416 0 0 if ($options{'DIR'} and $^O eq "VMS")
1430 0 0 if (defined $template) { }
1432 0 0 if ($options{'DIR'}) { }
0 0 elsif ($options{'TMPDIR'}) { }
1444 0 0 if ($options{'DIR'}) { }
1469 0 0 wantarray ? :
1482 0 0 unless ($fh, $path) = _gettemp($template, "open", $options{'OPEN'}, "mkdir", 0, "unlink_on_close", $unlink_on_close, "suffixlen", length $options{'SUFFIX'}, "ErrStr", \$errstr, "use_exlock", $options{'EXLOCK'}, "file_permissions", $options{'PERMS'})
1490 0 0 if $options{'UNLINK'}
1493 0 0 if (wantarray) { }
1495 0 0 if ($options{'OPEN'}) { }
1505 0 0 unless unlink0($fh, $path)
1521 3 0 unless $^O eq "MSWin32" and ${^TAINT}
1523 0 0 if ($checked)
1524 0 0 $alt_tmpdir ? :
1533 0 0 if (mkdir $testpath, 448)
1545 0 0 if (-e $local_app or mkdir $local_app, 448)
1546 0 0 if (mkdir $testpath, 448)
1633 0 3 if (@_ and $_[0] eq "File::Temp")
1649 0 3 @$maybe_template ? :
1657 0 3 if (defined $template) { }
1660 0 0 if ($options{'TMPDIR'} or $options{'DIR'})
1665 0 0 if $^O eq "VMS"
1672 0 0 if ($options{'DIR'}) { }
0 0 elsif ($options{'TMPDIR'}) { }
1687 0 3 if ($options{'DIR'}) { }
1702 0 3 if ($^O eq "VMS")
1706 0 3 if ($^O eq "MacOS" and substr($template, -1) eq ":")
1712 0 3 unless (undef, $tempdir) = _gettemp($template, "open", 0, "mkdir", 1, "suffixlen", $suffixlen, "ErrStr", \$errstr)
1721 3 0 if ($options{'CLEANUP'} and -d $tempdir)
1760 0 0 if scalar @_ != 1
1766 0 0 unless ($fh, $path) = _gettemp($template, "open", 1, "mkdir", 0, "suffixlen", 0, "ErrStr", \$errstr)
1774 0 0 if (wantarray) { }
1802 0 0 if scalar @_ != 2
1811 0 0 unless ($fh, $path) = _gettemp($template, "open", 1, "mkdir", 0, "suffixlen", length $suffix, "ErrStr", \$errstr)
1819 0 0 if (wantarray) { }
1848 0 0 if scalar @_ != 1
1853 0 0 if ($^O eq "VMS")
1857 0 0 if ($^O eq "MacOS" and substr($template, -1) eq ":")
1862 0 0 unless ($junk, $tmpdir) = _gettemp($template, "open", 0, "mkdir", 1, "suffixlen", $suffixlen, "ErrStr", \$errstr)
1891 0 0 if scalar @_ != 1
1897 0 0 unless ($junk, $tmpname) = _gettemp($template, "open", 0, "mkdir", 0, "suffixlen", 0, "ErrStr", \$errstr)
1959 0 0 if $tmpdir eq ""
1965 0 0 if (wantarray) { }
2001 0 0 unless unlink0($fh, $file)
2043 0 0 unless scalar @_ == 2
2119 0 0 unless scalar @_ == 2
2125 0 0 unless cmpstat($fh, $path)
2128 0 0 if (_can_unlink_opened_file())
2131 0 0 if $KEEP_ALL
2135 0 0 if -d $path
2136 0 0 unless unlink $path
2141 0 0 if $DEBUG
2149 0 0 if $fh[3] == 0 or $^O eq "cygwin"
2185 0 0 unless scalar @_ == 2
2191 0 0 if $DEBUG
2202 0 0 unless @fh
2204 0 0 if ($fh[3] > 1 and $^W)
2205 0 0 if $^W
2211 0 0 unless (@path)
2212 0 0 if $^W
2217 0 0 unless (-f $path)
2227 0 0 if ($^O eq 'MSWin32') { }
0 0 elsif ($^O eq 'os2') { }
0 0 elsif ($^O eq 'VMS') { }
0 0 elsif ($^O eq 'dos') { }
0 0 elsif ($^O eq 'mpeix') { }
2241 0 0 if $DEBUG
2245 0 0 unless ($fh[$_] eq $path[$_])
2246 0 0 if $DEBUG
2279 0 0 unless scalar @_ == 2
2285 0 0 unless cmpstat($fh, $path)
2288 0 0 unless close $fh
2294 0 0 if $KEEP_ALL
2407 0 6 if (@_)
2409 0 0 if ($level != 0 and $level != 1 and $level != 2) { }
2410 0 0 if $^W
2413 0 0 if ($] < "5.006" and $level != 0)
2419 0 0 if _can_do_level($level)
2454 0 0 if (@_)
2456 0 0 unless $newuid =~ /^\d+$/s
2616 0 0 if (@_)
2625 0 0 if ($self->unlink_on_destroy and $$ == $self->{'LAUNCHPID'} and not $File::Temp::KEEP_ALL)
2627 0 0 if (-d $self->{'REALNAME'})
2633 0 0 if $@ and $^W