mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Fix CTest command issue with square brackets
This commit is contained in:
parent
fb74bb133c
commit
2aed6233cf
@ -51,8 +51,11 @@ string(REPLACE "\n" ";" output "${output}")
|
|||||||
# Parse output
|
# Parse output
|
||||||
foreach(line ${output})
|
foreach(line ${output})
|
||||||
set(test ${line})
|
set(test ${line})
|
||||||
# use escape commas to handle properly test cases with commans inside the name
|
# Escape characters in test case names that would be parsed by Catch2
|
||||||
string(REPLACE "," "\\," test_name ${test})
|
set(test_name ${test})
|
||||||
|
foreach(char , [ ])
|
||||||
|
string(REPLACE ${char} "\\${char}" test_name ${test_name})
|
||||||
|
endforeach(char)
|
||||||
# ...and add to script
|
# ...and add to script
|
||||||
add_command(add_test
|
add_command(add_test
|
||||||
"${prefix}${test}${suffix}"
|
"${prefix}${test}${suffix}"
|
||||||
|
Loading…
Reference in New Issue
Block a user