]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: fix uninitialized value on ignored tests
authorJay Satiro <raysatiro@yahoo.com>
Wed, 5 Oct 2022 07:33:39 +0000 (03:33 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Wed, 5 Oct 2022 08:00:40 +0000 (04:00 -0400)
- Don't show TESTFAIL message (ie tests failed which aren't ignored) if
  only ignored tests failed.

Before:
IGNORED: failed tests: 571 612 1056
TESTDONE: 1214 tests out of 1217 reported OK: 99%
Use of uninitialized value $failed in concatenation (.) or string at
./runtests.pl line 6290.
TESTFAIL: These test cases failed:

After:
IGNORED: failed tests: 571 612 1056
TESTDONE: 1214 tests out of 1217 reported OK: 99%

Closes https://github.com/curl/curl/pull/9648

tests/runtests.pl

index 7eeabfc3807694dbf29dc85d95d5966c12045f6f..72cd2c353efdfc9f8e2d2d604c00ad402b341ba4 100755 (executable)
@@ -6286,7 +6286,7 @@ if($total) {
     logmsg sprintf("TESTDONE: $ok tests out of $total reported OK: %d%%\n",
                    $ok/$total*100);
 
-    if($ok != $total) {
+    if($failed && ($ok != $total)) {
         logmsg "\nTESTFAIL: These test cases failed: $failed\n\n";
     }
 }