diff options
author | Chris Nandor <pudge@pobox.com> | 2001-06-10 19:35:38 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-11 12:28:49 +0000 |
commit | 95e8664e86da93255f26600f44bbbd70bf5b5b0e (patch) | |
tree | 3a8919ee302246155cc722829af60949ccdfcd40 /t/op | |
parent | 6c254d95443e15da5c7456d8ce7c28f915ae00bb (diff) | |
download | perl-95e8664e86da93255f26600f44bbbd70bf5b5b0e.tar.gz |
[MacPerl-Porters] [PATCH] Mac OS Compatability for bleadperl
Message-Id: <p05100306b749ec0eaade@[10.0.1.177]>
p4raw-id: //depot/perl@10512
Diffstat (limited to 't/op')
-rwxr-xr-x | t/op/anonsub.t | 11 | ||||
-rwxr-xr-x | t/op/closure.t | 1 | ||||
-rwxr-xr-x | t/op/defins.t | 9 | ||||
-rwxr-xr-x | t/op/exec.t | 6 | ||||
-rwxr-xr-x | t/op/goto.t | 2 | ||||
-rwxr-xr-x | t/op/pack.t | 2 | ||||
-rwxr-xr-x | t/op/regexp.t | 2 | ||||
-rwxr-xr-x | t/op/regexp_noamp.t | 6 | ||||
-rwxr-xr-x | t/op/split.t | 1 | ||||
-rwxr-xr-x | t/op/write.t | 3 |
10 files changed, 28 insertions, 15 deletions
diff --git a/t/op/anonsub.t b/t/op/anonsub.t index 17889d9d2f..aa25de0131 100755 --- a/t/op/anonsub.t +++ b/t/op/anonsub.t @@ -4,6 +4,7 @@ chdir 't' if -d 't'; @INC = '../lib'; $Is_VMS = $^O eq 'VMS'; $Is_MSWin32 = $^O eq 'MSWin32'; +$Is_MacOS = $^O eq 'MacOS'; $ENV{PERL5LIB} = "../lib" unless $Is_VMS; $|=1; @@ -26,10 +27,12 @@ for (@prgs){ print TEST "$prog\n"; close TEST; my $results = $Is_VMS ? - `MCR $^X "-I[-.lib]" $switch $tmpfile 2>&1` : - $Is_MSWin32 ? - `.\\perl -I../lib $switch $tmpfile 2>&1` : - `./perl $switch $tmpfile 2>&1`; + `MCR $^X "-I[-.lib]" $switch $tmpfile 2>&1` : + $Is_MSWin32 ? + `.\\perl -I../lib $switch $tmpfile 2>&1` : + $Is_MacOS ? + `$^X -I::lib $switch $tmpfile` : + `./perl $switch $tmpfile 2>&1`; my $status = $?; $results =~ s/\n+$//; # allow expected output to be written as if $prog is on STDIN diff --git a/t/op/closure.t b/t/op/closure.t index 5f3245fbc9..633428607e 100755 --- a/t/op/closure.t +++ b/t/op/closure.t @@ -465,6 +465,7 @@ END open CMD, ">$cmdfile"; print CMD $code; close CMD; my $cmd = (($^O eq 'VMS') ? "MCR $^X" : ($^O eq 'MSWin32') ? '.\perl' + : ($^O eq 'MacOS') ? $^X : './perl'); $cmd .= " -w $cmdfile 2>$errfile"; if ($^O eq 'VMS' or $^O eq 'MSWin32') { diff --git a/t/op/defins.t b/t/op/defins.t index 33c74ea28e..06d48b601b 100755 --- a/t/op/defins.t +++ b/t/op/defins.t @@ -12,16 +12,17 @@ BEGIN { } $wanted_filename = $^O eq 'VMS' ? '0.' : '0'; +$saved_filename = $^O eq 'MacOS' ? ':0' : './0'; print "not " if $warns; print "ok 1\n"; -open(FILE,">./0"); +open(FILE,">$saved_filename"); print FILE "1\n"; print FILE "0"; close(FILE); -open(FILE,"<./0"); +open(FILE,"<$saved_filename"); my $seen = 0; my $dummy; while (my $name = <FILE>) @@ -63,7 +64,7 @@ print "not " unless $seen; print "ok 5\n"; close FILE; -opendir(DIR,'.'); +opendir(DIR,($^O eq 'MacOS' ? ':' : '.')); $seen = 0; while (my $name = readdir(DIR)) { @@ -116,7 +117,7 @@ while ($where{$seen} = glob('*')) print "not " unless $seen; print "ok 11\n"; -unlink("./0"); +unlink($saved_filename); my %hash = (0 => 1, 1 => 2); diff --git a/t/op/exec.t b/t/op/exec.t index 23e9ec1cec..57a114e766 100755 --- a/t/op/exec.t +++ b/t/op/exec.t @@ -11,6 +11,12 @@ if ($^O eq 'MSWin32') { exit(0); } +if ($^O eq 'MacOS') { + # XXX the system tests could be written to use ./perl and so work on Win32 + print "1..0 # Mostly useless tests for Mac OS\n"; + exit(0); +} + print "1..8\n"; if ($^O ne 'os2') { diff --git a/t/op/goto.t b/t/op/goto.t index b2e5b2ca98..579e8180e4 100755 --- a/t/op/goto.t +++ b/t/op/goto.t @@ -29,7 +29,7 @@ label4: print "#2\t:$foo: == 4\n"; if ($foo == 4) {print "ok 2\n";} else {print "not ok 2\n";} -$PERL = ($^O eq 'MSWin32') ? '.\perl' : './perl'; +$PERL = ($^O eq 'MSWin32') ? '.\perl' : ($^O eq 'MacOS') ? $^X : './perl'; $CMD = qq[$PERL -e "goto foo;" 2>&1 ]; $x = `$CMD`; diff --git a/t/op/pack.t b/t/op/pack.t index 5323bc34b8..f9b35ae35a 100755 --- a/t/op/pack.t +++ b/t/op/pack.t @@ -43,7 +43,7 @@ $sum = 103 if ($Config{ebcdic} eq 'define'); print +($x = unpack("%32B*", "Now is the time for all good blurfl")) == $sum ? "ok 7\n" : "not ok 7 $x\n"; -open(BIN, "./perl") || open(BIN, "./perl.exe") +open(BIN, "./perl") || open(BIN, "./perl.exe") || open(BIN, $^X) || die "Can't open ../perl or ../perl.exe: $!\n"; sysread BIN, $foo, 8192; close BIN; diff --git a/t/op/regexp.t b/t/op/regexp.t index 0751559964..6d33580b30 100755 --- a/t/op/regexp.t +++ b/t/op/regexp.t @@ -38,7 +38,7 @@ BEGIN { $iters = shift || 1; # Poor man performance suite, 10000 is OK. -open(TESTS,'op/re_tests') || open(TESTS,'t/op/re_tests') || +open(TESTS,'op/re_tests') || open(TESTS,'t/op/re_tests') || open(TESTS,':op:re_tests') || die "Can't open re_tests"; while (<TESTS>) { } diff --git a/t/op/regexp_noamp.t b/t/op/regexp_noamp.t index 088bd40264..8a6dd28206 100755 --- a/t/op/regexp_noamp.t +++ b/t/op/regexp_noamp.t @@ -1,10 +1,10 @@ #!./perl $skip_amp = 1; -for $file ('op/regexp.t', 't/op/regexp.t') { +for $file ('./op/regexp.t', './t/op/regexp.t', ':op:regexp.t') { if (-r $file) { - do "./$file"; + do $file; exit; } } -die "Cannot find op/regexp.t or t/op/regexp.t\n"; +die "Cannot find ./op/regexp.t or ./t/op/regexp.t\n"; diff --git a/t/op/split.t b/t/op/split.t index 3077909c92..4e3e546c18 100755 --- a/t/op/split.t +++ b/t/op/split.t @@ -52,6 +52,7 @@ print $_ eq '1:2:3:4:5:6:::' ? "ok 10\n" : "not ok 10 $_\n"; # Does assignment to a list imply split to one more field than that? if ($^O eq 'MSWin32') { $foo = `.\\perl -D1024 -e "(\$a,\$b) = split;" 2>&1` } elsif ($^O eq 'VMS') { $foo = `./perl "-D1024" -e "(\$a,\$b) = split;" 2>&1` } +elsif ($^O eq 'MacOS'){ $foo = `$^X "-D1024" -e "(\$a,\$b) = split;"` } else { $foo = `./perl -D1024 -e '(\$a,\$b) = split;' 2>&1` } print $foo =~ /DEBUGGING/ || $foo =~ /SV = (VOID|IV\(3\))/ ? "ok 11\n" : "not ok 11\n"; diff --git a/t/op/write.t b/t/op/write.t index e5baaa470c..8e4cca8fdc 100755 --- a/t/op/write.t +++ b/t/op/write.t @@ -7,7 +7,8 @@ BEGIN { print "1..44\n"; -my $CAT = ($^O eq 'MSWin32') ? 'type' : 'cat'; +my $CAT = ($^O eq 'MSWin32') ? 'type' + : ($^O eq 'MacOS') ? 'catenate' : 'cat'; format OUT = the quick brown @<< |