Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-06-14 23:31:41 +0200
committerMartin Hořeňovský2023-06-14 23:31:41 +0200
commita0c6a28460872bfbdbc2ffc4c7ad19f352343586 (patch)
tree41aa493d63e28e89f40dff4ca1e08fce65e010c4 /tests
parentc8363143e7caad34520042158468a69aeae59a0d (diff)
downloadcatch3-a0c6a28460872bfbdbc2ffc4c7ad19f352343586.tar.gz
Fix possible FP in catch_discover_tests tests
Diffstat (limited to 'tests')
-rw-r--r--tests/TestScripts/DiscoverTests/VerifyRegistration.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/tests/TestScripts/DiscoverTests/VerifyRegistration.py b/tests/TestScripts/DiscoverTests/VerifyRegistration.py
index 058499e1..aea0f012 100644
--- a/tests/TestScripts/DiscoverTests/VerifyRegistration.py
+++ b/tests/TestScripts/DiscoverTests/VerifyRegistration.py
@@ -19,11 +19,11 @@ def build_project(sources_dir, output_base_path, catch2_path):
'-S', sources_dir,
f'-DCATCH2_PATH={catch2_path}',
'-DCMAKE_BUILD_TYPE=Debug']
-
+
build_cmd = ['cmake',
'--build', build_dir,
'--config', 'Debug']
-
+
try:
subprocess.run(config_cmd,
capture_output = True,
@@ -39,9 +39,9 @@ def build_project(sources_dir, output_base_path, catch2_path):
print(f'stderr: {err.stderr}')
print(f'stdout: {err.stdout}')
exit(3)
-
+
return build_dir
-
+
def get_test_names(build_path):
@@ -104,14 +104,16 @@ if __name__ == '__main__':
catch_test_names = get_test_names(build_path)
ctest_test_names = list_ctest_tests(build_path)
- if len(catch_test_names) != len(ctest_test_names):
- print("Mismatch between catch test names and ctest test names!")
- for catch_test in catch_test_names:
- if catch_test not in ctest_test_names:
- print(f"Catch2 test '{catch_test}' not found in CTest")
- for ctest_test in ctest_test_names:
- if ctest_test not in catch_test_names:
- print(f"CTest test '{ctest_test}' not found in Catch2")
-
+ mismatched = 0
+ for catch_test in catch_test_names:
+ if catch_test not in ctest_test_names:
+ print(f"Catch2 test '{catch_test}' not found in CTest")
+ mismatched += 1
+ for ctest_test in ctest_test_names:
+ if ctest_test not in catch_test_names:
+ print(f"CTest test '{ctest_test}' not found in Catch2")
+ mismatched += 1
+
+ if mismatched:
+ print(f"Found {mismatched} mismatched tests catch test names and ctest test commands!")
exit(1)
-