From: Jess Robinson Date: Fri, 19 Apr 2013 11:02:19 +0000 (+0100) Subject: Adjust fs test to try more ways of getting the CWD. Expire if we still didn't get it. X-Git-Tag: upstream/5.20.0~614^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b844a53a7d234f06bcf81ebea25299efc781c526;p=platform%2Fupstream%2Fperl.git Adjust fs test to try more ways of getting the CWD. Expire if we still didn't get it. --- diff --git a/t/io/fs.t b/t/io/fs.t index aaa6a7b..bec4dc9 100644 --- a/t/io/fs.t +++ b/t/io/fs.t @@ -16,11 +16,16 @@ if (($^O eq 'MSWin32') || ($^O eq 'NetWare')) { elsif ($^O eq 'VMS') { $wd = `show default`; } +elsif ($ENV{PWD}) { + $wd = $ENV{PWD}; +} else { $wd = `pwd`; } chomp($wd); +die "Can't get current working directory" if(!$wd); + my $has_link = $Config{d_link}; my $accurate_timestamps = !($^O eq 'MSWin32' || $^O eq 'NetWare' || @@ -307,7 +312,7 @@ is(unlink('b'), 1, "unlink b"); is($ino, undef, "ino of unlinked file b should be undef"); unlink 'c'; -chdir $wd || die "Can't cd back to $wd"; +chdir $wd || die "Can't cd back to '$wd' ($!)"; # Yet another way to look for links (perhaps those that cannot be # created by perl?). Hopefully there is an ls utility in your