From 1efa9d6b08c91da32b77c7168cac96521df6f700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 11 May 2025 10:15:08 +0200 Subject: [PATCH] core: reactivate CMake tests in root build directory (issue #1462) This fixes the command `ctest` executed in the root build directory. It was removed by accident in commit 68d87f2b808ae34927ea0f3dc525b1786ea621f0. --- CMakeLists.txt | 12 ++++++++++++ tests/CMakeLists.txt | 11 +---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83f9798bf..96e28a71b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,6 +284,18 @@ endif() add_subdirectory(src) add_subdirectory(doc) + +if(ENABLE_TESTS) + find_package(CppUTest) + if(CPPUTEST_FOUND) + enable_testing() + else() + message(SEND_ERROR "CppUTest not found") + endif() +else() + enable_testing() + add_test(NAME notests COMMAND true) +endif() add_subdirectory(tests) configure_file(config.h.cmake config.h @ONLY) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8b506853a..06e9d780b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,14 +24,5 @@ if(ENABLE_FUZZ) endif() if(ENABLE_TESTS) - find_package(CppUTest) - if(CPPUTEST_FOUND) - enable_testing() - add_subdirectory(unit) - else() - message(SEND_ERROR "CppUTest not found") - endif() -else() - enable_testing() - add_test(NAME notests COMMAND true) + add_subdirectory(unit) endif()