Skip to content

Commit

Permalink
chore: Fix discovering tests for CTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Tradias committed Oct 6, 2024
1 parent 08f3109 commit b45ad59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ function(cntgs_add_test _cntgs_name _cntgs_disassembly_file)
$<INSTALL_INTERFACE:include>)

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
Expand Down

0 comments on commit b45ad59

Please sign in to comment.