diff options
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 80 |
1 files changed, 47 insertions, 33 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4b9b1d7..4aaee45 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -41,39 +41,35 @@ function(add_test_by_name name) add_test (${TEST_NAME} ${TEST_NAME}) target_link_libraries (${TEST_NAME} indicatordatetimeservice ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES}) endfunction() + add_test_by_name(test-datetime) +add_test_by_name(test-sound) if (ENABLE_LOMIRI_FEATURES) - add_test_by_name(test-sound) - # This one only succeeds on Lomiri because it needs hfd-service - # add_test_by_name(test-notification) - add_test_by_name(test-notification-response) -endif() + add_test_by_name(test-notification) +endif () +add_test_by_name(test-notification-response) add_test_by_name(test-actions) add_test_by_name(test-alarm-queue) add_test(NAME dear-reader-the-next-test-takes-60-seconds COMMAND true) add_test_by_name(test-clock) -# This one is fine, but hangs on Travis CI -# add_test_by_name(test-exporter) +add_test_by_name(test-exporter) add_test_by_name(test-formatter) add_test_by_name(test-live-actions) add_test_by_name(test-locations) add_test_by_name(test-menu-appointments) -# This one is fine, but hangs on Travis CI -# add_test_by_name(test-menus) +add_test_by_name(test-menus) add_test_by_name(test-planner) add_test_by_name(test-settings) add_test_by_name(test-timezone-timedated) add_test_by_name(test-utils) -if (ENABLE_LOMIRI_FEATURES) - set (TEST_NAME manual-test-snap) - set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME}) - add_executable (${TEST_NAME} ${TEST_NAME}.cpp) - target_link_options(${TEST_NAME} PRIVATE -no-pie) - target_link_libraries (${TEST_NAME} indicatordatetimeservice ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES}) -endif() +set (TEST_NAME manual-test-snap) +set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME}) +add_executable (${TEST_NAME} ${TEST_NAME}.cpp) +target_link_options(${TEST_NAME} PRIVATE -no-pie) +target_link_libraries (${TEST_NAME} indicatordatetimeservice ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES}) ## ## EDS Tests @@ -81,23 +77,40 @@ endif() find_program(DBUS_RUNNER dbus-test-runner) -function(add_eds_ics_test_by_name name) - set (TEST_NAME ${name}) - set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME} PARENT_SCOPE) - 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_options(${TEST_NAME} PRIVATE -no-pie) - target_link_libraries (${TEST_NAME} indicatordatetimeservice ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES}) - add_test (${TEST_NAME} - ${CMAKE_CURRENT_SOURCE_DIR}/run-eds-ics-test.sh - ${DBUS_RUNNER} # arg1: dbus-test-runner exec - ${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_BINARY_DIR}/${TEST_NAME}.ics # arg5: the ical file for this test - ${CMAKE_CURRENT_SOURCE_DIR}/accounts.db) # arg6: online accounts database -endfunction() +if (ENABLE_LOMIRI_FEATURES) + function(add_eds_ics_test_by_name name) + set (TEST_NAME ${name}) + set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME} PARENT_SCOPE) + add_executable(${TEST_NAME} ${TEST_NAME}.cpp gschemas.compiled) + target_link_options(${TEST_NAME} PRIVATE -no-pie) + target_link_libraries (${TEST_NAME} indicatordatetimeservice ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES}) + add_test (${TEST_NAME} + ${CMAKE_CURRENT_SOURCE_DIR}/run-mkcal-db-test.sh + ${DBUS_RUNNER} # arg1: dbus-test-runner exec + ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} # arg2: test executable path + ${TEST_NAME} # arg3: test name + ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}.db # arg4: the database file for this test + ${CMAKE_CURRENT_SOURCE_DIR}/accounts.db) # arg5: online accounts database + endfunction() +else () + function(add_eds_ics_test_by_name name) + set (TEST_NAME ${name}) + set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME} PARENT_SCOPE) + 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_options(${TEST_NAME} PRIVATE -no-pie) + target_link_libraries (${TEST_NAME} indicatordatetimeservice ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES}) + add_test (${TEST_NAME} + ${CMAKE_CURRENT_SOURCE_DIR}/run-eds-ics-test.sh + ${DBUS_RUNNER} # arg1: dbus-test-runner exec + ${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_BINARY_DIR}/${TEST_NAME}.ics # arg5: the ical file for this test + ${CMAKE_CURRENT_SOURCE_DIR}/accounts.db) # arg6: online accounts database + endfunction() +endif () add_eds_ics_test_by_name(test-eds-ics-all-day-events) add_eds_ics_test_by_name(test-eds-ics-repeating-events) add_eds_ics_test_by_name(test-eds-ics-nonrepeating-events) @@ -108,6 +121,7 @@ add_eds_ics_test_by_name(test-eds-ics-tzids-2) add_eds_ics_test_by_name(test-eds-ics-tzids-utc) add_eds_ics_test_by_name(test-eds-ics-non-attending-alarms) add_eds_ics_test_by_name(test-eds-ics-repeating-events-with-individual-change) +add_eds_ics_test_by_name(test-eds-ics-alarm-custom-sound) function(add_dbusmock_test_by_name name) set (TEST_NAME ${name}) |