mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36: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
|
||||
# Generated while running the testcase itself...
|
||||
CLEANFILES += \
|
||||
org.gtk.test.gschema.xml \
|
||||
org.gtk.test.enums.xml \
|
||||
gsettings.store \
|
||||
gschemas.compiled \
|
||||
|
@ -2340,7 +2340,6 @@ test_read_descriptions (void)
|
||||
GSettingsSchema *schema;
|
||||
GSettingsSchemaKey *key;
|
||||
GSettings *settings;
|
||||
const gchar *str;
|
||||
|
||||
settings = g_settings_new ("org.gtk.test");
|
||||
g_object_get (settings, "settings-schema", &schema, NULL);
|
||||
@ -2386,6 +2385,7 @@ test_extended_schema (void)
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
gchar *schema_text;
|
||||
gchar *enums;
|
||||
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_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_assert (g_spawn_command_line_sync ("../glib-compile-schemas --targetdir=. "
|
||||
"--schema-file=org.gtk.test.enums.xml "
|
||||
"--schema-file=" SRCDIR "/org.gtk.test.gschema.xml",
|
||||
NULL, NULL, &result, NULL));
|
||||
g_assert (g_spawn_command_line_sync ("../glib-compile-schemas .", NULL, NULL, &result, NULL));
|
||||
g_assert (result == 0);
|
||||
|
||||
g_remove ("schema-source/gschemas.compiled");
|
||||
|
Loading…
Reference in New Issue
Block a user