diff options
author | Slaven Rezic <slaven@rezic.de> | 2003-10-21 00:39:28 +0200 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2003-11-05 17:01:29 +0000 |
commit | 85dd75020c14313b276ae5a72e6d7227961a556b (patch) | |
tree | 5bdbb7d782dbd17379bc341127b78e9c37084628 | |
parent | 0e7f572723796591770f69440088f011a144e0b0 (diff) | |
download | perl-85dd75020c14313b276ae5a72e6d7227961a556b.tar.gz |
Re: Smoke [5.9.0] 21474 FAIL(F) darwin 6.8 (darwin/1 cpu)
Message-Id: <87oewbiqyn.fsf@vran.herceg.de>
p4raw-id: //depot/perl@21663
-rw-r--r-- | lib/filetest.t | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/lib/filetest.t b/lib/filetest.t index 7ea977295a..98a19bdf5f 100644 --- a/lib/filetest.t +++ b/lib/filetest.t @@ -5,6 +5,7 @@ BEGIN { @INC = '../lib'; } +use Config; use Test::More tests => 15; # these two should be kept in sync with the pragma itself @@ -57,30 +58,38 @@ SKIP: { my $tstfile = "filetest.tst"; skip("No $chflags available", 4) if !-x $chflags; - skip("Test does not work on OpenBSD, BSD/OS, and Darwin", 4) - if $^O =~ /^(?:openbsd|bsdos|darwin)$/; - - SKIP: { - eval { - if (!-e $tstfile) { - open(T, ">$tstfile") or die "Can't create $tstfile: $!"; - close T; - } - system($chflags, "uchg", $tstfile); - die "Can't exec $chflags uchg" if $? != 0; - }; - skip("Errors in test using chflags: $@", 4) if $@; - - { - use filetest 'access'; + my $skip_eff_user_tests = (!$Config{d_setreuid} && !$Config{d_setresuid}) + || + (!$Config{d_setregid} && !$Config{d_setresgid}); + + eval { + if (!-e $tstfile) { + open(T, ">$tstfile") or die "Can't create $tstfile: $!"; + close T; + } + system($chflags, "uchg", $tstfile); + die "Can't exec $chflags uchg" if $? != 0; + }; + skip("Errors in test using chflags: $@", 4) if $@; + + { + use filetest 'access'; + SKIP: { + skip("No tests on effective user id", 1) + if $skip_eff_user_tests; is(-w $tstfile, undef, "$tstfile should not be recognized as writable"); - is(-W $tstfile, undef, "$tstfile should not be recognized as writable"); } - { - no filetest 'access'; + is(-W $tstfile, undef, "$tstfile should not be recognized as writable"); + } + + { + no filetest 'access'; + SKIP: { + skip("No tests on effective user id", 1) + if $skip_eff_user_tests; is(-w $tstfile, 1, "$tstfile should be recognized as writable"); - is(-W $tstfile, 1, "$tstfile should be recognized as writable"); } + is(-W $tstfile, 1, "$tstfile should be recognized as writable"); } # cleanup |