From e4ee5134da0cf9656db9ea201f2b7b53e92ac1b7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 29 Jan 2015 20:57:16 -0600 Subject: Setup the PA mock as part of the indicator test --- tests/CMakeLists.txt | 3 +++ tests/indicator-fixture.h | 2 ++ tests/indicator-test.cc | 1 + 3 files changed, 6 insertions(+) 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(); addMock(*as); -- cgit v1.2.3