Skip to content

Commit

Permalink
use cmake's configure_file() to generate the test .ics files from .ic…
Browse files Browse the repository at this point in the history
…s.in so that we don't have to hardcode the filenames in the test data files either
  • Loading branch information
ckerr authored and sunweaver committed Mar 26, 2018
1 parent 222c9e4 commit b72e441
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LAST-MODIFIED:20150617T211838Z
BEGIN:VALARM
X-EVOLUTION-ALARM-UID:20150617T211838Z-6217-32011-2036-2@ubuntu-phablet
ACTION:AUDIO
ATTACH:file:///usr/share/sounds/ubuntu/ringtones/Alarm clock.ogg
ATTACH:file://${ALARM_DEFAULT_SOUND}
END:VALARM
BEGIN:VALARM
X-EVOLUTION-ALARM-UID:20150617T211838Z-6217-32011-2036-3@ubuntu-phablet
Expand All @@ -34,7 +34,7 @@ LAST-MODIFIED:20150617T211913Z
BEGIN:VALARM
X-EVOLUTION-ALARM-UID:20150617T211913Z-6217-32011-2036-6@ubuntu-phablet
ACTION:AUDIO
ATTACH:file:///usr/share/sounds/ubuntu/ringtones/Alarm clock.ogg
ATTACH:file://${ALARM_DEFAULT_SOUND}
END:VALARM
BEGIN:VALARM
X-EVOLUTION-ALARM-UID:20150617T211913Z-6217-32011-2036-7@ubuntu-phablet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LAST-MODIFIED:20150520T223932Z
BEGIN:VALARM
X-EVOLUTION-ALARM-UID:20150520T223932Z-22506-32011-1771-2@ubuntu-phablet
ACTION:AUDIO
ATTACH:file:///usr/share/sounds/ubuntu/ringtones/Alarm clock.ogg
ATTACH:file://${ALARM_DEFAULT_SOUND}
TRIGGER;VALUE=DURATION;RELATED=START:PT0S
END:VALARM
BEGIN:VALARM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ LAST-MODIFIED:20150507T211449Z
BEGIN:VALARM
X-EVOLUTION-ALARM-UID:20150507T211449Z-4262-32011-1418-2@ubuntu-phablet
ACTION:AUDIO
ATTACH:file:///usr/share/sounds/ubuntu/ringtones/Alarm clock.ogg
ATTACH:file://${ALARM_DEFAULT_SOUND}
TRIGGER;VALUE=DURATION;RELATED=START:PT0S
END:VALARM
BEGIN:VALARM
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b72e441

Please sign in to comment.