From: Craig A. Berry Date: Wed, 21 Feb 2007 01:55:37 +0000 (+0000) Subject: Fix VMS exit handling broken in Test::Harness 2.64. Also X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5078fe9db36939fd129d04f339bd821e548f20f2;p=p5sagit%2Fp5-mst-13.2.git Fix VMS exit handling broken in Test::Harness 2.64. Also submitted as http://rt.cpan.org/Public/Bug/Display.html?id=24985 on CPAN RT queue. p4raw-id: //depot/perl@30373 --- diff --git a/lib/Test/Harness/Results.pm b/lib/Test/Harness/Results.pm index f972fdd..f4f4c4e 100644 --- a/lib/Test/Harness/Results.pm +++ b/lib/Test/Harness/Results.pm @@ -118,7 +118,18 @@ sub ok { return $self->{ok} || 0; } -sub set_exit { my $self = shift; $self->{exit} = shift } +sub set_exit { + my $self = shift; + if ($^O eq 'VMS') { + eval { + use vmsish q(status); + $self->{exit} = shift; # must be in same scope as pragma + } + } + else { + $self->{exit} = shift; + } +} sub exit { my $self = shift; return $self->{exit} || 0; diff --git a/lib/Test/Harness/Straps.pm b/lib/Test/Harness/Straps.pm index 5a88e14..bab7266 100644 --- a/lib/Test/Harness/Straps.pm +++ b/lib/Test/Harness/Straps.pm @@ -296,7 +296,7 @@ sub analyze_file { $results->set_wait($?); if ( $? && $self->{_is_vms} ) { - eval q{use vmsish "status"; $results->set_exit($?); }; + $results->set_exit($?); } else { $results->set_exit( _wait2exit($?) );