Skip to content

Commit

Permalink
Escape Catch2 test names in catch_discover_tests tests
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Jun 15, 2023
1 parent 42ee66b commit e4b1605
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/TestScripts/DiscoverTests/VerifyRegistration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -101,7 +105,7 @@ def list_ctest_tests(build_path):

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
Expand Down

0 comments on commit e4b1605

Please sign in to comment.