mirror of
https://github.com/red0124/ssp.git
synced 2025-12-14 21:59:55 +01:00
Make project used forked doctest
This commit is contained in:
@@ -4,11 +4,6 @@ project(ssp_tests CXX)
|
||||
|
||||
# ---- Dependencies ----
|
||||
|
||||
set(SSP_INCLUDE_WITHOUT_SYSTEM YES
|
||||
CACHE INTERNAL
|
||||
"Turn the warning guard off to have errors appear in test builds"
|
||||
)
|
||||
|
||||
include(FetchContent)
|
||||
fetchcontent_declare(ssp SOURCE_DIR "${PROJECT_SOURCE_DIR}/..")
|
||||
fetchcontent_makeavailable(ssp)
|
||||
@@ -17,9 +12,16 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
target_compile_options(ssp INTERFACE -Wall -Wextra)
|
||||
endif()
|
||||
|
||||
find_package(doctest 2.4.4 CONFIG REQUIRED)
|
||||
# for doctest_discover_tests
|
||||
include(doctest)
|
||||
include(FetchContent)
|
||||
fetchcontent_declare(
|
||||
DOCTEST
|
||||
GIT_REPOSITORY https://github.com/red0124/doctest
|
||||
GIT_TAG origin/master
|
||||
GIT_SHALLOW TRUE
|
||||
)
|
||||
|
||||
fetchcontent_makeavailable(DOCTEST)
|
||||
set(DOCTEST "${FETCHCONTENT_BASE_DIR}/doctest-src")
|
||||
|
||||
# ---- Test ----
|
||||
|
||||
@@ -35,5 +37,5 @@ foreach(name IN ITEMS test_splitter test_parser test_converter test_extractions)
|
||||
"${name}"
|
||||
PRIVATE DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN CMAKE_GITHUB_CI
|
||||
)
|
||||
doctest_discover_tests("${name}")
|
||||
add_test(NAME "${name}" COMMAND "${name}")
|
||||
endforeach()
|
||||
|
||||
Reference in New Issue
Block a user