]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix test failure when testing with Test::Harness
authorHugo Landau <hlandau@openssl.org>
Mon, 7 Mar 2022 10:48:13 +0000 (10:48 +0000)
committerTomas Mraz <tomas@openssl.org>
Wed, 9 Mar 2022 08:46:09 +0000 (09:46 +0100)
Fixes an issue where, when the test suite was being run with the older
Test::Harness package, the test suite would not complete correctly due
to evaluation of $harness->runtests()->has_errors, which is only
available for the newer TAP::Parser::Aggregator code path.

Fixes #17818.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17823)

test/run_tests.pl

index 4ee6a036a9769ccf09d1373b1b8eb6f123e2c0a0..9e2ea8438b182554a9e420ffff8a876e6a401654 100644 (file)
@@ -314,10 +314,12 @@ my $harness = $package->new(\%tapargs);
 my $ret =
     $harness->runtests(map { [ abs2rel($_, rel2abs(curdir())), basename($_) ] }
                        @preps);
-die if $ret->has_errors;
-$ret =
-    $harness->runtests(map { [ abs2rel($_, rel2abs(curdir())), basename($_) ] }
-                       sort { reorder($a) cmp reorder($b) } keys %tests);
+
+if (ref($ret) ne "TAP::Parser::Aggregator" || !$ret->has_errors) {
+    $ret =
+        $harness->runtests(map { [ abs2rel($_, rel2abs(curdir())), basename($_) ] }
+                           sort { reorder($a) cmp reorder($b) } keys %tests);
+}
 
 # If this is a TAP::Parser::Aggregator, $ret->has_errors is the count of
 # tests that failed.  We don't bother with that exact number, just exit