Change 17345: Mac OS Test updates

[email protected] (Chris Nandor) Sat, 22 Jun 2002 17:36:22 -0400
Newsgroups perl.perl5.porters,perl.perl5.changes.mac
Message-ID <p05111b04b93a9e09b3d1@[10.0.1.177]>
Please integrate changes into perl.

--Chris

Change 17345 by pudge@pudge-mobile on 2002/06/22 17:30:12

	Mac OS Test updates

Affected files ...

.... //depot/macperl/ext/POSIX/t/taint.t#2 edit
.... //depot/macperl/lib/Test/Harness/t/strap-analyze.t#13 edit
.... //depot/macperl/lib/Test/Harness/t/test-harness.t#13 edit

Differences ...

==== //depot/macperl/ext/POSIX/t/taint.t#2 (text) ====
Index: macperl/ext/POSIX/t/taint.t
--- macperl/ext/POSIX/t/taint.t#1~17344~	Sat Jun 22 10:13:16 2002
+++ macperl/ext/POSIX/t/taint.t	Sat Jun 22 10:30:12 2002
@@ -28,13 +28,18 @@
 
 my $TAINT = substr($^X, 0, 0);
 
-eval { mkfifo($TAINT. "TEST", 0) };
+# there is a bug in GUSI that causes problems trying to open
+# files and directories ... it is being fixed, this is just
+# a stopgap -- pudge
+my $file = $^O eq 'MacOS' ? 'TEST-OLD' : 'TEST';
+
+eval { mkfifo($TAINT. $file, 0) };
 like($@, qr/^Insecure dependency/,              'mkfifo with tainted data');
 
-eval { $testfd = open($TAINT. "TEST", O_WRONLY, 0) };
+eval { $testfd = open($TAINT. $file, O_WRONLY, 0) };
 like($@, qr/^Insecure dependency/,              'open with tainted data');
 
-eval { $testfd = open("TEST", O_RDONLY, 0) };
+eval { $testfd = open($file, O_RDONLY, 0) };
 is($@, "",                                  'open with untainted data');
 
 read($testfd, $buffer, 2) if $testfd > 2;

==== //depot/macperl/lib/Test/Harness/t/strap-analyze.t#13 (text) ====
Index: macperl/lib/Test/Harness/t/strap-analyze.t
--- macperl/lib/Test/Harness/t/strap-analyze.t#12~17344~	Sat Jun 22 10:13:16 2002
+++ macperl/lib/Test/Harness/t/strap-analyze.t	Sat Jun 22 10:30:12 2002
@@ -20,11 +20,11 @@
                     : File::Spec->catdir($Curdir, 't',   'sample-tests');
 
 
-my $IsMacPerl = $^O eq 'MacOS';
+my $IsMacOS   = $^O eq 'MacOS';
 my $IsVMS     = $^O eq 'VMS';
 
 # VMS uses native, not POSIX, exit codes.
-my $die_exit = $IsVMS ? 44 : 1;
+my $die_exit = $IsVMS ? 44 : $IsMacOS ? 0 : 1;
 
 # We can only predict that the wait status should be zero or not.
 my $wait_non_zero = 1;
@@ -470,7 +470,7 @@
     delete $results{details};
 
     SKIP: {
-        skip '$? unreliable in MacPerl', 2 if $IsMacPerl;
+        skip '$? unreliable in MacPerl', 2 if $IsMacOS;
 
         # We can only check if it's zero or non-zero.
         is( !!$results{'wait'}, !!$expect->{'wait'}, 'wait status' );

==== //depot/macperl/lib/Test/Harness/t/test-harness.t#13 (text) ====
Index: macperl/lib/Test/Harness/t/test-harness.t
--- macperl/lib/Test/Harness/t/test-harness.t#12~17344~	Sat Jun 22 10:13:16 2002
+++ macperl/lib/Test/Harness/t/test-harness.t	Sat Jun 22 10:30:12 2002
@@ -40,11 +40,11 @@
 
 use Test::More;
 
-my $IsMacPerl = $^O eq 'MacOS';
+my $IsMacOS   = $^O eq 'MacOS';
 my $IsVMS     = $^O eq 'VMS';
 
 # VMS uses native, not POSIX, exit codes.
-my $die_estat = $IsVMS ? 44 : 1;
+my $die_estat = $IsVMS ? 44 : $IsMacOS ? 0 : 1;
 
 my %samples = (
             simple            => {
@@ -439,7 +439,7 @@
     select STDOUT;
 
     # $? is unreliable in MacPerl, so we'll simply fudge it.
-    $failed->{estat} = $die_estat if $IsMacPerl and $failed;
+    $failed->{estat} = $die_estat if $IsMacOS and $failed;
 
     SKIP: {
         skip "special tests for bailout", 1 unless $test eq 'bailout';
End of Patch.