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.
This commit is contained in:
Luca Matei Pintilie
2026-01-10 18:55:10 +01:00
committed by mathieui
parent 0d714c2c0d
commit ee7ecebbdc
+4 -1
View File
@@ -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