[evolution-data-server] Bug 705268 - Run 'make check' within the build tree
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 705268 - Run 'make check' within the build tree
- Date: Wed, 22 Apr 2015 19:57:44 +0000 (UTC)
commit c7d4f0cf1a6ea27fa9563222393229766cd33fef
Author: Milan Crha <mcrha redhat com>
Date: Wed Apr 22 21:15:20 2015 +0200
Bug 705268 - Run 'make check' within the build tree
addressbook/libedata-book/e-data-book-factory.c | 11 ++++++-
addressbook/libedata-book/e-data-book-factory.h | 8 +++++
calendar/libedata-cal/e-data-cal-factory.c | 17 ++++++++--
calendar/libedata-cal/e-data-cal-factory.h | 10 +++++-
tests/test-server-utils/Makefile.am | 3 ++
tests/test-server-utils/e-test-server-utils.c | 37 +++++++++++++++++++++++
6 files changed, 81 insertions(+), 5 deletions(-)
---
diff --git a/addressbook/libedata-book/e-data-book-factory.c b/addressbook/libedata-book/e-data-book-factory.c
index 6722dcf..3dc4574 100644
--- a/addressbook/libedata-book/e-data-book-factory.c
+++ b/addressbook/libedata-book/e-data-book-factory.c
@@ -98,6 +98,8 @@ data_book_complete_open (EDataFactory *data_factory,
data_book_factory->priv->dbus_factory, invocation, object_path, bus_name);
}
+static gchar *overwrite_subprocess_book_path = NULL;
+
static gboolean
data_book_factory_handle_open_address_book_cb (EDBusAddressBookFactory *iface,
GDBusMethodInvocation *invocation,
@@ -107,7 +109,8 @@ data_book_factory_handle_open_address_book_cb (EDBusAddressBookFactory *iface,
EDataFactory *data_factory = E_DATA_FACTORY (factory);
e_data_factory_spawn_subprocess_backend (
- data_factory, invocation, uid, E_SOURCE_EXTENSION_ADDRESS_BOOK, SUBPROCESS_BOOK_BACKEND_PATH);
+ data_factory, invocation, uid, E_SOURCE_EXTENSION_ADDRESS_BOOK,
+ overwrite_subprocess_book_path ? overwrite_subprocess_book_path :
SUBPROCESS_BOOK_BACKEND_PATH);
return TRUE;
}
@@ -135,12 +138,18 @@ e_data_book_factory_class_init (EDataBookFactoryClass *class)
EDataFactoryClass *data_factory_class;
const gchar *modules_directory = BACKENDDIR;
const gchar *modules_directory_env;
+ const gchar *subprocess_book_path_env;
modules_directory_env = g_getenv (EDS_ADDRESS_BOOK_MODULES);
if (modules_directory_env &&
g_file_test (modules_directory_env, G_FILE_TEST_IS_DIR))
modules_directory = g_strdup (modules_directory_env);
+ subprocess_book_path_env = g_getenv (EDS_SUBPROCESS_BOOK_PATH);
+ if (subprocess_book_path_env &&
+ g_file_test (subprocess_book_path_env, G_FILE_TEST_IS_EXECUTABLE))
+ overwrite_subprocess_book_path = g_strdup (subprocess_book_path_env);
+
g_type_class_add_private (class, sizeof (EDataBookFactoryPrivate));
object_class = G_OBJECT_CLASS (class);
diff --git a/addressbook/libedata-book/e-data-book-factory.h b/addressbook/libedata-book/e-data-book-factory.h
index 68a1c34..40a2988 100644
--- a/addressbook/libedata-book/e-data-book-factory.h
+++ b/addressbook/libedata-book/e-data-book-factory.h
@@ -53,6 +53,14 @@
*/
#define EDS_ADDRESS_BOOK_MODULES "EDS_ADDRESS_BOOK_MODULES"
+/**
+ * EDS_SUBPROCESS_BOOK_PATH:
+ *
+ * This environment variable configures where the address book
+ * factory subprocess is located in.
+ */
+#define EDS_SUBPROCESS_BOOK_PATH "EDS_SUBPROCESS_BOOK_PATH"
+
G_BEGIN_DECLS
typedef struct _EDataBookFactory EDataBookFactory;
diff --git a/calendar/libedata-cal/e-data-cal-factory.c b/calendar/libedata-cal/e-data-cal-factory.c
index b03fd7b..57f897f 100644
--- a/calendar/libedata-cal/e-data-cal-factory.c
+++ b/calendar/libedata-cal/e-data-cal-factory.c
@@ -160,6 +160,8 @@ e_data_cal_factory_initable_init (GInitableIface *iface)
iface->init = data_cal_factory_initable_init;
}
+static gchar *overwrite_subprocess_cal_path = NULL;
+
static void
e_data_cal_factory_class_init (EDataCalFactoryClass *class)
{
@@ -167,12 +169,18 @@ e_data_cal_factory_class_init (EDataCalFactoryClass *class)
EDataFactoryClass *data_factory_class;
const gchar *modules_directory = BACKENDDIR;
const gchar *modules_directory_env;
+ const gchar *subprocess_cal_path_env;
modules_directory_env = g_getenv (EDS_CALENDAR_MODULES);
if (modules_directory_env &&
g_file_test (modules_directory_env, G_FILE_TEST_IS_DIR))
modules_directory = g_strdup (modules_directory_env);
+ subprocess_cal_path_env = g_getenv (EDS_SUBPROCESS_CAL_PATH);
+ if (subprocess_cal_path_env &&
+ g_file_test (subprocess_cal_path_env, G_FILE_TEST_IS_EXECUTABLE))
+ overwrite_subprocess_cal_path = g_strdup (subprocess_cal_path_env);
+
g_type_class_add_private (class, sizeof (EDataCalFactoryPrivate));
dbus_server_class = E_DBUS_SERVER_CLASS (class);
@@ -198,7 +206,8 @@ data_cal_factory_handle_open_calendar_cb (EDBusCalendarFactory *dbus_interface,
EDataFactory *data_factory = E_DATA_FACTORY (factory);
e_data_factory_spawn_subprocess_backend (
- data_factory, invocation, uid, E_SOURCE_EXTENSION_CALENDAR, SUBPROCESS_CAL_BACKEND_PATH);
+ data_factory, invocation, uid, E_SOURCE_EXTENSION_CALENDAR,
+ overwrite_subprocess_cal_path ? overwrite_subprocess_cal_path : SUBPROCESS_CAL_BACKEND_PATH);
return TRUE;
}
@@ -212,7 +221,8 @@ data_cal_factory_handle_open_task_list_cb (EDBusCalendarFactory *dbus_interface,
EDataFactory *data_factory = E_DATA_FACTORY (factory);
e_data_factory_spawn_subprocess_backend (
- data_factory, invocation, uid, E_SOURCE_EXTENSION_TASK_LIST, SUBPROCESS_CAL_BACKEND_PATH);
+ data_factory, invocation, uid, E_SOURCE_EXTENSION_TASK_LIST,
+ overwrite_subprocess_cal_path ? overwrite_subprocess_cal_path : SUBPROCESS_CAL_BACKEND_PATH);
return TRUE;
}
@@ -226,7 +236,8 @@ data_cal_factory_handle_open_memo_list_cb (EDBusCalendarFactory *dbus_interface,
EDataFactory *data_factory = E_DATA_FACTORY (factory);
e_data_factory_spawn_subprocess_backend (
- data_factory, invocation, uid, E_SOURCE_EXTENSION_MEMO_LIST, SUBPROCESS_CAL_BACKEND_PATH);
+ data_factory, invocation, uid, E_SOURCE_EXTENSION_MEMO_LIST,
+ overwrite_subprocess_cal_path ? overwrite_subprocess_cal_path : SUBPROCESS_CAL_BACKEND_PATH);
return TRUE;
}
diff --git a/calendar/libedata-cal/e-data-cal-factory.h b/calendar/libedata-cal/e-data-cal-factory.h
index ac85aad..1e01826 100644
--- a/calendar/libedata-cal/e-data-cal-factory.h
+++ b/calendar/libedata-cal/e-data-cal-factory.h
@@ -50,10 +50,18 @@
* EDS_CALENDAR_MODULES:
*
* This environment variable configures where the calendar
- * factory loads it's backend modules from.
+ * factory loads its backend modules from.
*/
#define EDS_CALENDAR_MODULES "EDS_CALENDAR_MODULES"
+/**
+ * EDS_SUBPROCESS_CAL_PATH:
+ *
+ * This environment variable configures where the calendar
+ * factory subprocess is located in.
+ */
+#define EDS_SUBPROCESS_CAL_PATH "EDS_SUBPROCESS_CAL_PATH"
+
G_BEGIN_DECLS
typedef struct _EDataCalFactory EDataCalFactory;
diff --git a/tests/test-server-utils/Makefile.am b/tests/test-server-utils/Makefile.am
index efa4d9d..b0f6aae 100644
--- a/tests/test-server-utils/Makefile.am
+++ b/tests/test-server-utils/Makefile.am
@@ -20,6 +20,9 @@ common_cflags = \
-DEDS_TEST_CALENDAR_DIR=\""$(abs_top_builddir)/calendar/backends/file/.libs"\" \
-DEDS_TEST_REGISTRY_DIR=\""$(abs_top_builddir)/modules/cache-reaper/.libs"\" \
-DEDS_TEST_CAMEL_DIR=\""$(abs_top_builddir)/camel/providers/local/.libs"\" \
+
-DEDS_TEST_SUBPROCESS_CAL_PATH=\""$(abs_top_builddir)/calendar/libedata-cal/.libs/evolution-calendar-factory-subprocess"\"
\
+
-DEDS_TEST_SUBPROCESS_BOOK_PATH=\""$(abs_top_builddir)/addressbook/libedata-book/.libs/evolution-addressbook-factory-subprocess"\"
\
+ -DEDS_TEST_TOP_BUILD_DIR=\""$(abs_top_builddir)/"\" \
$(E_DATA_SERVER_CFLAGS) \
$(EVOLUTION_CALENDAR_CFLAGS) \
$(GIO_UNIX_CFLAGS) \
diff --git a/tests/test-server-utils/e-test-server-utils.c b/tests/test-server-utils/e-test-server-utils.c
index b4ced14..d0784dd 100644
--- a/tests/test-server-utils/e-test-server-utils.c
+++ b/tests/test-server-utils/e-test-server-utils.c
@@ -246,6 +246,39 @@ generate_source_name (void)
static void
setup_environment (void)
{
+ GString *libs_dir;
+ const gchar *libs_dir_env;
+
+ libs_dir_env = g_getenv ("LD_LIBRARY_PATH");
+
+ libs_dir = g_string_new ("");
+
+ #define add_lib_path(x) G_STMT_START { \
+ if (libs_dir->len) \
+ g_string_append_c (libs_dir, ':'); \
+ g_string_append_printf (libs_dir, EDS_TEST_TOP_BUILD_DIR x); \
+ } G_STMT_END
+
+ add_lib_path ("addressbook/libebook/.libs");
+ add_lib_path ("addressbook/libebook-contacts/.libs");
+ add_lib_path ("addressbook/libedata-book/.libs");
+ add_lib_path ("calendar/libecal/.libs");
+ add_lib_path ("calendar/libedata-cal/.libs");
+ add_lib_path ("camel/.libs");
+ add_lib_path ("libebackend/.libs");
+ add_lib_path ("libedataserver/.libs");
+ add_lib_path ("libedataserverui/.libs");
+ add_lib_path ("private/.libs");
+
+ #undef add_lib_path
+
+ if (libs_dir_env && *libs_dir_env) {
+ if (libs_dir->len)
+ g_string_append_c (libs_dir, ':');
+ g_string_append (libs_dir, libs_dir_env);
+ }
+
+ g_assert (g_setenv ("LD_LIBRARY_PATH", libs_dir->str, TRUE));
g_assert (g_setenv ("XDG_DATA_HOME", EDS_TEST_WORK_DIR, TRUE));
g_assert (g_setenv ("XDG_CACHE_HOME", EDS_TEST_WORK_DIR, TRUE));
g_assert (g_setenv ("XDG_CONFIG_HOME", EDS_TEST_WORK_DIR, TRUE));
@@ -254,11 +287,15 @@ setup_environment (void)
g_assert (g_setenv ("EDS_ADDRESS_BOOK_MODULES", EDS_TEST_ADDRESS_BOOK_DIR, TRUE));
g_assert (g_setenv ("EDS_REGISTRY_MODULES", EDS_TEST_REGISTRY_DIR, TRUE));
g_assert (g_setenv ("EDS_CAMEL_PROVIDER_DIR", EDS_TEST_CAMEL_DIR, TRUE));
+ g_assert (g_setenv ("EDS_SUBPROCESS_CAL_PATH", EDS_TEST_SUBPROCESS_CAL_PATH, TRUE));
+ g_assert (g_setenv ("EDS_SUBPROCESS_BOOK_PATH", EDS_TEST_SUBPROCESS_BOOK_PATH, TRUE));
g_assert (g_setenv ("GIO_USE_VFS", "local", TRUE));
g_assert (g_setenv ("EDS_TESTING", "1", TRUE));
g_assert (g_setenv ("GSETTINGS_BACKEND", "memory", TRUE));
g_unsetenv ("DISPLAY");
+
+ g_string_free (libs_dir, TRUE);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]