[gtk/gtk-3-24-meson: 45/89] tests: don't overwrite GSETTINGS_SCHEMA_DIR when running under meson
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24-meson: 45/89] tests: don't overwrite GSETTINGS_SCHEMA_DIR when running under meson
- Date: Wed, 10 Apr 2019 08:23:57 +0000 (UTC)
commit 763c5f652ebec3030c47a16f481192d80198a730
Author: Christoph Reiter <creiter src gnome org>
Date: Thu Mar 28 22:08:04 2019 +0100
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.
testsuite/gtk/defaultvalue.c | 3 ++-
testsuite/gtk/meson.build | 1 +
testsuite/gtk/notify.c | 3 ++-
testsuite/gtk/object.c | 3 ++-
testsuite/gtk/objects-finalize.c | 3 ++-
testsuite/gtk/templates.c | 3 ++-
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]