aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2018-03-26 15:55:46 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-03-26 21:02:35 +0000
commitb72e44163e22433fd3f0cab38d126fde4545ab8f (patch)
treeae2a97662dcf7cdab233debb30a80a81706ca72b /tests/CMakeLists.txt
parent222c9e453f8b423fece2012cad87c1ce36470c46 (diff)
downloadayatana-indicator-datetime-b72e44163e22433fd3f0cab38d126fde4545ab8f.tar.gz
ayatana-indicator-datetime-b72e44163e22433fd3f0cab38d126fde4545ab8f.tar.bz2
ayatana-indicator-datetime-b72e44163e22433fd3f0cab38d126fde4545ab8f.zip
use cmake's configure_file() to generate the test .ics files from .ics.in so that we don't have to hardcode the filenames in the test data files either
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 1901f9f..cce094c 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -78,6 +78,8 @@ find_program(DBUS_RUNNER dbus-test-runner)
function(add_eds_ics_test_by_name name)
set (TEST_NAME ${name})
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}.ics.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}.ics")
add_executable(${TEST_NAME} ${TEST_NAME}.cpp gschemas.compiled)
target_link_libraries (${TEST_NAME} indicatordatetimeservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS})
add_test (${TEST_NAME}
@@ -86,7 +88,7 @@ function(add_eds_ics_test_by_name name)
${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} # arg2: test executable path
${TEST_NAME} # arg3: test name
${CMAKE_CURRENT_SOURCE_DIR}/test-eds-ics-config-files # arg4: base directory for config file template
- ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}.ics) # arg5: the ical file for this test
+ ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}.ics) # arg5: the ical file for this test
endfunction()
add_eds_ics_test_by_name(test-eds-ics-all-day-events)
add_eds_ics_test_by_name(test-eds-ics-repeating-events)