aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-01-04 10:19:59 -0600
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-28 10:17:14 +0200
commitf829a7e9bc11614bf75dff270f161bff71c8ae4d (patch)
tree2fce2bb17460babd6c768f5d1a22e684e481a2b2 /tests/CMakeLists.txt
parent1d9e1e532b6e52c974a6889706e02a500290ea51 (diff)
downloadayatana-indicator-power-f829a7e9bc11614bf75dff270f161bff71c8ae4d.tar.gz
ayatana-indicator-power-f829a7e9bc11614bf75dff270f161bff71c8ae4d.tar.bz2
ayatana-indicator-power-f829a7e9bc11614bf75dff270f161bff71c8ae4d.zip
move sound-player-mock into the tests/ directory
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 566132e..41e48cd 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -9,6 +9,13 @@ include_directories (SYSTEM ${DBUSTEST_INCLUDE_DIRS})
# add warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${C_WARNING_ARGS}")
+# build the mocks
+set(MOCK_LIB "indicatorpowerservicemocks")
+set(MOCK_SOURCES sound-player-mock.c)
+set_source_files_properties(${MOCK_SOURCES}
+ PROPERTIES COMPILE_FLAGS "${C_WARNING_ARGS} -g -std=c99")
+add_library(${MOCK_LIB} STATIC ${MOCK_SOURCES})
+
# build the necessary schemas
set_directory_properties (PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES gschemas.compiled)
@@ -50,8 +57,8 @@ function(add_test_by_name name)
add_executable (${TEST_NAME} ${TEST_NAME}.cc)
target_link_options(${TEST_NAME} PRIVATE -no-pie)
add_test (${TEST_NAME} ${TEST_NAME})
- add_dependencies (${TEST_NAME} ayatanaindicatorpowerservice gschemas-compiled)
- target_link_libraries (${TEST_NAME} ayatanaindicatorpowerservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS} ${URLDISPATCHER_LIBRARIES} ${GMOCK_LIBRARIES})
+ add_dependencies (${TEST_NAME} ${MOCK_LIB} ayatanaindicatorpowerservice gschemas-compiled)
+ target_link_libraries (${TEST_NAME} ${MOCK_LIB} ayatanaindicatorpowerservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS} ${URLDISPATCHER_LIBRARIES} ${GMOCK_LIBRARIES})
endfunction()
add_test_by_name(test-notify)
add_test(NAME dear-reader-the-next-test-takes-80-seconds COMMAND true)