$| = 1;
chdir 't' if -d 't';
@INC = '../lib';
+ $ENV{PATH} = '/bin' if ${^TAINT};
$SIG{__WARN__} = sub { die "Dying on warning: ", @_ };
require './test.pl';
}
$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';
$Is_miniperl = $ENV{PERL_CORE_MINITEST};
$Is_BeOS = $^O eq 'beos';
$PERL = $ENV{PERL}
|| ($Is_NetWare ? 'perl' :
- ($Is_MacOS || $Is_VMS) ? $^X :
+ $Is_VMS ? $^X :
$Is_MSWin32 ? '.\perl' :
'./perl');
# cmd.exe will echo 'variable=value' but 4nt will echo just the value
# -- Nikola Knezevic
if ($Is_MSWin32) { like `set FOO`, qr/^(?:FOO=)?hi there$/; }
-elsif ($Is_MacOS) { ok "1 # skipped", 1; }
elsif ($Is_VMS) { is `write sys\$output f\$trnlnm("FOO")`, "hi there\n"; }
else { is `echo \$FOO`, "hi there\n"; }
SKIP: {
skip('SIGINT not safe on this platform', 5)
- if $Is_MSWin32 || $Is_NetWare || $Is_Dos || $Is_MPE || $Is_MacOS;
+ if $Is_MSWin32 || $Is_NetWare || $Is_Dos || $Is_MPE;
# the next tests are done in a subprocess because sh spits out a
# newline onto stderr when a child process kills itself with SIGINT.
# We use a pipe rather than system() because the VMS command buffer
}
# $?, $@, $$
-SKIP: {
- skip('$? + system are broken on MacPerl', 2) if $Is_MacOS;
- system qq[$PERL "-I../lib" -e "use vmsish qw(hushed); exit(0)"];
- is $?, 0;
- system qq[$PERL "-I../lib" -e "use vmsish qw(hushed); exit(1)"];
- isnt $?, 0;
-}
+system qq[$PERL "-I../lib" -e "use vmsish qw(hushed); exit(0)"];
+is $?, 0;
+system qq[$PERL "-I../lib" -e "use vmsish qw(hushed); exit(1)"];
+isnt $?, 0;
eval { die "foo\n" };
is $@, "foo\n";
# Cygwin turns the symlink into the real file
chomp($wd = `pwd`);
$wd =~ s#/t$##;
+ $wd =~ /(.*)/; $wd = $1; # untaint
if ($Is_Cygwin) {
$wd = Cygwin::win_to_posix_path(Cygwin::posix_to_win_path($wd, 1));
}
elsif($Is_os2) {
$wd = Cwd::sys_cwd();
}
- elsif($Is_MacOS) {
- $wd = ':';
- }
else {
$wd = '.';
}
- my $perl = ($Is_MacOS || $Is_VMS) ? $^X : "$wd/perl";
+ my $perl = $Is_VMS ? $^X : "$wd/perl";
my $headmaybe = '';
my $middlemaybe = '';
my $tailmaybe = '';
elsif ($Is_os2) {
$script = "./show-shebang";
}
- elsif ($Is_MacOS) {
- $script = ":show-shebang";
- }
elsif ($Is_VMS) {
$script = "[]show-shebang";
}
EOH
}
$s1 = "\$^X is $perl, \$0 is $script\n";
- ok open(SCRIPT, ">$script") or diag $!;
+ ok open(SCRIPT, ">$script") or diag "Can't write to $script: $!";
ok print(SCRIPT $headmaybe . <<EOB . $middlemaybe . <<'EOF' . $tailmaybe) or diag $!;
#!$wd/perl
EOB
EOF
ok close(SCRIPT) or diag $!;
ok chmod(0755, $script) or diag $!;
- $_ = ($Is_MacOS || $Is_VMS) ? `$perl $script` : `$script`;
+ $_ = $Is_VMS ? `$perl $script` : `$script`;
s/\.exe//i if $Is_Dos or $Is_Cygwin or $Is_os2;
s{./$script}{$script} if $Is_BeOS; # revert BeOS execvp() side-effect
s{\bminiperl\b}{perl}; # so that test doesn't fail with miniperl
SKIP: {
skip("%ENV manipulations fail or aren't safe on $^O", 4)
- if $Is_VMS || $Is_Dos || $Is_MacOS;
+ if $Is_VMS || $Is_Dos;
SKIP: {
skip("clearing \%ENV is not safe when running under valgrind")
eval " BEGIN { ok ! defined \$^S } ";
is $^S, 0;
-is ${^TAINT}, 0;
+my $taint = ${^TAINT};
+is ${^TAINT}, $taint;
eval { ${^TAINT} = 1 };
-is ${^TAINT}, 0;
+is ${^TAINT}, $taint;
# 5.6.1 had a bug: @+ and @- were not properly interpolated
# into double-quoted strings
is delete $SIG{HUNGRY}, undef, "HUNGRY remains gone";
# Test deleting signals that we never set
-foreach my $sig (qw(__DIE__ _BOGUS_HOOK PIPE THIRSTY)) {
+foreach my $sig (qw(__DIE__ _BOGUS_HOOK KILL THIRSTY)) {
is $SIG{$sig}, undef, "$sig is not present";
is delete $SIG{$sig}, undef, "delete of $sig returns undef";
}