test: remove redundant test suite uniqueness lint
What changed, and why it matters
This commit removes a redundant lint check that ensured Boost test suite names were unique. The same uniqueness check is now performed by the CMake build system when registering tests, so the Python lint script is no longer needed. There is no security-relevant change to Bitcoin Core's runtime behavior, consensus code, wallet handling, or network logic.
No security action required. Treat as normal code hygiene / test infrastructure cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes the check_unique_test_names() helper and its duplicate-detection logic from test/lint/lint-tests.py, collapsing main() to only run check_matching_test_names(). The removed code used a regex to extract suite names and reported duplicates. CMake now rejects duplicate suite names at CTest registration time, making the lint redundant. The change is purely a build/test infrastructure cleanup.
Changed components
test/lint/lint-tests.pyInspect captured patch +3 / −41
diff --git a/test/lint/lint-tests.py b/test/lint/lint-tests.py
index 75e4eb54..10015e6d 100755
--- a/test/lint/lint-tests.py
+++ b/test/lint/lint-tests.py
@@ -27,7 +27,8 @@ def grep_boost_test_suites():
return subprocess.check_output(command, text=True)
-def check_matching_test_names(test_suite_list):
+def main():
+ test_suite_list = grep_boost_test_suites().splitlines()
not_matching = [
x
for x in test_suite_list
@@ -42,46 +43,7 @@ def check_matching_test_names(test_suite_list):
f"{not_matching}\n"
)
print(error_msg)
- return 1
- return 0
-
-
-def get_duplicates(input_list):
- """
- From https://stackoverflow.com/a/9835819
- """
- seen = set()
- dupes = set()
- for x in input_list:
- if x in seen:
- dupes.add(x)
- else:
- seen.add(x)
- return dupes
-
-
-def check_unique_test_names(test_suite_list):
- output = [re.search(r"\((.*?)[,)]", x) for x in test_suite_list]
- output = [x.group(1) for x in output if x is not None]
- output = get_duplicates(output)
- output = sorted(list(output))
-
- if len(output) > 0:
- output = "\n".join(output)
- error_msg = (
- "Test suite names must be unique. The following test suite names\n"
- f"appear to be used more than once:\n\n{output}"
- )
- print(error_msg)
- return 1
- return 0
-
-
-def main():
- test_suite_list = grep_boost_test_suites().splitlines()
- exit_code = check_matching_test_names(test_suite_list)
- exit_code |= check_unique_test_names(test_suite_list)
- sys.exit(exit_code)
+ sys.exit(1)
if __name__ == "__main__":
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.