util/perl/OpenSSL/Test.pm: Disable stdout/stderr redirection on non-verbosity
... except on VMS, where output from executed programs doesn't seem to be
captured properly by Test::Harness or TAP::Harness.
@@ -446,17 +446,22 @@ sub run {
die "OpenSSL::Test::run(): statusvar value not a scalar reference"
if $opts{statusvar} && ref($opts{statusvar}) ne "SCALAR";
+ # For some reason, program output, or even output from this function
+ # somehow isn't caught by TAP::Harness (TAP::Parser?) on VMS, so we're
+ # silencing it specifically there until further notice.
+ my $save_STDOUT;
+ my $save_STDERR;
+ if ($^O eq 'VMS') {
# In non-verbose, we want to shut up the command interpreter, in case
# it has something to complain about. On VMS, it might complain both
# on stdout and stderr
- my $save_STDOUT;
- my $save_STDERR;
if ($ENV{HARNESS_ACTIVE} && !$ENV{HARNESS_VERBOSE}) {
open $save_STDOUT, '>&', \*STDOUT or die "Can't dup STDOUT: $!";
open $save_STDERR, '>&', \*STDERR or die "Can't dup STDERR: $!";
open STDOUT, ">", devnull();
open STDERR, ">", devnull();
}
+ }
$ENV{HARNESS_OSSL_LEVEL} = $level + 1;
@@ -489,6 +494,8 @@ sub run {
${$opts{statusvar}} = $r;
}
+ # Restore STDOUT / STDERR on VMS
+ if ($^O eq 'VMS') {
if ($ENV{HARNESS_ACTIVE} && !$ENV{HARNESS_VERBOSE}) {
close STDOUT;
close STDERR;
@@ -498,6 +505,9 @@ sub run {
print STDERR "$prefix$display_cmd => $e\n"
if !$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE};
+ } else {
+ print STDERR "$prefix$display_cmd => $e\n";
+ }
# At this point, $? stops being interesting, and unfortunately,
# there are Test::More versions that get picky if we leave it
@@ -1244,8 +1254,11 @@ sub __decorate_cmd {
my $display_cmd = "$cmdstr$stdin$stdout$stderr";
+ # VMS program output escapes TAP::Parser
+ if ($^O eq 'VMS') {
$stderr=" 2> ".$null
unless $stderr || !$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE};
+ }
$cmdstr .= "$stdin$stdout$stderr";
