summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-09-26 12:53:16 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-09-26 12:53:16 +0000
commitbe708cc0141c68546a70e3d19f68ad41bef15add (patch)
tree5152acd08116f8ae5a5d576f678fde267a91bcb7 /t
parentd1f145d342e491f3bdc2d057c6771a7a5baba14a (diff)
downloadperl-be708cc0141c68546a70e3d19f68ad41bef15add.tar.gz
Integrate macperl changes from Chris Nandor:
12192 11817 11815 11813 11778 11775 Update CPAN.pm to work with new Mac::BuildTools instead of ExtUtils::MM_MacOS "orphan" functions Fix test Make syntax check report in MPW style, fix tests to use Mac::err=unix to get normal-style error messages. More module and test ports from Thomas Wegner et al Fix open of /dev/null for Mac OS Allow for platforms to override formatting of errors on output from Matthias Neeracher (core files) p4raw-id: //depot/perl@12235 p4raw-edited: from //depot/maint-5.6/macperl@12234 'edit in' lib/File/DosGlob.pm t/op/magic.t (@11007..) p4raw-integrated: from //depot/maint-5.6/macperl@12234 'copy in' lib/File/Spec/Mac.pm lib/File/Temp.pm (@11007..) 'merge in' ext/File/Glob/Glob.pm lib/CPAN.pm (@11007..) ext/File/Glob/bsd_glob.c t/base/term.t (@11185..) t/op/runlevel.t (@11198..) t/pod/testp2pt.pl (@11500..) p4raw-integrated: from //depot/maint-5.6/macperl@11815 'merge in' perl.c (@11806..) p4raw-integrated: from //depot/maint-5.6/macperl@11775 'merge in' perl.h pp_ctl.c util.c (@11007..)
Diffstat (limited to 't')
-rwxr-xr-xt/op/magic.t36
-rwxr-xr-xt/op/runlevel.t14
-rw-r--r--t/pod/testp2pt.pl2
-rw-r--r--t/run/kill_perl.t3
4 files changed, 38 insertions, 17 deletions
diff --git a/t/op/magic.t b/t/op/magic.t
index ae1b1d9b8a..bbccd8e9e3 100755
--- a/t/op/magic.t
+++ b/t/op/magic.t
@@ -37,21 +37,26 @@ sub skip {
print "1..41\n";
-
$Is_MSWin32 = $^O eq 'MSWin32';
$Is_NetWare = $^O eq 'NetWare';
$Is_VMS = $^O eq 'VMS';
-$Is_Dos = $^O eq 'dos';
-$Is_os2 = $^O eq 'os2';
-$Is_Cygwin = $^O eq 'cygwin';
+$Is_Dos = $^O eq 'dos';
+$Is_os2 = $^O eq 'os2';
+$Is_Cygwin = $^O eq 'cygwin';
+$Is_MacOS = $^O eq 'MacOS';
$Is_MPE = $^O eq 'mpeix';
-$PERL = ($Is_MSWin32 ? '.\perl' : ($Is_NetWare ? 'perl' : './perl'));
+
+$PERL = ($Is_NetWare ? 'perl' :
+ $Is_MacOS ? $^X :
+ $Is_MSWin32 ? '.\perl' :
+ './perl');
eval '$ENV{"FOO"} = "hi there";'; # check that ENV is inited inside eval
# cmd.exe will echo 'variable=value' but 4nt will echo just the value
# -- Nikola Knezevic
-if ($Is_MSWin32) { ok `set FOO` =~ /^(FOO=)?hi there$/; }
-else { ok `echo \$FOO` eq "hi there\n"; }
+if ($Is_MSWin32) { ok `set FOO` =~ /^(FOO=)?hi there$/; }
+elsif ($Is_MacOS) { ok "1 # skipped", 1; }
+else { ok `echo \$FOO` eq "hi there\n"; }
unlink 'ajslkdfpqjsjfk';
$! = 0;
@@ -59,7 +64,7 @@ open(FOO,'ajslkdfpqjsjfk');
ok $!, $!;
close FOO; # just mention it, squelch used-only-once
-if ($Is_MSWin32 || $Is_NetWare || $Is_Dos || $Is_MPE) {
+if ($Is_MSWin32 || $Is_NetWare || $Is_Dos || $Is_MPE || $Is_MacOS) {
skip() for 1..2;
}
else {
@@ -142,10 +147,13 @@ ok $$ > 0, $$;
elsif($Is_os2) {
$wd = Cwd::sys_cwd();
}
+ elsif($Is_MacOS) {
+ $wd = ':';
+ }
else {
$wd = '.';
}
- my $perl = "$wd/perl";
+ my $perl = $Is_MacOS ? $^X : "$wd/perl";
my $headmaybe = '';
my $tailmaybe = '';
$script = "$wd/show-shebang";
@@ -170,6 +178,12 @@ EOT
elsif ($Is_os2) {
$script = "./show-shebang";
}
+ elsif ($Is_MacOS) {
+ $script = ":show-shebang";
+ }
+ elsif ($Is_MacOS) {
+ $script = ":show-shebang";
+ }
if ($^O eq 'os390' or $^O eq 'posix-bc' or $^O eq 'vmesa') { # no shebang
$headmaybe = <<EOH ;
eval 'exec ./perl -S \$0 \${1+"\$\@"}'
@@ -185,7 +199,7 @@ print "\$^X is $^X, \$0 is $0\n";
EOF
ok close(SCRIPT), $!;
ok chmod(0755, $script), $!;
- $_ = `$script`;
+ $_ = $Is_MacOS ? `$perl $script` : `$script`;
s/\.exe//i if $Is_Dos or $Is_Cygwin or $Is_os2;
s{\bminiperl\b}{perl}; # so that test doesn't fail with miniperl
s{is perl}{is $perl}; # for systems where $^X is only a basename
@@ -203,7 +217,7 @@ ok $] >= 5.00319, $];
ok $^O;
ok $^T > 850000000, $^T;
-if ($Is_VMS || $Is_Dos) {
+if ($Is_VMS || $Is_Dos || $Is_MacOS) {
skip() for 1..2;
}
else {
diff --git a/t/op/runlevel.t b/t/op/runlevel.t
index 136480129b..60c19a5e4c 100755
--- a/t/op/runlevel.t
+++ b/t/op/runlevel.t
@@ -33,12 +33,14 @@ 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` :
- $Is_NetWare ?
- `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_NetWare ?
+ `perl -I../lib $switch $tmpfile 2>&1` :
+ $Is_MacOS ?
+ `$^X -I::lib -MMac::err=unix $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/pod/testp2pt.pl b/t/pod/testp2pt.pl
index 735350ff40..4d99f82a72 100644
--- a/t/pod/testp2pt.pl
+++ b/t/pod/testp2pt.pl
@@ -47,8 +47,10 @@ if ($^O eq 'VMS') { # clean up directory spec
$INSTDIR =~ s#/$##;
$INSTDIR =~ s#/000000/#/#;
}
+# cut 't/pod' from path (cut 't:pod:' on Mac OS)
$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'pod');
$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 't');
+
my @PODINCDIRS = ( catfile($INSTDIR, 'lib', 'Pod'),
catfile($INSTDIR, 'scripts'),
catfile($INSTDIR, 'pod'),
diff --git a/t/run/kill_perl.t b/t/run/kill_perl.t
index 9dcd59dc01..1d09d4efca 100644
--- a/t/run/kill_perl.t
+++ b/t/run/kill_perl.t
@@ -75,6 +75,9 @@ foreach my $prog (@prgs) {
elsif ($^O eq 'NetWare') {
$results = `perl -I../lib $switch $tmpfile 2>&1`;
}
+ elsif ($^O eq 'MacOS') {
+ $results = `$^X -I::lib -MMac::err=unix $switch $tmpfile`;
+ }
else {
$results = `./perl -I../lib $switch $tmpfile 2>&1`;
}