From ee7ecebbdc6ef58d68dd8624381efa9cad5985a7 Mon Sep 17 00:00:00 2001 From: Luca Matei Pintilie Date: Sun, 21 Dec 2025 21:42:53 +0100 Subject: [PATCH] add ctest support and remove absolute path from etc directory Some packagers use ctest by default to run tests. This is a small easy-win to add to biboumi. In addition some distros don't use /etc as their configuration path, and have to patch this out (see guix and nix), so this is also an easy fix. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7454fe4..0d05db4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -293,6 +293,9 @@ endforeach() find_package(Catch2) if(Catch2_FOUND) target_link_libraries(test_suite Catch2::Catch2WithMain) + include(CTest) + include(Catch) + catch_discover_tests(test_suite) endif() # @@ -339,7 +342,7 @@ install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/biboumi.1 DESTINATION share/man/man1 OPTIONAL COMPONENT documentation) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/biboumi.service DESTINATION lib/systemd/system COMPONENT init) file(GLOB policy_files conf/*policy.txt) -install(FILES ${policy_files} DESTINATION /etc/biboumi COMPONENT configuration) +install(FILES ${policy_files} DESTINATION etc/biboumi COMPONENT configuration) # ## Dist target