diff options
Diffstat (limited to 't/lib/ftmp-mktemp.t')
-rwxr-xr-x | t/lib/ftmp-mktemp.t | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/t/lib/ftmp-mktemp.t b/t/lib/ftmp-mktemp.t index c660475709..2f41d5d252 100755 --- a/t/lib/ftmp-mktemp.t +++ b/t/lib/ftmp-mktemp.t @@ -1,9 +1,4 @@ -#!./perl - -BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; -} +#!/usr/local/bin/perl -w # Test for mktemp family of commands in File::Temp # Use STANDARD safe level for these tests @@ -50,6 +45,7 @@ ok($string, $line); # stat(filehandle) does not always equal the size of the stat(filename) # This must be due to caching. In particular this test writes 7 bytes # to the file which are not recognised by stat(filename) +# Simply waiting 3 seconds seems to be enough for the system to update if ($^O eq 'MSWin32') { sleep 3; @@ -69,8 +65,15 @@ print "# MKSTEMPS: File is $template -> $fname fileno=".fileno($fh)."\n"; # Check if the file exists ok( (-e $fname) ); -ok( unlink0($fh, $fname) ); +# This fails if you are running on NFS +# If this test fails simply skip it rather than doing a hard failure +my $status = unlink0($fh, $fname); +if ($status) { + ok($status); +} else { + skip("Skip test failed probably due to NFS",1) +} # MKDTEMP # Temp directory |