summaryrefslogtreecommitdiff
path: root/testsuite/gtk/templates.c
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-11-09 01:15:33 +0100
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-12-03 14:24:16 +0100
commite5828073c28b47c7ef7cc7aacbb54d7cb511bf4a (patch)
treedd59f5be1ede9eace8e46d0e99a7f868ce9f134f /testsuite/gtk/templates.c
parent9d8a32b07d91be371cb021ad55f44742776ec753 (diff)
downloadgtk+-e5828073c28b47c7ef7cc7aacbb54d7cb511bf4a.tar.gz
gtk object tests: run under local environment
Make sure that the tests don't access the host's session bus or installed gsettings schemas. Also disable tests for some classes that leak a connection to the session bus. https://bugzilla.gnome.org/show_bug.cgi?id=711715
Diffstat (limited to 'testsuite/gtk/templates.c')
-rw-r--r--testsuite/gtk/templates.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/gtk/templates.c b/testsuite/gtk/templates.c
index 66ccd1f0de..e66c835cb5 100644
--- a/testsuite/gtk/templates.c
+++ b/testsuite/gtk/templates.c
@@ -320,9 +320,19 @@ test_print_unix_dialog_basic (void)
int
main (int argc, char **argv)
{
+ gchar *schema_dir;
+
+ /* These must be set before before gtk_test_init */
+ g_setenv ("GIO_USE_VFS", "local", TRUE);
+ g_setenv ("GSETTINGS_BACKEND", "memory", TRUE);
+
/* initialize test program */
gtk_test_init (&argc, &argv);
+ /* g_test_build_filename must be called after gtk_test_init */
+ schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL);
+ g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE);
+
/* This environment variable cooperates with gtk_widget_destroy()
* to assert that all automated compoenents are properly finalized
* when a given composite widget is destroyed.
@@ -355,5 +365,7 @@ main (int argc, char **argv)
g_test_add_func ("/Template/UnixPrint/GtkPrintUnixDialog/Basic", test_print_unix_dialog_basic);
#endif
+ g_free (schema_dir);
+
return g_test_run();
}