1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-08-31 22:21:13 +02:00

back to begining

needs to use doctest cmake modules ...
it is not my idea!
This commit is contained in:
ClausKlein 2021-02-18 17:53:26 +01:00
parent a7e6d9f044
commit b575afd39f

View file

@ -1,10 +1,6 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR) cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project( project(GreeterTests LANGUAGES CXX)
GreeterTests
VERSION 1.0
LANGUAGES CXX
)
# ---- Options ---- # ---- Options ----
@ -26,7 +22,7 @@ CPMAddPackage(
) )
if(TEST_INSTALLED_VERSION) if(TEST_INSTALLED_VERSION)
find_package(Greeter ${PROJECT_VERSION} EXACT REQUIRED) find_package(Greeter REQUIRED)
else() else()
CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..) CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
endif() endif()
@ -60,7 +56,11 @@ endif()
enable_testing() enable_testing()
add_test(NAME greeterTests COMMAND GreeterTests) # Note: doctest and similar testing frameworks can automatically configure CMake tests. For other
# testing frameworks add the tests target instead: add_test(NAME greeterTests COMMAND GreeterTests)
include(${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake)
doctest_discover_tests(GreeterTests)
# ---- code coverage ---- # ---- code coverage ----