[gnome-keyring] daemon: Fix running tests without installed gnome-keyring



commit 99b6f5aa5bf2d216fa4ad47a94cde21f87f1af38
Author: Stef Walter <stefw gnome org>
Date:   Tue Jun 18 14:19:48 2013 +0200

    daemon: Fix running tests without installed gnome-keyring
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702367

 .gitignore                       |    2 ++
 daemon/dbus/tests/test-service.c |    9 ++++++++-
 schema/Makefile.am               |    8 ++++++++
 3 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 81432ef..0fdf6f1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -160,6 +160,8 @@ p11-tests.conf
 /pkcs11/xdg-store/tests/test-xdg-module
 /pkcs11/xdg-store/tests/test-xdg-trust
 
+/schema/gschemas.compiled
+
 /ui/gnome-keyring-prompt.desktop
 /ui/gnome-keyring-prompt.desktop.in
 /ui/tests/test-util
diff --git a/daemon/dbus/tests/test-service.c b/daemon/dbus/tests/test-service.c
index 98c545f..82ef523 100644
--- a/daemon/dbus/tests/test-service.c
+++ b/daemon/dbus/tests/test-service.c
@@ -82,6 +82,7 @@ test_service_setup (TestService *test)
        GError *error = NULL;
        GVariant *retval;
        GVariant *output;
+       gchar **env;
 
        gchar *args[] = {
                TOP_BUILDDIR "/daemon/gnome-keyring-daemon",
@@ -105,13 +106,19 @@ test_service_setup (TestService *test)
                SRCDIR "/files/test.keyring",
                NULL);
 
-       if (!g_spawn_async (NULL, args, NULL,
+       /* The schema directory */
+       env = g_get_environ ();
+       env = g_environ_setenv (env, "GSETTINGS_SCHEMA_DIR", TOP_BUILDDIR "/schema", TRUE);
+
+       if (!g_spawn_async (NULL, args, env,
                            G_SPAWN_LEAVE_DESCRIPTORS_OPEN | G_SPAWN_DO_NOT_REAP_CHILD,
                            on_service_spawned, test, &test->pid, &error)) {
                g_error ("couldn't start gnome-keyring-daemon for testing: %s", error->message);
                g_assert_not_reached ();
        }
 
+       g_strfreev (env);
+
        if (!test->available) {
                egg_test_wait ();
 
diff --git a/schema/Makefile.am b/schema/Makefile.am
index b0f2eef..1f614e5 100644
--- a/schema/Makefile.am
+++ b/schema/Makefile.am
@@ -10,6 +10,14 @@ convert_DATA = \
 convertdir = \
        $(datarootdir)/GConf/gsettings
 
+all-local: gschemas.compiled
+
+gschemas.compiled: $(gsettings_SCHEMAS)
+       glib-compile-schemas --strict .
+
+DISTCLEAN = \
+       gschemas.compiled
+
 EXTRA_DIST = \
        $(convert_DATA) \
        $(gsettings_SCHEMAS)
\ No newline at end of file


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