From 788837cd39a9b7385d4642666e6dd63a5e04c547 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Thu, 20 Jul 2023 15:42:27 +0200 Subject: [PATCH] CMake: Tests now use own `scord.conf` instead of `/etc/scord.conf` --- examples/CMakeLists.txt | 8 +++----- examples/scord.conf.in | 13 +++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 examples/scord.conf.in diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index ff2512de..4dc14883 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -30,20 +30,18 @@ if(SCORD_BUILD_TESTS) set(TEST_DIRECTORY "${SCORD_TESTS_DIRECTORY}/scord_daemon") file(MAKE_DIRECTORY ${TEST_DIRECTORY}) - set(TEST_ENV) - list(APPEND TEST_ENV SCORD_LOG_OUTPUT=${TEST_DIRECTORY}/scord_daemon.log) + configure_file(scord.conf.in scord.conf) set(SCORD_ADDRESS_STRING ${SCORD_TRANSPORT_PROTOCOL}://${SCORD_BIND_ADDRESS}:${SCORD_BIND_PORT}) add_test(start_scord_daemon ${CMAKE_SOURCE_DIR}/scripts/runner.sh start scord.pid - ${CMAKE_BINARY_DIR}/src/scord/scord -f + ${CMAKE_BINARY_DIR}/src/scord/scord -f -c ${CMAKE_CURRENT_BINARY_DIR}/scord.conf ) set_tests_properties(start_scord_daemon - PROPERTIES FIXTURES_SETUP scord_daemon - ENVIRONMENT "${TEST_ENV}") + PROPERTIES FIXTURES_SETUP scord_daemon) add_test(stop_scord_daemon ${CMAKE_SOURCE_DIR}/scripts/runner.sh stop TERM scord.pid diff --git a/examples/scord.conf.in b/examples/scord.conf.in new file mode 100644 index 00000000..ca76279a --- /dev/null +++ b/examples/scord.conf.in @@ -0,0 +1,13 @@ +## vim: set filetype=yaml: + +## global service settings +global_settings: + + # log file + logfile: "@TEST_DIRECTORY@/scord_daemon.log" + + # path to pidfile + rundir: "@TEST_DIRECTORY@" + + # address to bind to + address: "@SCORD_TRANSPORT_PROTOCOL@://@SCORD_BIND_ADDRESS@:@SCORD_BIND_PORT@" -- GitLab