mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
gsettings test: fix srcdir != builddir
Just copy the schemas to the builddir and compile them in place instead of trying to mess around with creating the compiled file in a different dir. This solves issues in the summary/description testcase when GSettings expects the usual situation of having the .xml files present in the same directory.
This commit is contained in:
parent
1e5e3b64a8
commit
5c4f3f4dab
@ -324,6 +324,7 @@ dist_uninstalled_test_data += \
|
|||||||
enums.xml.template
|
enums.xml.template
|
||||||
# Generated while running the testcase itself...
|
# Generated while running the testcase itself...
|
||||||
CLEANFILES += \
|
CLEANFILES += \
|
||||||
|
org.gtk.test.gschema.xml \
|
||||||
org.gtk.test.enums.xml \
|
org.gtk.test.enums.xml \
|
||||||
gsettings.store \
|
gsettings.store \
|
||||||
gschemas.compiled \
|
gschemas.compiled \
|
||||||
|
@ -2340,7 +2340,6 @@ test_read_descriptions (void)
|
|||||||
GSettingsSchema *schema;
|
GSettingsSchema *schema;
|
||||||
GSettingsSchemaKey *key;
|
GSettingsSchemaKey *key;
|
||||||
GSettings *settings;
|
GSettings *settings;
|
||||||
const gchar *str;
|
|
||||||
|
|
||||||
settings = g_settings_new ("org.gtk.test");
|
settings = g_settings_new ("org.gtk.test");
|
||||||
g_object_get (settings, "settings-schema", &schema, NULL);
|
g_object_get (settings, "settings-schema", &schema, NULL);
|
||||||
@ -2386,6 +2385,7 @@ test_extended_schema (void)
|
|||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
gchar *schema_text;
|
||||||
gchar *enums;
|
gchar *enums;
|
||||||
gint result;
|
gint result;
|
||||||
|
|
||||||
@ -2412,11 +2412,11 @@ main (int argc, char *argv[])
|
|||||||
g_assert (g_file_set_contents ("org.gtk.test.enums.xml", enums, -1, NULL));
|
g_assert (g_file_set_contents ("org.gtk.test.enums.xml", enums, -1, NULL));
|
||||||
g_free (enums);
|
g_free (enums);
|
||||||
|
|
||||||
|
g_assert (g_file_get_contents (SRCDIR "/org.gtk.test.gschema.xml", &schema_text, NULL, NULL));
|
||||||
|
g_assert (g_file_set_contents ("org.gtk.test.gschema.xml", schema_text, -1, NULL));
|
||||||
|
|
||||||
g_remove ("gschemas.compiled");
|
g_remove ("gschemas.compiled");
|
||||||
g_assert (g_spawn_command_line_sync ("../glib-compile-schemas --targetdir=. "
|
g_assert (g_spawn_command_line_sync ("../glib-compile-schemas .", NULL, NULL, &result, NULL));
|
||||||
"--schema-file=org.gtk.test.enums.xml "
|
|
||||||
"--schema-file=" SRCDIR "/org.gtk.test.gschema.xml",
|
|
||||||
NULL, NULL, &result, NULL));
|
|
||||||
g_assert (result == 0);
|
g_assert (result == 0);
|
||||||
|
|
||||||
g_remove ("schema-source/gschemas.compiled");
|
g_remove ("schema-source/gschemas.compiled");
|
||||||
|
Loading…
Reference in New Issue
Block a user