summaryrefslogtreecommitdiff
path: root/t/run
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-04-28 20:26:30 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-04-28 20:26:30 +0000
commitdc459aad73ffc3aaf43c03d9908415c433fd93ba (patch)
tree981bdcf9828bbd255b79fd1181324eb2b45d8a61 /t/run
parent21f5a6076e634a7ee61d6f5aa4e44bf6708db9fb (diff)
downloadperl-dc459aad73ffc3aaf43c03d9908415c433fd93ba.tar.gz
Integrate #16254 from macperl;
Fix most tests on MacOS (not yet ext/ or /lib) p4raw-id: //depot/perl@16257
Diffstat (limited to 't/run')
-rw-r--r--t/run/exit.t5
-rw-r--r--t/run/fresh_perl.t4
-rw-r--r--t/run/switchPx.t2
-rw-r--r--t/run/switcht.t4
-rw-r--r--t/run/switchx.t3
5 files changed, 11 insertions, 7 deletions
diff --git a/t/run/exit.t b/t/run/exit.t
index 5305bd2ae2..53ba4ea76b 100644
--- a/t/run/exit.t
+++ b/t/run/exit.t
@@ -19,12 +19,14 @@ sub run {
}
BEGIN {
- $numtests = ($^O eq 'VMS') ? 7 : 3;
+ # MacOS system() doesn't have good return value
+ $numtests = ($^O eq 'VMS') ? 7 : ($^O eq 'MacOS') ? 0 : 3;
}
require "test.pl";
plan(tests => $numtests);
+if ($^O ne 'MacOS') {
my $exit, $exit_arg;
$exit = run('exit');
@@ -66,3 +68,4 @@ $exit = run("END { \$? = $exit_arg }");
$exit_arg = (44 & 7) if $^O eq 'VMS';
is( $exit >> 8, $exit_arg, 'Changing $? in END block' );
+}
diff --git a/t/run/fresh_perl.t b/t/run/fresh_perl.t
index 8a334a58b1..3cac42fcd8 100644
--- a/t/run/fresh_perl.t
+++ b/t/run/fresh_perl.t
@@ -95,7 +95,7 @@ EXPECT
########
eval {sub bar {print "In bar";}}
########
-system './perl -ne "print if eof" /dev/null'
+system './perl -ne "print if eof" /dev/null' unless $^O eq 'MacOS'
########
chop($file = <DATA>);
########
@@ -282,7 +282,7 @@ print "ok\n" if ("\0" lt "\xFF");
EXPECT
ok
########
-open(H,'run/fresh_perl.t'); # must be in the 't' directory
+open(H,$^O eq 'MacOS' ? ':run:fresh_perl.t' : 'run/fresh_perl.t'); # must be in the 't' directory
stat(H);
print "ok\n" if (-e _ and -f _ and -r _);
EXPECT
diff --git a/t/run/switchPx.t b/t/run/switchPx.t
index af98031a29..72b068fe83 100644
--- a/t/run/switchPx.t
+++ b/t/run/switchPx.t
@@ -8,7 +8,7 @@ BEGIN {
$ENV{PERL5LIB} = '../lib';
use Config;
- if ( ($Config{'cppstdin'} =~ /\bcppstdin\b/) &&
+ if ( $^O eq 'MacOS' || ($Config{'cppstdin'} =~ /\bcppstdin\b/) &&
! -x $Config{'binexp'} . "/cppstdin" ) {
print "1..0 # Skip: \$Config{cppstdin} unavailable\n";
exit; # Cannot test till after install, alas.
diff --git a/t/run/switcht.t b/t/run/switcht.t
index 2ac9ed0d46..869605ff95 100644
--- a/t/run/switcht.t
+++ b/t/run/switcht.t
@@ -16,14 +16,14 @@ my $Tmsg = 'while running with -t switch';
ok( ${^TAINT}, '${^TAINT} defined' );
-my $out = `$Perl -le "print q{Hello}"`;
+my $out = `$Perl -le "print q(Hello)"`;
is( $out, "Hello\n", '`` worked' );
like( $warning, qr/^Insecure .* $Tmsg/, ' taint warn' );
{
no warnings 'taint';
$warning = '';
- my $out = `$Perl -le "print q{Hello}"`;
+ my $out = `$Perl -le "print q(Hello)"`;
is( $out, "Hello\n", '`` worked' );
is( $warning, '', ' no warnings "taint"' );
}
diff --git a/t/run/switchx.t b/t/run/switchx.t
index 4676d1abf4..60a522cf49 100644
--- a/t/run/switchx.t
+++ b/t/run/switchx.t
@@ -6,5 +6,6 @@ BEGIN {
}
require './test.pl';
+use File::Spec::Functions;
-print runperl( switches => ['-x'], progfile => 'run/switchx.aux' );
+print runperl( switches => ['-x'], progfile => catfile(curdir(), 'run', 'switchx.aux') );