diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2016-01-04 10:19:59 -0600 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-08-28 10:17:14 +0200 |
commit | f829a7e9bc11614bf75dff270f161bff71c8ae4d (patch) | |
tree | 2fce2bb17460babd6c768f5d1a22e684e481a2b2 | |
parent | 1d9e1e532b6e52c974a6889706e02a500290ea51 (diff) | |
download | ayatana-indicator-power-f829a7e9bc11614bf75dff270f161bff71c8ae4d.tar.gz ayatana-indicator-power-f829a7e9bc11614bf75dff270f161bff71c8ae4d.tar.bz2 ayatana-indicator-power-f829a7e9bc11614bf75dff270f161bff71c8ae4d.zip |
move sound-player-mock into the tests/ directory
-rw-r--r-- | src/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 11 | ||||
-rw-r--r-- | tests/sound-player-mock.c (renamed from src/sound-player-mock.c) | 0 | ||||
-rw-r--r-- | tests/sound-player-mock.h (renamed from src/sound-player-mock.h) | 0 |
4 files changed, 10 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4654380..8eac086 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,8 +21,7 @@ set(SERVICE_MANUAL_SOURCES service.c utils.c sound-player.c - sound-player-gst.c - sound-player-mock.c) + sound-player-gst.c) # generated sources include(GdbusCodegen) 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) diff --git a/src/sound-player-mock.c b/tests/sound-player-mock.c index 35c3b57..35c3b57 100644 --- a/src/sound-player-mock.c +++ b/tests/sound-player-mock.c diff --git a/src/sound-player-mock.h b/tests/sound-player-mock.h index f844924..f844924 100644 --- a/src/sound-player-mock.h +++ b/tests/sound-player-mock.h |