Skip to content

Commit

Permalink
Modify test for GSettings environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
QuLogic committed Nov 24, 2024
1 parent 9f3f88f commit 348e12c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
18 changes: 0 additions & 18 deletions test cases/frameworks/7 gnome/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ if not glib.found()
error('MESON_SKIP_TEST glib not found.')
endif

gir = dependency('gobject-introspection-1.0', required: false)
if not gir.found()
error('MESON_SKIP_TEST gobject-introspection not found.')
endif

python3 = import('python3')
py3 = python3.find_python()
if run_command(py3, '-c', 'import gi;', check: false).returncode() != 0
Expand Down Expand Up @@ -45,28 +40,15 @@ endif

gnome = import('gnome')
gio = dependency('gio-2.0')
giounix = dependency('gio-unix-2.0')
glib = dependency('glib-2.0')
gobj = dependency('gobject-2.0')
gir = dependency('gobject-introspection-1.0')
gmod = dependency('gmodule-2.0')

# GLib >= 2.76 removed slice allocator which causes a leak in g-i to now be
# visible to asan. The leak should be fixed in g-i >= 1.76.2:
# https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411
if get_option('b_sanitize') != 'none' and \
gir.version().version_compare('<=1.76.1') and \
glib.version().version_compare('>=2.76')
error('MESON_SKIP_TEST gobject-introspection >=1.76.2 is required with address sanitizer.')
endif

# Test that static deps don't error out when static libraries aren't found
glib_static = dependency('glib-2.0', static : true)

subdir('resources-data')
subdir('resources')
subdir('gir')
subdir('schemas')
subdir('gdbus')
subdir('mkenums')
subdir('genmarshal')
2 changes: 1 addition & 1 deletion test cases/frameworks/7 gnome/schemas/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ compiled = gnome.compile_schemas(build_by_default: true)
install_data('com.github.meson.gschema.xml',
install_dir : 'share/glib-2.0/schemas')

schemaexe = executable('schemaprog', 'schemaprog.c', dependencies : gio)
schemaexe = executable('schemaprog', 'schemaprog.c', dependencies : gio, install: true)
test('schema test', schemaexe)
10 changes: 3 additions & 7 deletions test cases/frameworks/7 gnome/schemas/schemaprog.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ int main(int argc, char **argv) {
GSettings *settings;
GVariant *value;

GError *error = NULL;
src = g_settings_schema_source_new_from_directory("schemas",
g_settings_schema_source_get_default(), TRUE, &error);
if(error) {
fprintf(stderr, "Fail: %s\n", error->message);
g_error_free(error);
src = g_settings_schema_source_get_default();
if(src == NULL) {
fprintf(stderr, "Failed to get default schema source\n");
return 1;
}

Expand Down Expand Up @@ -42,6 +39,5 @@ int main(int argc, char **argv) {
g_variant_unref(value);
g_object_unref(settings);
g_settings_schema_unref(schema);
g_settings_schema_source_unref(src);
return 0;
}

0 comments on commit 348e12c

Please sign in to comment.