diff options
author | Ted Gould <ted@gould.cx> | 2015-01-29 20:57:16 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2015-01-29 20:57:16 -0600 |
commit | e4ee5134da0cf9656db9ea201f2b7b53e92ac1b7 (patch) | |
tree | 0b90e4626df64466c55586931ae7cf05def4d087 /tests | |
parent | af63886e47b8262189d54712dbb34383ecf83669 (diff) | |
download | ayatana-indicator-sound-e4ee5134da0cf9656db9ea201f2b7b53e92ac1b7.tar.gz ayatana-indicator-sound-e4ee5134da0cf9656db9ea201f2b7b53e92ac1b7.tar.bz2 ayatana-indicator-sound-e4ee5134da0cf9656db9ea201f2b7b53e92ac1b7.zip |
Setup the PA mock as part of the indicator test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/indicator-fixture.h | 2 | ||||
-rw-r--r-- | tests/indicator-test.cc | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c1b4afc..d18e2dd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -92,6 +92,8 @@ add_library( pa-mock.cpp ) +target_link_libraries (pulse-mock ${PULSEAUDIO_LIBRARIES}) + ########################### # Name Watch Test ########################### @@ -213,6 +215,7 @@ 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" ) add_executable (indicator-test indicator-test.cc) target_link_libraries ( diff --git a/tests/indicator-fixture.h b/tests/indicator-fixture.h index b4893b5..a26f61d 100644 --- a/tests/indicator-fixture.h +++ b/tests/indicator-fixture.h @@ -73,10 +73,12 @@ class IndicatorFixture : public ::testing::Test } }); + g_debug("Starting System Bus"); dbus_test_service_start_tasks(_system_service); _system = g_bus_get_sync(G_BUS_TYPE_SYSTEM, nullptr, nullptr); g_dbus_connection_set_exit_on_close(_system, FALSE); + g_debug("Starting Session Bus"); dbus_test_service_start_tasks(_session_service); _session = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, nullptr); g_dbus_connection_set_exit_on_close(_session, FALSE); diff --git a/tests/indicator-test.cc b/tests/indicator-test.cc index 40755e3..37bf719 100644 --- a/tests/indicator-test.cc +++ b/tests/indicator-test.cc @@ -37,6 +37,7 @@ protected: { //addMock(buildBustleMock("indicator-test-session.bustle", DBUS_TEST_SERVICE_BUS_SESSION)); //addMock(buildBustleMock("indicator-test-system.bustle", DBUS_TEST_SERVICE_BUS_SYSTEM)); + g_setenv("LD_PRELOAD", PA_MOCK_LIB, TRUE); as = std::make_shared<AccountsServiceMock>(); addMock(*as); |