1
0
mirror of https://github.com/catchorg/Catch2.git synced 2025-01-15 22:58:02 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Clare Macrae
2dc5a5f402
Prepare to prevent Catch2 v3's tests from being run, and CTest targets from being added, if Catch2 is configured as a sub-project. (#2205)
This commit fixes issue that happens if the project above us uses the same variable name, thus confusing our script which see the variable scoped from the project including Catch2, rather than ours

See #2202
2021-04-16 21:19:58 +02:00
Georg Schwab
04166514fe fixed inconsistent semicolon expansion in catch_discover_tests (Bug #2214) 2021-04-16 17:22:14 +02:00
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,8 @@ cmake_minimum_required(VERSION 3.5)
# disable testsuite in that case
if(NOT DEFINED PROJECT_NAME)
set(NOT_SUBPROJECT ON)
else()
set(NOT_SUBPROJECT OFF)
endif()
option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON)

View File

@ -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()