From: Craig A. Berry Date: Tue, 31 Jul 2001 12:19:29 +0000 (-0500) Subject: Re: new exit tests on VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=55a9fe1dc168272ed2d7a5bbb3227f1cd3d043ab;p=p5sagit%2Fp5-mst-13.2.git Re: new exit tests on VMS Message-Id: <5.1.0.14.0.20010731114845.03743008@mail.telocity.com> p4raw-id: //depot/perl@11532 --- diff --git a/t/run/exit.t b/t/run/exit.t index 20c2c49..7b91cf3 100644 --- a/t/run/exit.t +++ b/t/run/exit.t @@ -18,15 +18,41 @@ sub run { return system($cmd.$quote.$code.$quote); } -use Test::More tests => 3; +## can't use this in 'use Test::More' yet +##my $numtests = ($^O eq 'VMS') ? 7 : 3; -my $exit; +use Test::More tests => 'no_plan'; + +my $exit, $exit_arg; $exit = run('exit'); is( $exit >> 8, 0, 'Normal exit' ); -$exit = run('exit 42'); -is( $exit >> 8, 42, 'Non-zero exit' ); +if ($^O ne 'VMS') { + + $exit = run('exit 42'); + is( $exit >> 8, 42, 'Non-zero exit' ); + +} else { + +# On VMS, successful returns from system() are always 0, warnings are 1, +# errors are 2, and fatal errors are 4. + + $exit = run("exit 196609"); # %CLI-S-NORMAL + is( $exit >> 8, 0, 'success exit' ); + + $exit = run("exit 196611"); # %CLI-I-NORMAL + is( $exit >> 8, 0, 'informational exit' ); + + $exit = run("exit 196608"); # %CLI-W-NORMAL + is( $exit >> 8, 1, 'warning exit' ); + + $exit = run("exit 196610"); # %CLI-E-NORMAL + is( $exit >> 8, 2, 'error exit' ); + + $exit = run("exit 196612"); # %CLI-F-NORMAL + is( $exit >> 8, 4, 'fatal error exit' ); +} $exit = run('END { $? = 42 }'); is( $exit >> 8, 42, 'Changing $? in END block' );