diff --git a/CMakeLists.txt b/CMakeLists.txt index d857aa3..deb4e8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,8 @@ add_subdirectory(src) if(CNTGS_BUILD_TESTS) include("${CMAKE_CURRENT_LIST_DIR}/cmake/CntgsInstallGitHooks.cmake") - find_package(doctest REQUIRED) enable_testing() + find_package(doctest REQUIRED) include(doctest) add_subdirectory(test) add_subdirectory(example) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d775b09..8781200 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -69,6 +69,10 @@ function(cntgs_add_test _cntgs_name _cntgs_disassembly_file) $) target_precompile_headers(${_cntgs_name} PRIVATE "utils/precompiledHeader.hpp") + + if(CNTGS_DISCOVER_TESTS) + doctest_discover_tests(${_cntgs_name}) + endif() endfunction() set(CNTGS_TEST_SOURCE_FILES