Skip to content

Commit e4b1605

Browse files
committed
Escape Catch2 test names in catch_discover_tests tests
1 parent 42ee66b commit e4b1605

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/TestScripts/DiscoverTests/VerifyRegistration.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ def list_ctest_tests(build_path):
9090

9191
return test_names
9292

93+
def escape_catch2_test_name(name):
94+
for char in ('\\', ',', '[', ']'):
95+
name = name.replace(char, f"\\{char}")
96+
return name
9397

9498
if __name__ == '__main__':
9599
if len(sys.argv) != 3:
@@ -101,7 +105,7 @@ def list_ctest_tests(build_path):
101105

102106
build_path = build_project(sources_dir, output_base_path, catch2_path)
103107

104-
catch_test_names = get_test_names(build_path)
108+
catch_test_names = [escape_catch2_test_name(name) for name in get_test_names(build_path)]
105109
ctest_test_names = list_ctest_tests(build_path)
106110

107111
mismatched = 0

0 commit comments

Comments
 (0)