aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRodney Dawes <rodney.dawes@canonical.com>2017-02-02 14:53:15 -0500
committerRobert Tari <robert@tari.in>2021-07-09 00:47:41 +0200
commit612ded78ec1762d9b71af6d5bba56eb415e1039e (patch)
tree8273f1f87426739fef23e92aea5be553bf89f373 /tests
parent75343eccb826c999fcd6f2dd2010bf04d986f836 (diff)
downloadayatana-indicator-datetime-612ded78ec1762d9b71af6d5bba56eb415e1039e.tar.gz
ayatana-indicator-datetime-612ded78ec1762d9b71af6d5bba56eb415e1039e.tar.bz2
ayatana-indicator-datetime-612ded78ec1762d9b71af6d5bba56eb415e1039e.zip
Switch to using gmock module from cmake-extras.
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt15
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 3bc6777..4eefbdc 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,9 +1,4 @@
-# build libgtest
-add_library (gtest STATIC
- ${GTEST_SOURCE_DIR}/gtest-all.cc
- ${GTEST_SOURCE_DIR}/gtest_main.cc)
-set_target_properties (gtest PROPERTIES INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${GTEST_INCLUDE_DIR})
-set_target_properties (gtest PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -w")
+find_package(GMock REQUIRED)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g ${COMPILE_FLAGS}")
@@ -44,7 +39,7 @@ function(add_test_by_name name)
set (TEST_NAME ${name})
add_executable (${TEST_NAME} ${TEST_NAME}.cpp gschemas.compiled)
add_test (${TEST_NAME} ${TEST_NAME})
- target_link_libraries (${TEST_NAME} indicatordatetimeservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS})
+ target_link_libraries (${TEST_NAME} indicatordatetimeservice ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES})
endfunction()
add_test_by_name(test-datetime)
if(HAVE_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS)
@@ -70,7 +65,7 @@ add_test_by_name(test-utils)
if(HAVE_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS)
set (TEST_NAME manual-test-snap)
add_executable (${TEST_NAME} ${TEST_NAME}.cpp)
- target_link_libraries (${TEST_NAME} indicatordatetimeservice gtest ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS})
+ target_link_libraries (${TEST_NAME} indicatordatetimeservice ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES})
endif()
##
@@ -84,7 +79,7 @@ function(add_eds_ics_test_by_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})
+ 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
@@ -112,7 +107,7 @@ add_eds_ics_test_by_name(test-eds-ics-repeating-events-with-individual-change)
# set (TEST_NAME ${name})
# add_executable (${TEST_NAME} ${TEST_NAME}.cpp gschemas.compiled)
# add_test (${TEST_NAME} ${TEST_NAME})
-# target_link_libraries (${TEST_NAME} indicatordatetimeservice gtest ${SERVICE_DEPS_LIBRARIES} ${DBUSTEST_LIBRARIES} ${GTEST_LIBS})
+# target_link_libraries (${TEST_NAME} indicatordatetimeservice ${SERVICE_DEPS_LIBRARIES} ${DBUSTEST_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES})
#endfunction()
#add_dbusmock_test_by_name(test-timezone-geoclue)
#add_dbusmock_test_by_name(test-timezones)