[evolution-data-server/openismus-work-master] Fixing test cases to load local GSettings schemas directly from the data/ dir



commit 5b2ea7835cc9bb1d34125d4a5752d8447c70fe12
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Wed Dec 12 20:30:40 2012 +0900

    Fixing test cases to load local GSettings schemas directly from the data/ dir

 data/Makefile.am                              |    7 ++++++-
 tests/test-server-utils/Makefile.am           |    1 +
 tests/test-server-utils/e-test-server-utils.c |    1 +
 3 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index f209552..654369f 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -9,12 +9,17 @@ gsettings_SCHEMAS =						\
 
 @GSETTINGS_RULES@
 
+# Compile the schemas locally, this is
+# required for running sandboxed test cases
+all-am:
+	$(GLIB_COMPILE_SCHEMAS) .
+
 convertdir = $(datadir)/GConf/gsettings
 convert_DATA = evolution-data-server.convert
 
 EXTRA_DIST = $(gsettings_SCHEMAS:.xml=.xml.in) \
 	     $(convert_DATA)
 
-CLEANFILES = $(gsettings_SCHEMAS)
+CLEANFILES = $(gsettings_SCHEMAS) gschemas.compiled
 
 -include $(top_srcdir)/git.mk
diff --git a/tests/test-server-utils/Makefile.am b/tests/test-server-utils/Makefile.am
index d382a4d..8f95f4f 100644
--- a/tests/test-server-utils/Makefile.am
+++ b/tests/test-server-utils/Makefile.am
@@ -13,6 +13,7 @@ common_cflags = \
 	-DG_LOG_DOMAIN=\"e-test-server-utils\" \
 	-DEDS_TEST_DBUS_SERVICE_DIR=\""$(abs_top_builddir)/tests/test-server-utils/services"\" \
 	-DEDS_TEST_WORK_DIR=\""$(abs_top_builddir)/tests/test-server-utils/cache"\" \
+	-DEDS_TEST_SCHEMA_DIR=\""$(abs_top_builddir)/data"\" \
 	$(E_DATA_SERVER_CFLAGS) \
 	$(GIO_UNIX_CFLAGS) \
 	$(NULL)
diff --git a/tests/test-server-utils/e-test-server-utils.c b/tests/test-server-utils/e-test-server-utils.c
index 0a5de19..de70ffb 100644
--- a/tests/test-server-utils/e-test-server-utils.c
+++ b/tests/test-server-utils/e-test-server-utils.c
@@ -27,6 +27,7 @@ typedef struct {
 static void
 setup_environment (void)
 {
+	g_assert (g_setenv ("GSETTINGS_SCHEMA_DIR", EDS_TEST_SCHEMA_DIR, 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));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]