use doctest_discover_tests to find individual tests (#7)

This commit is contained in:
Lars Melchior 2020-04-14 17:11:41 +02:00 committed by GitHub
parent adf2801be6
commit 4c756a78f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,8 +16,7 @@ include(../cmake/CPM.cmake)
CPMAddPackage( CPMAddPackage(
NAME doctest NAME doctest
GITHUB_REPOSITORY onqtam/doctest GITHUB_REPOSITORY onqtam/doctest
VERSION 2.3.2 GIT_TAG 2.3.7
GIT_TAG 2.3.2
) )
if (TEST_INSTALLED_VERSION) if (TEST_INSTALLED_VERSION)
@ -50,7 +49,13 @@ endif()
# ---- Add GreeterTests ---- # ---- Add GreeterTests ----
ENABLE_TESTING() ENABLE_TESTING()
ADD_TEST(GreeterTests GreeterTests)
# use doctest_discover_tests for better CTest support
include(${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake)
doctest_discover_tests(GreeterTests)
# Note: for general testing frameworks use:
# ADD_TEST(GreeterTests GreeterTests)
# ---- code coverage ---- # ---- code coverage ----