diff options
author | John E. Malmberg <wb8tyw@qsl.net> | 2005-10-15 22:30:43 -0400 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2005-10-16 19:10:56 +0000 |
commit | 7a7fd8e0ed51785cbfb9fc040ff670a40911ca48 (patch) | |
tree | 6fe48b7470561b26997a5af084ce8ed7047a6ce8 /t/run | |
parent | b9b17cada456ce6b994dd57b6f9a29a372123e93 (diff) | |
download | perl-7a7fd8e0ed51785cbfb9fc040ff670a40911ca48.tar.gz |
[patch@25763] Fix VMS error/exit handling, update kill function
From: "John E. Malmberg" <wb8tyw@qsl.net>
Message-id: <4351F393.8030809@qsl.net>
Date: Sun, 16 Oct 2005 02:30:43 -0400
p4raw-id: //depot/perl@25772
Diffstat (limited to 't/run')
-rw-r--r-- | t/run/exit.t | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/t/run/exit.t b/t/run/exit.t index 90eeafc440..8302ae81dd 100644 --- a/t/run/exit.t +++ b/t/run/exit.t @@ -17,7 +17,7 @@ sub run { BEGIN { # MacOS system() doesn't have good return value - $numtests = ($^O eq 'VMS') ? 14 : ($^O eq 'MacOS') ? 0 : 17; + $numtests = ($^O eq 'VMS') ? 16 : ($^O eq 'MacOS') ? 0 : 17; } require "test.pl"; @@ -95,24 +95,30 @@ if ($^O ne 'VMS') { # Double quotes are needed to pass these commands through DCL to PERL $exit = run("exit 268632065"); # %CLI-S-NORMAL - is( $exit, 0, 'PERL success exit' ); + is( $exit >> 8, 0, 'PERL success exit' ); is( ${^CHILD_ERROR_NATIVE} & 7, 1, 'VMS success exit' ); $exit = run("exit 268632067"); # %CLI-I-NORMAL - is( $exit, 0, 'PERL informational exit' ); + is( $exit >> 8, 0, 'PERL informational exit' ); is( ${^CHILD_ERROR_NATIVE} & 7, 3, 'VMS informational exit' ); $exit = run("exit 268632064"); # %CLI-W-NORMAL - is( $exit != 0, 1, 'Perl warning exit' ); + is( $exit >> 8, 1, 'Perl warning exit' ); is( ${^CHILD_ERROR_NATIVE} & 7, 0, 'VMS warning exit' ); $exit = run("exit 268632066"); # %CLI-E-NORMAL - is( $exit != 0, 1, 'Perl error exit' ); + is( $exit >> 8, 2, 'Perl error exit' ); is( ${^CHILD_ERROR_NATIVE} & 7, 2, 'VMS error exit' ); $exit = run("exit 268632068"); # %CLI-F-NORMAL - is( $exit != 0, 1, 'Perl fatal error exit' ); + is( $exit >> 8, 4, 'Perl fatal error exit' ); is( ${^CHILD_ERROR_NATIVE} & 7, 4, 'VMS fatal exit' ); + + $exit = run("exit 02015320012"); # POSIX exit code 1 + is( $exit >> 8, 1, 'Posix exit code 1' ); + + $exit = run("exit 02015323771"); # POSIX exit code 255 + is( $exit >> 8 , 255, 'Posix exit code 255' ); } $exit_arg = 42; @@ -132,7 +138,7 @@ $exit = run("END { \$? = $exit_arg }"); # status codes to SS$_ABORT on exit, but passes through unmodified UNIX # status codes that exit() is called with by scripts. -$exit_arg = 4 if $^O eq 'VMS'; +$exit_arg = (44 & 7) if $^O eq 'VMS'; is( $exit >> 8, $exit_arg, 'Changing $? in END block' ); } |