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

summaryrefslogtreecommitdiffhomepage
path: root/tests/TestScripts/DiscoverTests
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-06-15 14:19:39 +0200
committerMartin Hořeňovský2023-06-15 14:19:39 +0200
commite4b16053a6763cd6f8b89aeaf59303a461ccf755 (patch)
tree9eb9aefeb3dc5d9292d8466e7a53465a35b06386 /tests/TestScripts/DiscoverTests
parent42ee66b5e625b7ed43727e3617af58ca8fad4a12 (diff)
downloadcatch3-e4b16053a6763cd6f8b89aeaf59303a461ccf755.tar.gz
Escape Catch2 test names in catch_discover_tests tests
Diffstat (limited to 'tests/TestScripts/DiscoverTests')
-rw-r--r--tests/TestScripts/DiscoverTests/VerifyRegistration.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/TestScripts/DiscoverTests/VerifyRegistration.py b/tests/TestScripts/DiscoverTests/VerifyRegistration.py
index aea0f012..9ec42f24 100644
--- a/tests/TestScripts/DiscoverTests/VerifyRegistration.py
+++ b/tests/TestScripts/DiscoverTests/VerifyRegistration.py
@@ -90,6 +90,10 @@ def list_ctest_tests(build_path):
return test_names
+def escape_catch2_test_name(name):
+ for char in ('\\', ',', '[', ']'):
+ name = name.replace(char, f"\\{char}")
+ return name
if __name__ == '__main__':
if len(sys.argv) != 3:
@@ -101,7 +105,7 @@ if __name__ == '__main__':
build_path = build_project(sources_dir, output_base_path, catch2_path)
- catch_test_names = get_test_names(build_path)
+ catch_test_names = [escape_catch2_test_name(name) for name in get_test_names(build_path)]
ctest_test_names = list_ctest_tests(build_path)
mismatched = 0