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:
committed by
Sébastien Helleu
parent
cb08473bdc
commit
440907e1cd
+1
-11
@@ -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)
|
||||
|
||||
@@ -25,4 +25,6 @@ endif()
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(unit)
|
||||
else()
|
||||
add_test(NAME notests COMMAND true)
|
||||
endif()
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
enable_language(CXX)
|
||||
|
||||
remove_definitions(-DHAVE_CONFIG_H)
|
||||
|
||||
find_package(CppUTest REQUIRED)
|
||||
include_directories(
|
||||
${CPPUTEST_INCLUDE_DIRS}
|
||||
${PROJECT_BINARY_DIR}
|
||||
|
||||
Reference in New Issue
Block a user