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

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGeorg Schwab2021-04-14 08:51:36 +0200
committerMartin Hořeňovský2021-04-16 17:22:14 +0200
commit04166514feec057540e4835c9f6636e6ad47721d (patch)
tree80890dad04376e320a5c54d029b7baa0f13824f8
parente8cdfdca87ebacd993befdd08ea6aa7e8068ef3d (diff)
downloadcatch3-04166514feec057540e4835c9f6636e6ad47721d.tar.gz
fixed inconsistent semicolon expansion in catch_discover_tests (Bug #2214)
-rw-r--r--extras/CatchAddTests.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/extras/CatchAddTests.cmake b/extras/CatchAddTests.cmake
index 3688b72f..9210f5a4 100644
--- a/extras/CatchAddTests.cmake
+++ b/extras/CatchAddTests.cmake
@@ -16,7 +16,10 @@ set(tests)
function(add_command NAME)
set(_args "")
- foreach(_arg ${ARGN})
+ # use ARGV* instead of ARGN, because ARGN splits arrays into multiple arguments
+ math(EXPR _last_arg ${ARGC}-1)
+ foreach(_n RANGE 1 ${_last_arg})
+ set(_arg "${ARGV${_n}}")
if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
set(_args "${_args} [==[${_arg}]==]") # form a bracket_argument
else()