Subject: | [PATCH] fix VMS exit handling broken in 2.64 |
2.64 broke the pragma scope necessary for C<use vmsish 'status'> to do
its thing. The attached patch fixes that while preserving the
encapsulation provided by the set_exit method. strap-analyze.t now passes.
Subject: | harness_exit.patch |
--- lib/Test/Harness/Results.pm;-0 Sun Feb 11 16:52:17 2007
+++ lib/Test/Harness/Results.pm Thu Feb 15 09:28:58 2007
@@ -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;
--- lib/Test/Harness/Straps.pm;-0 Sun Feb 11 16:52:17 2007
+++ lib/Test/Harness/Straps.pm Thu Feb 15 08:02:55 2007
@@ -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($?) );