aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-02-05 17:19:33 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2015-02-05 17:19:33 +0000
commit2c5d6305dea48e2181a9180cea9e7cae19e94ef0 (patch)
tree3af41afd37e01998d62631843ce707266f926c21 /tests/CMakeLists.txt
parentc9cb54483cc5966b3c542ec86dd4e6bf7b33d4ec (diff)
parented66db9f090b5f98338e1a47103b0106cc02d980 (diff)
downloadayatana-indicator-sound-2c5d6305dea48e2181a9180cea9e7cae19e94ef0.tar.gz
ayatana-indicator-sound-2c5d6305dea48e2181a9180cea9e7cae19e94ef0.tar.bz2
ayatana-indicator-sound-2c5d6305dea48e2181a9180cea9e7cae19e94ef0.zip
Initial support for indicator service testing from the GMenu/GAction interfaces
Approved by: Jussi Pakkanen, PS Jenkins bot
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index fb93aca..38a76ae 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -11,6 +11,29 @@ add_library (gtest STATIC
target_link_libraries(gtest ${GTEST_LIBS})
###########################
+# GSettings Schema
+###########################
+
+# build the necessary schemas
+set_directory_properties (PROPERTIES
+ ADDITIONAL_MAKE_CLEAN_FILES gschemas.compiled)
+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")
+add_definitions(-DSCHEMA_DIR="${SCHEMA_DIR}")
+execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas
+ OUTPUT_VARIABLE COMPILE_SCHEMA_EXECUTABLE
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+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 ${COMPILE_SCHEMA_EXECUTABLE} ${SCHEMA_DIR})
+
+###########################
# Vala Mocks
###########################
@@ -92,6 +115,8 @@ add_library(
pa-mock.cpp
)
+target_link_libraries (pulse-mock ${PULSEAUDIO_LIBRARIES})
+
###########################
# Name Watch Test
###########################
@@ -207,3 +232,23 @@ add_test(greeter-list-test-iterator
greeter-list-test --gtest_filter=GreeterListTest.BasicIterator
)
+###########################
+# Indicator Test
+###########################
+
+add_definitions(
+ -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}
+)
+
+# Split tests to work around libaccountservice sucking
+add_test(indcator-test
+ indicator-test
+)