[evolution-data-server/openismus-work] tests: Add configured datadir to the D-Bus dirs



commit 09c10aa6defda63aa0c93c9a1a05fa8640f001c0
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/e-test-dbus-utils.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)
---
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]