← Commit list

8664a9f378

Daniel Stenberg
Daniel Stenberg
2026-06-12
SUCCESS Duration: 267s

Subject

runtests: error out on duplicate test names

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

tests/runtests.pl+14 -0
@@ -1209,6 +1209,8 @@ sub singletest_shouldrun {
return ($why, $errorreturncode);
}
+my %allnames;
+
#######################################################################
# Print the test name and count tests
sub singletest_count {
@@ -1241,6 +1243,17 @@ sub singletest_count {
if($listonly) {
timestampskippedevents($testnum);
}
+ else {
+ if(exists $allnames{$testname} &&
+ ($allnames{$testname} != $testnum)) {
+ logmsg sprintf("ERROR: test %d has duplicate test name: \"%s\". ".
+ "The same as test %d\n", $testnum,
+ $testname, $allnames{$testname});
+ return -1;
+ }
+ # store which test that uses this name
+ $allnames{$testname} = $testnum;
+ }
return 0;
}
@@ -1271,6 +1284,7 @@ sub singletest_check {
chomp $errorcode;
my $testname= (getpart("client", "name"))[0];
chomp $testname;
+
# what parts to cut off from stdout/stderr
my @stripfile = getpart("verify", "stripfile");