Skip to content

Commit 4a54d8e

Browse files
committed
cmake: enable testing at the top level
Ensure that we `enable_testing()` at the top-level CMakeLists.txt or else we'll need to navigate within the build directory to the correct place in the hierarchy to run `ctest`. Now we can `ctest` at the top-level again.
1 parent 7a15213 commit 4a54d8e

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ include(DefaultCFlags)
111111
add_subdirectory(src)
112112

113113
if(BUILD_TESTS)
114+
enable_testing()
114115
add_subdirectory(tests)
115116
endif()
116117

tests/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ function(ADD_CLAR_TEST name)
6868
endif()
6969
endfunction(ADD_CLAR_TEST)
7070

71-
enable_testing()
72-
7371
add_clar_test(offline -v -xonline)
7472
add_clar_test(invasive -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
7573
add_clar_test(online -v -sonline -xonline::customcert)

0 commit comments

Comments
 (0)