From 202bdee9770da4fd4bd6d2f2da683aae1f5f18e5 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Mon, 26 Feb 2024 11:09:07 +0100 Subject: [PATCH] Fix `TEST_DL_PATHS` to be multi-args Signed-off-by: Cristian Le --- extras/CatchAddTests.cmake | 4 ++-- tests/TestScripts/DiscoverTests/CMakeLists.txt | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/extras/CatchAddTests.cmake b/extras/CatchAddTests.cmake index 692e3405..a0731941 100644 --- a/extras/CatchAddTests.cmake +++ b/extras/CatchAddTests.cmake @@ -21,8 +21,8 @@ function(catch_discover_tests_impl) cmake_parse_arguments( "" "" - "TEST_EXECUTABLE;TEST_WORKING_DIR;TEST_DL_PATHS;TEST_OUTPUT_DIR;TEST_OUTPUT_PREFIX;TEST_OUTPUT_SUFFIX;TEST_PREFIX;TEST_REPORTER;TEST_SPEC;TEST_SUFFIX;TEST_LIST;CTEST_FILE" - "TEST_EXTRA_ARGS;TEST_PROPERTIES;TEST_EXECUTOR" + "TEST_EXECUTABLE;TEST_WORKING_DIR;TEST_OUTPUT_DIR;TEST_OUTPUT_PREFIX;TEST_OUTPUT_SUFFIX;TEST_PREFIX;TEST_REPORTER;TEST_SPEC;TEST_SUFFIX;TEST_LIST;CTEST_FILE" + "TEST_EXTRA_ARGS;TEST_PROPERTIES;TEST_EXECUTOR;TEST_DL_PATHS" ${ARGN} ) diff --git a/tests/TestScripts/DiscoverTests/CMakeLists.txt b/tests/TestScripts/DiscoverTests/CMakeLists.txt index d19f2f88..2919303e 100644 --- a/tests/TestScripts/DiscoverTests/CMakeLists.txt +++ b/tests/TestScripts/DiscoverTests/CMakeLists.txt @@ -11,6 +11,12 @@ add_executable(tests add_subdirectory(${CATCH2_PATH} catch2-build) target_link_libraries(tests PRIVATE Catch2::Catch2WithMain) -include(CTest) +enable_testing() include(Catch) -catch_discover_tests(tests) +set(extra_args) +if (CMAKE_VERSION GREATER_EQUAL 3.27) + list(APPEND extra_args + DL_PATHS "$" + ) +endif () +catch_discover_tests(tests ${extra_args})