diff options
author | Reini Urban <rurban@x-ray.at> | 2014-06-09 16:55:09 +1000 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2014-07-15 21:05:03 +0100 |
commit | 510d16bbd5176fe0b51a4c71c24af84a53535d4f (patch) | |
tree | 4403777a739ed5cf495e4a2a90b853aab311638e /t/op | |
parent | 67c7ec2b8ce1a245a649db768794ba3997700dad (diff) | |
download | perl-510d16bbd5176fe0b51a4c71c24af84a53535d4f.tar.gz |
[perl #121732] fix t/op/filetest.t for windows
Tony: fix for minitest
(cherry picked from commit 683267f66c72ee510f225a18dc9cd0e4c1962532)
Diffstat (limited to 't/op')
-rw-r--r-- | t/op/filetest.t | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/t/op/filetest.t b/t/op/filetest.t index a67b73f3ce..7316442eb8 100644 --- a/t/op/filetest.t +++ b/t/op/filetest.t @@ -11,6 +11,10 @@ BEGIN { plan(tests => 53 + 27*14); +if ($^O =~ /MSWin32|cygwin|msys/ && !is_miniperl) { + require Win32; # for IsAdminUser() +} + # Tests presume we are in t/op directory and that file 'TEST' is found # therein. is(-d 'op', 1, "-d: directory correctly identified"); @@ -31,7 +35,15 @@ chmod 0555, $ro_empty_file or die "chmod 0555, '$ro_empty_file' failed: $!"; SKIP: { my $restore_root; - if ($> == 0) { + skip "Need Win32::IsAdminUser() on $^O", 1 + if $^O =~ /MSWin32|cygwin|msys/ && is_miniperl(); + my $Is_WinAdminUser = ($^O =~ /MSWin32|cygwin|msys/ and Win32::IsAdminUser()) ? 1 : 0; + # TODO: skip("On an ACL filesystem like $^O we cannot rely on -w via uid/gid"); + # We have no filesystem check for ACL in core + if ($Is_WinAdminUser) { + skip("As Windows Administrator we cannot rely on -w via uid/gid"); + } + elsif ($> == 0) { # root can read and write anything, so switch uid (may not be # implemented) eval '$> = 1'; |