2024-02-04 18:23:31 +00:00
|
|
|
# Testing library
|
2024-02-14 09:25:34 +00:00
|
|
|
if (APPLE OR UNIX OR WIN32 NOT guix)
|
|
|
|
FetchContent_Declare(
|
|
|
|
catch
|
|
|
|
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
|
|
|
GIT_TAG v3.5.2)
|
|
|
|
FetchContent_MakeAvailable(catch)
|
|
|
|
endif() #Adds Catch2::Catch2
|
|
|
|
|
|
|
|
|
|
|
|
#add_subdirectory(Catch2-3.5.2)
|
|
|
|
|
|
|
|
include(CTest)
|
|
|
|
#include(Catch)
|
|
|
|
include(Catch.cmake)
|
2024-02-04 18:23:31 +00:00
|
|
|
|
|
|
|
add_executable(tests tests.cpp test_cases.cpp test_cases.h)
|
|
|
|
target_compile_features(tests PRIVATE cxx_std_23)
|
|
|
|
|
|
|
|
# Should be linked to the rdricpp library, as well as the Catch2 testing library
|
2024-02-14 09:25:34 +00:00
|
|
|
target_link_libraries(tests PRIVATE rdricpp Catch2Main Catch2)
|
2024-02-04 18:23:31 +00:00
|
|
|
|
|
|
|
catch_discover_tests(tests)
|
|
|
|
add_test(NAME Test COMMAND tests)
|
|
|
|
|