From e81d2809c1cc734369b687bacffa976abaa2b5b9 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 17 May 2018 15:05:40 -0700 Subject: [PATCH] Fix unit testing setup --- CMakeLists.txt | 4 ++++ tests/CMakeLists.txt | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69ea0b7fd8..54505717d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,6 +179,10 @@ endif() add_subdirectory(tools) if (BUILD_TESTS) + # Turn on testing so that add_test works + # MUST be in the root cmake file for ctest to work + include(CTest) + enable_testing() add_subdirectory(tests) add_subdirectory(tests-manual) endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bc11580979..37ca85a282 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,3 @@ - -# Turn on testing (so that add_test works) -enable_testing() - # add the test directories file(GLOB TEST_SUBDIRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*") list(REMOVE_ITEM TEST_SUBDIRS "CMakeFiles" "mocha")