diff --git a/CMakeLists.txt b/CMakeLists.txt index ba3ec4b7e2..1f2685a441 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,9 @@ project(TheAlgorithms/C++ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(CTest) # for testing algorithms + # Additional warnings and errors if(MSVC) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) diff --git a/math/CMakeLists.txt b/math/CMakeLists.txt index 2b70b2d310..bd6fcf5007 100644 --- a/math/CMakeLists.txt +++ b/math/CMakeLists.txt @@ -8,7 +8,7 @@ foreach( testsourcefile ${APP_SOURCES} ) # I used a simple string replace, to cut off .cpp. string( REPLACE ".cpp" "" testname ${testsourcefile} ) add_executable( ${testname} ${testsourcefile} ) - + add_test(NAME ${testname} COMMAND ${testname}) set_target_properties(${testname} PROPERTIES LINKER_LANGUAGE CXX) if(OpenMP_CXX_FOUND) target_link_libraries(${testname} OpenMP::OpenMP_CXX)