File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
tests/TestScripts/DiscoverTests Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ function(catch_discover_tests_impl)
7474 )
7575 endif ()
7676
77+ # Make sure to escape ; (semicolons) in test names first, because
78+ # that'd break the foreach loop for "Parse output" later and create
79+ # wrongly splitted and thus failing test cases (false positives)
80+ string (REPLACE ";" "\; " output "${output} " )
7781 string (REPLACE "\n " ";" output "${output} " )
7882
7983 # Prepare reporter
@@ -119,15 +123,16 @@ function(catch_discover_tests_impl)
119123
120124 # Parse output
121125 foreach (line ${output} )
122- set (test ${line} )
126+ set (test " ${line} " )
123127 # Escape characters in test case names that would be parsed by Catch2
124- set (test_name ${test} )
125- foreach (char , [ ])
126- string (REPLACE ${char} "\\ ${char} " test_name ${test_name} )
128+ # Note that the \ escaping must happen FIRST! Do not change the order.
129+ set (test_name "${test} " )
130+ foreach (char \\ , [ ])
131+ string (REPLACE ${char} "\\ ${char} " test_name "${test_name} " )
127132 endforeach (char)
128133 # ...add output dir
129134 if (output_dir)
130- string (REGEX REPLACE "[^A-Za-z0-9_]" "_" test_name_clean ${test_name} )
135+ string (REGEX REPLACE "[^A-Za-z0-9_]" "_" test_name_clean " ${test_name} " )
131136 set (output_dir_arg "--out ${output_dir} /${output_prefix}${test_name_clean}${output_suffix} " )
132137 endif ()
133138
Original file line number Diff line number Diff line change 88
99#include < catch2/catch_test_macros.hpp>
1010
11+ TEST_CASE (" @Script[C:\\ EPM1A]=x;\" SCALA_ZERO:\" " , " [script regressions]" ){}
1112TEST_CASE (" Some test" ) {}
You can’t perform that action at this time.
0 commit comments