]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: show name and keywords for failed tests in summary
authorViktor Szakats <commit@vsz.me>
Sat, 13 Jul 2024 08:49:08 +0000 (10:49 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 16 Jul 2024 09:56:34 +0000 (11:56 +0200)
Useful to see what the numbers listed in the `TESTFAIL:` and `IGNORED:`
lines mean. Also list test keywords to help catching failure patterns.

Example:
```
FAIL 1034: 'HTTP over proxy with malformatted IDN host name' HTTP, HTTP GET, HTTP proxy, IDN, FAILURE, config file
FAIL 1035: 'HTTP over proxy with too long IDN host name' HTTP, HTTP GET, HTTP proxy, IDN, FAILURE

TESTFAIL: These test cases failed: 1034 1035
```

Closes #14174

tests/runtests.pl

index 8a042dc00a9430a966dc97c6c6ed6d6c43a13c37..a87c46ef3be551a7d1c3fcaad9a84daaff720c0c 100755 (executable)
@@ -3039,9 +3039,30 @@ if(%skipped && !$short) {
     }
 }
 
+sub testnumdetails {
+    my ($desc, $numlist) = @_;
+    foreach my $testnum (split(' ', $numlist)) {
+        if(!loadtest("${TESTDIR}/test${testnum}")) {
+            my @info_keywords = getpart("info", "keywords");
+            my $testname = (getpart("client", "name"))[0];
+            chomp $testname;
+            logmsg "$desc $testnum: '$testname'";
+            my $first = 1;
+            for my $k (@info_keywords) {
+                chomp $k;
+                my $sep = ($first == 1) ? " " : ", ";
+                logmsg "$sep$k";
+                $first = 0;
+            }
+            logmsg "\n";
+        }
+    }
+}
+
 if($total) {
     if($failedign) {
         my $failedignsorted = numsortwords($failedign);
+        testnumdetails("FAIL-IGNORED", $failedignsorted);
         logmsg "IGNORED: failed tests: $failedignsorted\n";
     }
     logmsg sprintf("TESTDONE: $ok tests out of $total reported OK: %d%%\n",
@@ -3049,6 +3070,7 @@ if($total) {
 
     if($failed && ($ok != $total)) {
         my $failedsorted = numsortwords($failed);
+        testnumdetails("\nFAIL", $failedsorted);
         logmsg "\nTESTFAIL: These test cases failed: $failedsorted\n\n";
     }
 }