aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt202
1 files changed, 104 insertions, 98 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 2bbd8c5..adc08de 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -5,10 +5,10 @@
include_directories(${GTEST_INCLUDE_DIR})
-add_library (gtest STATIC
+add_library (gtest-static STATIC
${GTEST_SOURCE_DIR}/gtest-all.cc
${GTEST_SOURCE_DIR}/gtest_main.cc)
-target_link_libraries(gtest ${GTEST_LIBS})
+target_link_libraries(gtest-static ${GTEST_LIBS})
###########################
# GSettings Schema
@@ -22,7 +22,8 @@ set_source_files_properties (gschemas.compiled GENERATED)
# GSettings:
# compile the indicator-sound schema into a gschemas.compiled file in this directory,
# and help the tests to find that file by setting -DSCHEMA_DIR
-set (SCHEMA_DIR "${CMAKE_CURRENT_BINARY_DIR}/gsettings-schemas")
+set (XDG_DATA_DIRS "${CMAKE_CURRENT_BINARY_DIR}/gsettings-schemas")
+set (SCHEMA_DIR "${XDG_DATA_DIRS}/glib-2.0/schemas")
add_definitions(-DSCHEMA_DIR="${SCHEMA_DIR}")
execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas
OUTPUT_VARIABLE COMPILE_SCHEMA_EXECUTABLE
@@ -31,6 +32,7 @@ add_custom_command (OUTPUT gschemas.compiled
DEPENDS ${CMAKE_SOURCE_DIR}/data/com.canonical.indicator.sound.gschema.xml
COMMAND mkdir -p ${SCHEMA_DIR}
COMMAND cp -f ${CMAKE_SOURCE_DIR}/data/*gschema.xml ${SCHEMA_DIR}
+ COMMAND cp -f /usr/share/glib-2.0/schemas/com.ubuntu.sound.gschema.xml ${SCHEMA_DIR}
COMMAND ${COMPILE_SCHEMA_EXECUTABLE} ${SCHEMA_DIR})
###########################
@@ -41,74 +43,74 @@ set(VALA_MOCKS_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/vala-mocks.h")
set(VALA_MOCKS_SYMBOLS_PATH "${CMAKE_CURRENT_BINARY_DIR}/vala-mocks.def")
vala_init(vala-mocks
- DEPENDS
- indicator-sound-service-lib
- PACKAGES
- config
- gio-2.0
- gio-unix-2.0
- libxml-2.0
- libpulse
- libpulse-mainloop-glib
- libnotify
- accounts-service
- indicator-sound-service
- OPTIONS
- --ccode
- --thread
- --vapidir=${CMAKE_BINARY_DIR}/src/
- --vapidir=${CMAKE_SOURCE_DIR}/vapi/
- --vapidir=.
+ DEPENDS
+ indicator-sound-service-lib
+ PACKAGES
+ config
+ gio-2.0
+ gio-unix-2.0
+ libxml-2.0
+ libpulse
+ libpulse-mainloop-glib
+ libnotify
+ accounts-service
+ indicator-sound-service
+ OPTIONS
+ --ccode
+ --thread
+ --vapidir=${CMAKE_BINARY_DIR}/src/
+ --vapidir=${CMAKE_SOURCE_DIR}/vapi/
+ --vapidir=.
)
vala_add(vala-mocks
- media-player-mock.vala
+ media-player-mock.vala
)
vala_add(vala-mocks
- media-player-list-mock.vala
+ media-player-list-mock.vala
)
vala_add(vala-mocks
- volume-control-mock.vala
+ volume-control-mock.vala
)
vala_finish(vala-mocks
- SOURCES
- vala_mocks_VALA_SOURCES
- OUTPUTS
- vala_mocks_VALA_C
- GENERATE_HEADER
- ${VALA_MOCKS_HEADER_PATH}
- GENERATE_SYMBOLS
- ${VALA_MOCKS_SYMBOLS_PATH}
+ SOURCES
+ vala_mocks_VALA_SOURCES
+ OUTPUTS
+ vala_mocks_VALA_C
+ GENERATE_HEADER
+ ${VALA_MOCKS_HEADER_PATH}
+ GENERATE_SYMBOLS
+ ${VALA_MOCKS_SYMBOLS_PATH}
)
set_source_files_properties(
- ${vala_mocks_VALA_SOURCES}
- PROPERTIES
- HEADER_FILE_ONLY TRUE
+ ${vala_mocks_VALA_SOURCES}
+ PROPERTIES
+ HEADER_FILE_ONLY TRUE
)
set(
- VALA_MOCKS_SOURCES
- ${vala_mocks_VALA_SOURCES}
- ${vala_mocks_VALA_C}
- ${VALA_MOCKS_SYMBOLS_PATH}
+ VALA_MOCKS_SOURCES
+ ${vala_mocks_VALA_SOURCES}
+ ${vala_mocks_VALA_C}
+ ${VALA_MOCKS_SYMBOLS_PATH}
)
add_definitions(
- -Wno-unused-but-set-variable
+ -Wno-unused-but-set-variable
)
add_library(
- vala-mocks-lib STATIC
- ${VALA_MOCKS_SOURCES}
+ vala-mocks-lib STATIC
+ ${VALA_MOCKS_SOURCES}
)
target_link_libraries(
- vala-mocks-lib
- indicator-sound-service-lib
+ vala-mocks-lib
+ indicator-sound-service-lib
)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
@@ -118,9 +120,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
###########################
add_library(
- pulse-mock
- SHARED
- pa-mock.cpp
+ pulse-mock
+ SHARED
+ pa-mock.cpp
)
target_link_libraries (pulse-mock ${PULSEAUDIO_LIBRARIES})
@@ -131,7 +133,7 @@ target_link_libraries (pulse-mock ${PULSEAUDIO_LIBRARIES})
include_directories(${CMAKE_SOURCE_DIR}/src)
add_executable (name-watch-test name-watch-test.cc ${CMAKE_SOURCE_DIR}/src/bus-watch-namespace.c)
-target_link_libraries (name-watch-test gtest ${SOUNDSERVICE_LIBRARIES})
+target_link_libraries (name-watch-test gtest-static ${SOUNDSERVICE_LIBRARIES})
add_test(name-watch-test name-watch-test)
###########################
@@ -141,21 +143,21 @@ add_test(name-watch-test name-watch-test)
include_directories(${CMAKE_SOURCE_DIR}/src)
add_executable (accounts-service-user-test accounts-service-user.cc)
target_link_libraries (
- accounts-service-user-test
- indicator-sound-service-lib
- vala-mocks-lib
- gtest
- ${SOUNDSERVICE_LIBRARIES}
- ${TEST_LIBRARIES}
+ accounts-service-user-test
+ indicator-sound-service-lib
+ vala-mocks-lib
+ gtest-static
+ ${SOUNDSERVICE_LIBRARIES}
+ ${TEST_LIBRARIES}
)
# Split tests to work around libaccountservice sucking
add_test(accounts-service-user-test-basic
- accounts-service-user-test --gtest_filter=AccountsServiceUserTest.BasicObject
+ accounts-service-user-test --gtest_filter=AccountsServiceUserTest.BasicObject
)
add_test(accounts-service-user-test-player
- accounts-service-user-test --gtest_filter=AccountsServiceUserTest.SetMediaPlayer
+ accounts-service-user-test --gtest_filter=AccountsServiceUserTest.SetMediaPlayer
)
###########################
@@ -165,11 +167,11 @@ add_test(accounts-service-user-test-player
include_directories(${CMAKE_SOURCE_DIR}/src)
add_executable (volume-control-test volume-control-test.cc gschemas.compiled)
target_link_libraries (
- volume-control-test
- indicator-sound-service-lib
- pulse-mock
- gtest
- ${TEST_LIBRARIES}
+ volume-control-test
+ indicator-sound-service-lib
+ pulse-mock
+ gtest-static
+ ${TEST_LIBRARIES}
)
add_test(volume-control-test volume-control-test)
@@ -181,12 +183,12 @@ add_test(volume-control-test volume-control-test)
include_directories(${CMAKE_SOURCE_DIR}/src)
add_executable (sound-menu-test sound-menu.cc)
target_link_libraries (
- sound-menu-test
- indicator-sound-service-lib
- vala-mocks-lib
- gtest
- ${SOUNDSERVICE_LIBRARIES}
- ${TEST_LIBRARIES}
+ sound-menu-test
+ indicator-sound-service-lib
+ vala-mocks-lib
+ gtest-static
+ ${SOUNDSERVICE_LIBRARIES}
+ ${TEST_LIBRARIES}
)
add_test(sound-menu-test sound-menu-test)
@@ -198,13 +200,13 @@ add_test(sound-menu-test sound-menu-test)
include_directories(${CMAKE_SOURCE_DIR}/src)
add_executable (notifications-test notifications-test.cc)
target_link_libraries (
- notifications-test
- indicator-sound-service-lib
- vala-mocks-lib
- pulse-mock
- gtest
- ${SOUNDSERVICE_LIBRARIES}
- ${TEST_LIBRARIES}
+ notifications-test
+ indicator-sound-service-lib
+ vala-mocks-lib
+ pulse-mock
+ gtest-static
+ ${SOUNDSERVICE_LIBRARIES}
+ ${TEST_LIBRARIES}
)
add_test(notifications-test notifications-test)
@@ -216,23 +218,23 @@ add_test(notifications-test notifications-test)
include_directories(${CMAKE_SOURCE_DIR}/src)
add_executable (media-player-user-test media-player-user.cc)
target_link_libraries (
- media-player-user-test
- indicator-sound-service-lib
- vala-mocks-lib
- gtest
- ${SOUNDSERVICE_LIBRARIES}
- ${TEST_LIBRARIES}
+ media-player-user-test
+ indicator-sound-service-lib
+ vala-mocks-lib
+ gtest-static
+ ${SOUNDSERVICE_LIBRARIES}
+ ${TEST_LIBRARIES}
)
# Split tests to work around libaccountservice sucking
add_test(media-player-user-test-basic
- media-player-user-test --gtest_filter=MediaPlayerUserTest.BasicObject
+ media-player-user-test --gtest_filter=MediaPlayerUserTest.BasicObject
)
add_test(media-player-user-test-dataset
- media-player-user-test --gtest_filter=MediaPlayerUserTest.DataSet
+ media-player-user-test --gtest_filter=MediaPlayerUserTest.DataSet
)
add_test(media-player-user-test-timeout
- media-player-user-test --gtest_filter=MediaPlayerUserTest.TimeoutTest
+ media-player-user-test --gtest_filter=MediaPlayerUserTest.TimeoutTest
)
###########################
@@ -242,20 +244,20 @@ add_test(media-player-user-test-timeout
include_directories(${CMAKE_SOURCE_DIR}/src)
add_executable (greeter-list-test greeter-list.cc)
target_link_libraries (
- greeter-list-test
- indicator-sound-service-lib
- vala-mocks-lib
- gtest
- ${SOUNDSERVICE_LIBRARIES}
- ${TEST_LIBRARIES}
+ greeter-list-test
+ indicator-sound-service-lib
+ vala-mocks-lib
+ gtest-static
+ ${SOUNDSERVICE_LIBRARIES}
+ ${TEST_LIBRARIES}
)
# Split tests to work around libaccountservice sucking
add_test(greeter-list-test-basic
- greeter-list-test --gtest_filter=GreeterListTest.BasicObject
+ greeter-list-test --gtest_filter=GreeterListTest.BasicObject
)
add_test(greeter-list-test-iterator
- greeter-list-test --gtest_filter=GreeterListTest.BasicIterator
+ greeter-list-test --gtest_filter=GreeterListTest.BasicIterator
)
###########################
@@ -263,18 +265,22 @@ add_test(greeter-list-test-iterator
###########################
add_definitions(
- -DINDICATOR_SOUND_SERVICE_BINARY="${CMAKE_BINARY_DIR}/src/indicator-sound-service"
- -DPA_MOCK_LIB="${CMAKE_CURRENT_BINARY_DIR}/libpulse-mock.so"
+ -DINDICATOR_SOUND_SERVICE_BINARY="${CMAKE_BINARY_DIR}/src/indicator-sound-service"
+ -DPA_MOCK_LIB="${CMAKE_CURRENT_BINARY_DIR}/libpulse-mock.so"
)
add_executable (indicator-test indicator-test.cc gschemas.compiled)
target_link_libraries (
- indicator-test
- gtest
- ${SOUNDSERVICE_LIBRARIES}
- ${TEST_LIBRARIES}
+ indicator-test
+ gtest-static
+ ${SOUNDSERVICE_LIBRARIES}
+ ${TEST_LIBRARIES}
)
# Split tests to work around libaccountservice sucking
add_test(indcator-test
- indicator-test
+ indicator-test
)
+
+add_subdirectory(integration)
+add_subdirectory(dbus-types)
+add_subdirectory(service-mocks) \ No newline at end of file