diff options
author | Marco Trevisan <mail@3v1n0.net> | 2023-04-17 12:52:28 +0000 |
---|---|---|
committer | Marco Trevisan <mail@3v1n0.net> | 2023-04-17 12:52:28 +0000 |
commit | 9f111c34160d8a2e38f0ff0ce89dbcabec7c333a (patch) | |
tree | df2d990855340914edf734958ede72a5c934ab20 /gio/tests/meson.build | |
parent | 7c1ef5c9ec17330a09c48fa89658a274672fee06 (diff) | |
parent | c2e46b37896a33bda1305694a47bf694b13bdf80 (diff) | |
download | glib-9f111c34160d8a2e38f0ff0ce89dbcabec7c333a.tar.gz |
Merge branch 'valgrind-variable' into 'main'
meson: Add glib_valgrind_suppressions variable to glib pkg-config file
See merge request GNOME/glib!3361
Diffstat (limited to 'gio/tests/meson.build')
-rw-r--r-- | gio/tests/meson.build | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/gio/tests/meson.build b/gio/tests/meson.build index 2f312e056..8da884001 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -1096,4 +1096,72 @@ if installed_tests_enabled ) endif +if have_bash and have_pkg_config + prefix = get_option('prefix') + if prefix.endswith(':/') + prefix += '/' + endif + + pkg_config_tests = [ + 'pkg-config --validate gio-2.0', + 'test "$(pkg-config --modversion gio-2.0)" = "@0@"'.format(glib_version), + 'test "$(pkg-config --variable=prefix gio-2.0)" = "@0@"'.format( + get_option('prefix')), + 'test "$(pkg-config --variable=datadir gio-2.0)" = "@0@"'.format( + prefix / get_option('datadir')), + 'test "$(pkg-config --variable=schemasdir gio-2.0)" = "@0@"'.format( + prefix / get_option('datadir') / schemas_subdir), + 'test "$(pkg-config --variable=giomoduledir gio-2.0)" = "@0@"'.format( + get_option('gio_module_dir') != '' ? + prefix / get_option('gio_module_dir') : + prefix / get_option('libdir') / 'gio' / 'modules'), + ] + + gio_binaries = [ + 'gio', + 'gio-querymodules', + 'glib-compile-schemas', + 'glib-compile-resources', + 'gdbus', + 'gdbus-codegen', + 'gresource', + 'gsettings', + ] + + foreach binary: gio_binaries + pkg_config_tests += [ + 'test "$(pkg-config --variable=@0@ gio-2.0)" = "@1@"'.format( + binary.underscorify(), + prefix / get_option('bindir') / binary) + ] + endforeach + + test('gio-2.0-pkg-config', + bash, + args: [ '-xe', '-c', '\n'.join(pkg_config_tests) ], + suite: ['gio', 'no-valgrind', 'pkg-config'], + env: { + 'PKG_CONFIG_PATH': meson.project_build_root() / 'meson-private', + }, + ) + + platform_module = host_system == 'windows' ? 'gio-windows-2.0' : 'gio-unix-2.0' + pkg_config_tests = [ + 'pkg-config --validate ' + platform_module, + 'test "$(pkg-config --modversion @0@)" = "@1@"'.format(platform_module, + glib_version), + 'test "$(pkg-config --variable=prefix @0@)" = "@1@"'.format(platform_module, + get_option('prefix')), + ] + + test(platform_module + '-pkg-config', + bash, + args: [ '-xe', '-c', '\n'.join(pkg_config_tests) ], + suite: ['gio', 'no-valgrind', 'pkg-config'], + env: { + 'PKG_CONFIG_PATH': meson.project_build_root() / 'meson-private', + }, + ) +endif + subdir('services') |