runtests: show name and keywords for failed tests in summary

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
This commit is contained in:
Viktor Szakats 2024-07-13 10:49:08 +02:00
parent dfbdcb93ae
commit bae5553599
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -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";
}
}