Fix TEST_DL_PATHS to be multi-args

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
This commit is contained in:
Cristian Le 2024-02-26 11:09:07 +01:00 committed by Martin Hořeňovský
parent bfe3ff8f19
commit 202bdee977
2 changed files with 10 additions and 4 deletions

View File

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

View File

@ -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 "$<TARGET_RUNTIME_DLL_DIRS:tests>"
)
endif ()
catch_discover_tests(tests ${extra_args})