summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorChristoph Reiter <creiter@src.gnome.org>2019-03-28 22:08:04 +0100
committerChristoph Reiter <creiter@src.gnome.org>2019-04-11 16:45:36 +0200
commitfb083b6de28f8651af20ccbac1f20d7704859366 (patch)
tree16f832189af69eeb0d5e915102eecc7666337fab /testsuite
parent09fe0b0edc758708a6f4c3006f160d28d39c49c7 (diff)
downloadgtk+-fb083b6de28f8651af20ccbac1f20d7704859366.tar.gz
tests: don't overwrite GSETTINGS_SCHEMA_DIR when running under meson
Under autotools the compiled schemas are in the build directory and with meson they are in the root build dir. Avoid changing the autotools build for now and add a special GTK_TEST_MESON env var which we can use to differentiate the two. See 1253e7bfcbc80f88 for a similar fix on master.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gtk/defaultvalue.c3
-rw-r--r--testsuite/gtk/meson.build1
-rw-r--r--testsuite/gtk/notify.c3
-rw-r--r--testsuite/gtk/object.c3
-rw-r--r--testsuite/gtk/objects-finalize.c3
-rw-r--r--testsuite/gtk/templates.c3
6 files changed, 11 insertions, 5 deletions
diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c
index 0cb3073ce7..a82788b7e4 100644
--- a/testsuite/gtk/defaultvalue.c
+++ b/testsuite/gtk/defaultvalue.c
@@ -472,7 +472,8 @@ main (int argc, char **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);
+ if (g_getenv ("GTK_TEST_MESON") == NULL)
+ g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE);
/* Create one test bus for all tests, as we have a lot of very small
* and quick tests.
diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build
index 67863593a4..7cf67be39d 100644
--- a/testsuite/gtk/meson.build
+++ b/testsuite/gtk/meson.build
@@ -85,6 +85,7 @@ foreach t : tests
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir),
+ 'GTK_TEST_MESON=1',
],
suite: 'gtk')
endforeach
diff --git a/testsuite/gtk/notify.c b/testsuite/gtk/notify.c
index 201a44e17b..c7e8a69387 100644
--- a/testsuite/gtk/notify.c
+++ b/testsuite/gtk/notify.c
@@ -713,7 +713,8 @@ main (int argc, char **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);
+ if (g_getenv ("GTK_TEST_MESON") == NULL)
+ g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE);
otypes = gtk_test_list_all_types (NULL);
for (i = 0; otypes[i]; i++)
diff --git a/testsuite/gtk/object.c b/testsuite/gtk/object.c
index 6bdcd73864..b561aa9a52 100644
--- a/testsuite/gtk/object.c
+++ b/testsuite/gtk/object.c
@@ -336,7 +336,8 @@ main (int argc,
/* 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);
+ if (g_getenv ("GTK_TEST_MESON") == NULL)
+ g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE);
/* install a property test for each widget type */
otypes = gtk_test_list_all_types (NULL);
diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c
index 0b3a5198dc..24540e313f 100644
--- a/testsuite/gtk/objects-finalize.c
+++ b/testsuite/gtk/objects-finalize.c
@@ -92,7 +92,8 @@ main (int argc, char **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);
+ if (g_getenv ("GTK_TEST_MESON") == NULL)
+ g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE);
/* Create one test bus for all tests, as we have a lot of very small
* and quick tests.
diff --git a/testsuite/gtk/templates.c b/testsuite/gtk/templates.c
index 316dc1539d..1827c5a060 100644
--- a/testsuite/gtk/templates.c
+++ b/testsuite/gtk/templates.c
@@ -353,7 +353,8 @@ main (int argc, char **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);
+ if (g_getenv ("GTK_TEST_MESON") == 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