2025-01-05 23:19:26 +01:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2023-06-14 16:30:56 +02:00
|
|
|
|
|
|
|
project(discover-tests-test
|
|
|
|
LANGUAGES CXX
|
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(tests
|
|
|
|
register-tests.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
add_subdirectory(${CATCH2_PATH} catch2-build)
|
|
|
|
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain)
|
|
|
|
|
2024-02-26 11:09:07 +01:00
|
|
|
enable_testing()
|
2023-06-14 16:30:56 +02:00
|
|
|
include(Catch)
|
2024-02-26 11:09:07 +01:00
|
|
|
set(extra_args)
|
|
|
|
if (CMAKE_VERSION GREATER_EQUAL 3.27)
|
|
|
|
list(APPEND extra_args
|
2024-03-26 17:49:55 +01:00
|
|
|
DL_PATHS "${CMAKE_CURRENT_LIST_DIR};${CMAKE_CURRENT_LIST_DIR}/.."
|
2024-02-26 11:09:07 +01:00
|
|
|
)
|
|
|
|
endif ()
|
2025-01-03 10:30:47 +01:00
|
|
|
catch_discover_tests(
|
|
|
|
tests
|
|
|
|
ADD_TAGS_AS_LABELS
|
|
|
|
DISCOVERY_MODE PRE_TEST
|
|
|
|
${extra_args}
|
|
|
|
)
|
|
|
|
|
|
|
|
# DISCOVERY_MODE <POST_BUILD|PRE_TEST>
|