aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodney Dawes <rodney.dawes@canonical.com>2017-02-02 17:14:30 -0500
committerRobert Tari <robert@tari.in>2021-07-09 01:40:37 +0200
commit579c0741ef9ad3ec2f7f0b1afc00f9bf77e6dd3f (patch)
treef5c7a2ba5616b6fbcab73cb15c7130331aed808d
parentbee22d6b1db9a479f81fad518eed9493759513c7 (diff)
downloadayatana-indicator-datetime-579c0741ef9ad3ec2f7f0b1afc00f9bf77e6dd3f.tar.gz
ayatana-indicator-datetime-579c0741ef9ad3ec2f7f0b1afc00f9bf77e6dd3f.tar.bz2
ayatana-indicator-datetime-579c0741ef9ad3ec2f7f0b1afc00f9bf77e6dd3f.zip
Also need PARENT_SCOPE here.
-rw-r--r--CMakeLists.txt39
-rw-r--r--tests/CMakeLists.txt2
2 files changed, 23 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f80a129..7e08544 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,28 +110,33 @@ endif()
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories (${CMAKE_CURRENT_BINARY_DIR}/include)
-# testing & coverage
-if (${ENABLE_TESTS})
- pkg_check_modules (DBUSTEST REQUIRED dbustest-1>=14.04.0)
- enable_testing ()
- if (${ENABLE_COVERAGE})
- find_package(CoverageReport)
- ENABLE_COVERAGE_REPORT(
- TARGETS indicatordatetimeservice ayatana-indicator-datetime-service
- TESTS ${COVERAGE_TEST_TARGETS}
- FILTER /usr/include ${CMAKE_BINARY_DIR}/*
- )
- endif ()
-endif ()
-
# actually build things
add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(po)
-if (${ENABLE_TESTS})
- add_subdirectory(tests)
-endif ()
+
+# testing & coverage
+if (ENABLE_TESTS)
+
+ include(CTest)
+ pkg_check_modules (DBUSTEST REQUIRED dbustest-1>=14.04.0)
+ enable_testing ()
+ enable_testing()
+ add_subdirectory(tests)
+
+ if (ENABLE_COVERAGE)
+
+ find_package(CoverageReport)
+ ENABLE_COVERAGE_REPORT(
+ TARGETS indicatordatetimeservice ayatana-indicator-datetime-service
+ TESTS ${COVERAGE_TEST_TARGETS}
+ FILTER /usr/include ${CMAKE_BINARY_DIR}/*
+ )
+
+ endif()
+
+endif()
# Display config info
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 8b80c2e..d83f315 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -108,7 +108,7 @@ add_eds_ics_test_by_name(test-eds-ics-repeating-events-with-individual-change)
# which hasn't landed yet. These can be re-enabled as soon as that lands.
#function(add_dbusmock_test_by_name name)
# set (TEST_NAME ${name})
-# set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME})
+# set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME} PARENT_SCOPE)
# add_executable (${TEST_NAME} ${TEST_NAME}.cpp gschemas.compiled)
# add_test (${TEST_NAME} ${TEST_NAME})
# target_link_libraries (${TEST_NAME} indicatordatetimeservice ${SERVICE_DEPS_LIBRARIES} ${DBUSTEST_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES})