summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2018-04-10 23:48:16 +0200
committerBenjamin Berg <bberg@redhat.com>2018-06-05 11:57:20 +0200
commit409a4fe89455c2de8781ddbd3d18c0244aa1fd11 (patch)
tree6d07584f772bc84530eff94af7af40e99295c6a7
parentab7bc907a2db425cfbf86b2c3a27317caecdc8d6 (diff)
downloadgnome-settings-daemon-benzea/gnome-3-28.tar.gz
color: Correctly use gschemas from the build directory during testingbenzea/gnome-3-28
Seems like this broke in the move to meson. Rather than trying to set it inside the binary, set the environment variable in meson. (cherry picked from commit ea8e9144ca2f881c650e0d5abb6dd46c682db3ca)
-rw-r--r--plugins/color/gcm-self-test.c6
-rw-r--r--plugins/color/meson.build3
2 files changed, 2 insertions, 7 deletions
diff --git a/plugins/color/gcm-self-test.c b/plugins/color/gcm-self-test.c
index 3f00b601..83c06c52 100644
--- a/plugins/color/gcm-self-test.c
+++ b/plugins/color/gcm-self-test.c
@@ -281,17 +281,11 @@ gcm_test_frac_day (void)
int
main (int argc, char **argv)
{
- char *schema_dir;
-
g_setenv ("GSETTINGS_BACKEND", "memory", TRUE);
gtk_init (&argc, &argv);
g_test_init (&argc, &argv, NULL);
- schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL);
- g_setenv("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE);
- g_free (schema_dir);
-
g_test_add_func ("/color/edid", gcm_test_edid_func);
g_test_add_func ("/color/sunset-sunrise", gcm_test_sunset_sunrise);
g_test_add_func ("/color/sunset-sunrise/fractional-timezone", gcm_test_sunset_sunrise_fractional_timezone);
diff --git a/plugins/color/meson.build b/plugins/color/meson.build
index 6ca8a868..2ae1740a 100644
--- a/plugins/color/meson.build
+++ b/plugins/color/meson.build
@@ -51,4 +51,5 @@ exe = executable(
c_args: '-DTESTDATADIR="@0@"'.format(join_paths(meson.current_source_dir(), 'test-data'))
)
-test(test_unit, exe)
+envs = ['GSETTINGS_SCHEMA_DIR=@0@'.format(join_paths(meson.build_root(), 'data'))]
+test(test_unit, exe, env: envs)