[evolution-data-server] tests: Add configured datadir to the D-Bus dirs
- From: Mathias Hasselmann <hasselmm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] tests: Add configured datadir to the D-Bus dirs
- Date: Thu, 6 Dec 2012 13:23:10 +0000 (UTC)
commit 30c751f0262b8a20faf282a416683a43629351f9
Author: Mathias Hasselmann <mathias openismus com>
Date: Thu Dec 6 14:14:40 2012 +0100
tests: Add configured datadir to the D-Bus dirs
This helps to really pick the locally built factories for tests,
without the need to fiddle with XDG_DATA_DIRS. Ideally we'd even use
service files for the currently build's uninstalled service binaries,
but that seems too much work right now.
tests/libedataserver/Makefile.am | 1 +
tests/libedataserver/e-test-dbus-utils.c | 23 ++++++++++++++++-------
2 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/tests/libedataserver/Makefile.am b/tests/libedataserver/Makefile.am
index fe1ab3f..283d4ac 100644
--- a/tests/libedataserver/Makefile.am
+++ b/tests/libedataserver/Makefile.am
@@ -13,6 +13,7 @@ test_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(top_srcdir) \
-DG_LOG_DOMAIN=\"e-data-server\" \
+ -DDATADIR=\"$(datadir)\" \
$(E_DATA_SERVER_CFLAGS) \
$(GIO_UNIX_CFLAGS) \
$(NULL)
diff --git a/tests/libedataserver/e-test-dbus-utils.c b/tests/libedataserver/e-test-dbus-utils.c
index 605dd9c..7bc592e 100644
--- a/tests/libedataserver/e-test-dbus-utils.c
+++ b/tests/libedataserver/e-test-dbus-utils.c
@@ -147,6 +147,20 @@ e_test_clean_base_directories (GError **error)
return success;
}
+static void
+register_dbus_service_dir (GTestDBus *test_dbus,
+ const gchar *data_dir)
+{
+ gchar *service_dir;
+
+ service_dir = g_build_filename (data_dir, "dbus-1", "services", NULL);
+
+ g_print ("Adding service dir: %s\n", service_dir);
+ g_test_dbus_add_service_dir (test_dbus, service_dir);
+
+ g_free (service_dir);
+}
+
GTestDBus *
e_test_setup_dbus_session (void)
{
@@ -160,15 +174,10 @@ e_test_setup_dbus_session (void)
g_assert (system_data_dirs != NULL);
test_dbus = g_test_dbus_new (G_TEST_DBUS_NONE);
+ register_dbus_service_dir (test_dbus, DATADIR);
for (ii = 0; system_data_dirs[ii] != NULL; ii++) {
- gchar *service_dir;
-
- service_dir = g_build_filename (
- system_data_dirs[ii], "dbus-1", "services", NULL);
- g_print ("Adding service dir: %s\n", service_dir);
- g_test_dbus_add_service_dir (test_dbus, service_dir);
- g_free (service_dir);
+ register_dbus_service_dir (test_dbus, system_data_dirs[ii]);
}
return test_dbus;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]