2022-01-14 23:36:38 +01:00
|
|
|
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
|
|
|
|
|
|
|
|
project(UnitTest CXX)
|
|
|
|
|
2024-01-28 20:50:32 +01:00
|
|
|
include(../external/catch2/extras/Catch.cmake)
|
2022-01-14 23:36:38 +01:00
|
|
|
|
2024-03-04 17:25:11 +01:00
|
|
|
add_executable(UnitTest adummy.cpp
|
2024-10-29 23:14:09 +01:00
|
|
|
characteristics_tests.cpp
|
|
|
|
billy_objects_tests.cpp
|
2024-03-04 17:25:11 +01:00
|
|
|
)
|
2022-01-14 23:36:38 +01:00
|
|
|
|
2024-10-29 23:14:09 +01:00
|
|
|
CXX_STANDARD 17
|
2024-10-30 21:43:09 +01:00
|
|
|
set_target_properties(Catch2 UnitTest PROPERTIES
|
2024-10-29 23:14:09 +01:00
|
|
|
CXX_STANDARD_REQUIRED ON
|
|
|
|
CXX_EXTENSIONS OFF
|
|
|
|
INTERPROCEDURAL_OPTIMIZATION_RELEASE ON
|
|
|
|
# UNITY_BUILD ON
|
2024-01-28 20:31:50 +01:00
|
|
|
)
|
2022-01-14 23:36:38 +01:00
|
|
|
target_include_directories(UnitTest PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
|
|
|
target_compile_definitions(UnitTest PRIVATE ${DEF_COMP})
|
2024-10-30 17:04:49 +01:00
|
|
|
target_compile_options(UnitTest PRIVATE ${COMPILE_FLAGS} -fdiagnostics-all-candidates)
|
2022-01-14 23:36:38 +01:00
|
|
|
target_link_options(UnitTest PRIVATE ${LINKER_OPTIONS})
|
2024-10-30 21:43:09 +01:00
|
|
|
target_link_libraries(UnitTest ${LINKER_FLAGS} Catch2::Catch2WithMain nlohmann_json::nlohmann_json BillySheet)
|
2022-02-09 23:26:12 +01:00
|
|
|
|
|
|
|
enable_testing()
|
|
|
|
catch_discover_tests(UnitTest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} REPORTER junit OUTPUT_DIR ${CMAKE_SOURCE_DIR} OUTPUT_PREFIX cppspec- OUTPUT_SUFFIX .xml)
|