diff options
author | Michael G. Schwern <schwern@pobox.com> | 2001-11-14 08:19:15 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-14 20:22:06 +0000 |
commit | ffbead302b52559968ad72fad1732bf00a8b8fe7 (patch) | |
tree | 4d69c02a91cbfaee4c3de7b193f38f97e7d1d5ca /t/op/die_exit.t | |
parent | ff7adb52759760a267f6a58557fbcf72203c46fb (diff) | |
download | perl-ffbead302b52559968ad72fad1732bf00a8b8fe7.tar.gz |
Fwd: [craigberry@mac.com: die_exit.t]
Message-ID: <20011114131915.K5096@blackrider>
p4raw-id: //depot/perl@12998
Diffstat (limited to 't/op/die_exit.t')
-rwxr-xr-x | t/op/die_exit.t | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/t/op/die_exit.t b/t/op/die_exit.t index 18d8babfdc..fedef945e1 100755 --- a/t/op/die_exit.t +++ b/t/op/die_exit.t @@ -17,8 +17,6 @@ if ($^O eq 'mpeix') { $| = 1; -my $perl = -e '../perl' ? '../perl' : -e './perl' ? './perl' : 'perl'; - use strict; my %tests = ( @@ -46,16 +44,29 @@ my $max = keys %tests; print "1..$max\n"; +# Dump any error messages from the dying processes off to a temp file. +open(STDERR, ">die_exit.err") or die "Can't open temp error file: $!"; + foreach my $test (1 .. $max) { my($bang, $query, $code) = @{$tests{$test}}; $code ||= 'die;'; - my $exit = - (($^O eq 'MSWin32' || $^O eq 'NetWare') - ? system qq($perl -e "\$! = $bang; \$? = $query; $code" 2> nul) - : system qq($perl -e '\$! = $bang; \$? = $query; $code' 2> /dev/null)); + if ($^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS') { + system(qq{$^X -e "\$! = $bang; \$? = $query; $code"}); + } + else { + system(qq{$^X -e '\$! = $bang; \$? = $query; $code'}); + } + my $exit = $?; + + # VMS exit code 44 (SS$_ABORT) is returned if a program dies. We only get + # the severity bits, which boils down to 4. See L<perlvms/$?>. + $bang = 4 if $^O eq 'VMS'; printf "# 0x%04x 0x%04x 0x%04x\n", $exit, $bang, $query; print "not " unless $exit == (($bang || ($query >> 8) || 255) << 8); print "ok $test\n"; } +close STDERR; +END { 1 while unlink 'die_exit.err' } + |