summaryrefslogtreecommitdiff
path: root/plugins/color/gcm-self-test.c
diff options
context:
space:
mode:
authorIain Lane <iain@orangesquash.org.uk>2017-05-19 16:38:07 +0100
committerIain Lane <iain@orangesquash.org.uk>2017-05-19 17:59:45 +0100
commit3923d6038dd2d842417bab15869c8b0d83ebc749 (patch)
tree1dca89562584024829296e143113e7992a0b22ec /plugins/color/gcm-self-test.c
parent5216f719340f3ad783789dd1acdcab81e8678e81 (diff)
downloadgnome-settings-daemon-3923d6038dd2d842417bab15869c8b0d83ebc749.tar.gz
color: Make the testcase able to run uninstalled
Distributions might want to be able to run their tests during package builds, for example. Compile the schema and set GSETTINGS_SCHEMA_DIR to the build dir. https://bugzilla.gnome.org/show_bug.cgi?id=782170
Diffstat (limited to 'plugins/color/gcm-self-test.c')
-rw-r--r--plugins/color/gcm-self-test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/color/gcm-self-test.c b/plugins/color/gcm-self-test.c
index 83c06c52..3f00b601 100644
--- a/plugins/color/gcm-self-test.c
+++ b/plugins/color/gcm-self-test.c
@@ -281,11 +281,17 @@ 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);