[evolution-data-server] Meta backend tests required system-running evolution-source-registry
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Meta backend tests required system-running evolution-source-registry
- Date: Fri, 23 Feb 2018 11:50:03 +0000 (UTC)
commit 1482237d3d12953c5f260069413e6b8e7f22da2d
Author: Milan Crha <mcrha redhat com>
Date: Fri Feb 23 12:48:50 2018 +0100
Meta backend tests required system-running evolution-source-registry
Before this change, both test-book-meta-backend and test-cal-meta-backend
failed when there was no evolution-source-registry running. This change
fixes it and makes sure correct source registry is used, like the one
from the build directory, not the system one.
tests/libedata-book/test-book-meta-backend.c | 2 +
tests/libedata-cal/test-cal-meta-backend.c | 2 +
tests/test-server-utils/e-test-server-utils.c | 26 ++++++++++++++++++------
tests/test-server-utils/e-test-server-utils.h | 2 +
4 files changed, 25 insertions(+), 7 deletions(-)
---
diff --git a/tests/libedata-book/test-book-meta-backend.c b/tests/libedata-book/test-book-meta-backend.c
index cdd0683..df54ad9 100644
--- a/tests/libedata-book/test-book-meta-backend.c
+++ b/tests/libedata-book/test-book-meta-backend.c
@@ -1695,6 +1695,7 @@ main (gint argc,
g_assert (g_setenv ("LC_ALL", "en_US.UTF-8", TRUE));
setlocale (LC_ALL, "");
+ e_test_server_utils_prepare_run (0);
e_test_server_utils_setup (&tsfixture, &tsclosure);
glob_registry = tsfixture.registry;
@@ -1724,6 +1725,7 @@ main (gint argc,
res = g_test_run ();
e_test_server_utils_teardown (&tsfixture, &tsclosure);
+ e_test_server_utils_finish_run ();
return res;
}
diff --git a/tests/libedata-cal/test-cal-meta-backend.c b/tests/libedata-cal/test-cal-meta-backend.c
index e313fe9..4d410c0 100644
--- a/tests/libedata-cal/test-cal-meta-backend.c
+++ b/tests/libedata-cal/test-cal-meta-backend.c
@@ -2704,6 +2704,7 @@ main (gint argc,
icaltzutil_set_exact_vtimezones_support (0);
#endif
+ e_test_server_utils_prepare_run (0);
e_test_server_utils_setup (&tsfixture, &tsclosure);
glob_registry = tsfixture.registry;
@@ -2743,6 +2744,7 @@ main (gint argc,
res = g_test_run ();
e_test_server_utils_teardown (&tsfixture, &tsclosure);
+ e_test_server_utils_finish_run ();
return res;
}
diff --git a/tests/test-server-utils/e-test-server-utils.c b/tests/test-server-utils/e-test-server-utils.c
index 97374d2..433bbdd 100644
--- a/tests/test-server-utils/e-test-server-utils.c
+++ b/tests/test-server-utils/e-test-server-utils.c
@@ -741,11 +741,9 @@ e_test_server_utils_run (void)
return e_test_server_utils_run_full (0);
}
-gint
-e_test_server_utils_run_full (ETestServerFlags flags)
+void
+e_test_server_utils_prepare_run (ETestServerFlags flags)
{
- gint tests_ret;
-
/* Cleanup work directory */
if (!test_installed_services ()) {
@@ -767,10 +765,11 @@ e_test_server_utils_run_full (ETestServerFlags flags)
g_test_dbus_up (global_test_dbus);
}
#endif
+}
- /* Run the GTest suite */
- tests_ret = g_test_run ();
-
+void
+e_test_server_utils_finish_run (void)
+{
#if GLOBAL_DBUS_DAEMON
if (!test_installed_services ()) {
/* Teardown the D-Bus Daemon
@@ -784,6 +783,19 @@ e_test_server_utils_run_full (ETestServerFlags flags)
global_test_dbus = NULL;
}
#endif
+}
+
+gint
+e_test_server_utils_run_full (ETestServerFlags flags)
+{
+ gint tests_ret;
+
+ e_test_server_utils_prepare_run (flags);
+
+ /* Run the GTest suite */
+ tests_ret = g_test_run ();
+
+ e_test_server_utils_finish_run ();
return tests_ret;
}
diff --git a/tests/test-server-utils/e-test-server-utils.h b/tests/test-server-utils/e-test-server-utils.h
index 41f0e54..c8bc749 100644
--- a/tests/test-server-utils/e-test-server-utils.h
+++ b/tests/test-server-utils/e-test-server-utils.h
@@ -162,5 +162,7 @@ void e_test_server_utils_teardown (ETestServerFixture *fixture,
gint e_test_server_utils_run (void);
gint e_test_server_utils_run_full (ETestServerFlags flags);
+void e_test_server_utils_prepare_run (ETestServerFlags flags);
+void e_test_server_utils_finish_run (void);
#endif /* E_TEST_UTILS_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]