]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: sort test IDs in summary lines
authorViktor Szakats <commit@vsz.me>
Sat, 25 May 2024 06:54:27 +0000 (08:54 +0200)
committerViktor Szakats <commit@vsz.me>
Sun, 26 May 2024 20:43:05 +0000 (22:43 +0200)
Changing this output:
```
TESTFAIL: These test cases failed: 2301 2303 2302 2307
```
Ref: https://github.com/curl/curl/actions/runs/9228638364/job/25393106631#step:6:21181

To:
```
TESTFAIL: These test cases failed: 2301 2302 2303 2307
```

Cherry-picked from #13766
Closes #13774

tests/runtests.pl

index ddfab20e861b42b885fed809f7cc4e3748758818..8839b1b3eb3dcdc3278a78ac0c88119e2fa55a11 100755 (executable)
@@ -447,6 +447,13 @@ sub compare {
     return $result;
 }
 
+#######################################################################
+# Numeric-sort words in a string
+sub numsortwords {
+    my ($string)=@_;
+    return join(' ', sort { $a <=> $b } split(' ', $string));
+}
+
 #######################################################################
 # Parse and store the protocols in curl's Protocols: line
 sub parseprotocols {
@@ -3022,13 +3029,15 @@ if(%skipped && !$short) {
 
 if($total) {
     if($failedign) {
-        logmsg "IGNORED: failed tests: $failedign\n";
+        my $failedignsorted = numsortwords($failedign);
+        logmsg "IGNORED: failed tests: $failedignsorted\n";
     }
     logmsg sprintf("TESTDONE: $ok tests out of $total reported OK: %d%%\n",
                    $ok/$total*100);
 
     if($failed && ($ok != $total)) {
-        logmsg "\nTESTFAIL: These test cases failed: $failed\n\n";
+        my $failedsorted = numsortwords($failed);
+        logmsg "\nTESTFAIL: These test cases failed: $failedsorted\n\n";
     }
 }
 else {