From: Viktor Szakats Date: Sat, 13 Jul 2024 08:49:08 +0000 (+0200) Subject: runtests: show name and keywords for failed tests in summary X-Git-Tag: curl-8_9_0~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bae555359979016999a9425a2d489f219a78abdd;p=thirdparty%2Fcurl.git 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 --- diff --git a/tests/runtests.pl b/tests/runtests.pl index 8a042dc00a..a87c46ef3b 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -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"; } }