1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

cmake: simplify tests handling

Move the requirement checking and the dummy test where they are used.
Use REQUIRED instead of the manual FOUND check and error handling.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
Emil Velikov
2025-09-14 15:26:16 +01:00
committed by Sébastien Helleu
parent cb08473bdc
commit 440907e1cd
3 changed files with 5 additions and 11 deletions
+1 -11
View File
@@ -313,17 +313,7 @@ list(APPEND EXTRA_LIBS "m")
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()
enable_testing()
add_subdirectory(tests)
configure_file(config.h.cmake config.h @ONLY)
+2
View File
@@ -25,4 +25,6 @@ endif()
if(ENABLE_TESTS)
add_subdirectory(unit)
else()
add_test(NAME notests COMMAND true)
endif()
+2
View File
@@ -22,6 +22,8 @@
enable_language(CXX)
remove_definitions(-DHAVE_CONFIG_H)
find_package(CppUTest REQUIRED)
include_directories(
${CPPUTEST_INCLUDE_DIRS}
${PROJECT_BINARY_DIR}