aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2013-03-21 02:28:02 +0800
committerXan Lopez <xan@igalia.com>2013-03-21 02:37:56 +0800
commitf32c375e9b113d5b9668af6ec5379e4e743d01fe (patch)
treedfd9664afad8d8f058f03b0bbacad4ef173d35c5
parentf65b0e0ef8322139d230c0b5ba60e569ee1f390c (diff)
downloadgsoc2013-epiphany-f32c375e9b113d5b9668af6ec5379e4e743d01fe.tar
gsoc2013-epiphany-f32c375e9b113d5b9668af6ec5379e4e743d01fe.tar.gz
gsoc2013-epiphany-f32c375e9b113d5b9668af6ec5379e4e743d01fe.tar.bz2
gsoc2013-epiphany-f32c375e9b113d5b9668af6ec5379e4e743d01fe.tar.lz
gsoc2013-epiphany-f32c375e9b113d5b9668af6ec5379e4e743d01fe.tar.xz
gsoc2013-epiphany-f32c375e9b113d5b9668af6ec5379e4e743d01fe.tar.zst
gsoc2013-epiphany-f32c375e9b113d5b9668af6ec5379e4e743d01fe.zip
ephy-embed-shell-test: try harder to find the schemas dir
Need to do this since we override XDG_DATA_DIRS. https://bugzilla.gnome.org/show_bug.cgi?id=695620
-rw-r--r--tests/ephy-embed-shell-test.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ephy-embed-shell-test.c b/tests/ephy-embed-shell-test.c
index ef30b448b..9a7bbce47 100644
--- a/tests/ephy-embed-shell-test.c
+++ b/tests/ephy-embed-shell-test.c
@@ -88,6 +88,19 @@ int
main (int argc, char *argv[])
{
int ret;
+ const char *xdg_data_dirs;
+ char **dirs;
+ char *schemas_dir;
+
+ /* Save XDG_DATA_DIRS to set GSETTINGS_SCHEME_DIR, otherwise we
+ * won't find the sytem schemas. */
+ xdg_data_dirs = g_getenv ("XDG_DATA_DIRS");
+ dirs = g_strsplit (xdg_data_dirs, ":", -1);
+ /* We can only use one directory, so use the first one or the system default. */
+ schemas_dir = g_build_filename (dirs[0] ? dirs[0] : "/usr/share", "glib-2.0", "schemas", NULL);
+ g_setenv ("GSETTINGS_SCHEMA_DIR", schemas_dir, TRUE);
+ g_strfreev (dirs);
+ g_free (schemas_dir);
g_setenv ("XDG_DATA_DIRS", TEST_DIR, TRUE);
g_setenv ("XDG_DATA_HOME", TEST_DIR, TRUE);