meson: Add tests for generated pkg-config files

Ensure things are generated as we expect and avoid we regress on that.
This commit is contained in:
Marco Trevisan (Treviño)
2023-04-14 19:56:32 +02:00
parent fcad56e313
commit ade79bcb50
5 changed files with 149 additions and 1 deletions

View File

@@ -124,3 +124,31 @@ foreach test_name, extra_args : gmodule_tests
suite : suite,
)
endforeach
if have_bash and have_pkg_config
modules = [
'gmodule-no-export-2.0',
'gmodule-export-2.0',
'gmodule-2.0',
]
foreach module: modules
test(module + '-pkg-config',
bash,
args: [
'-xe', '-c',
'\n'.join([
'pkg-config --validate ' + module,
'test "$(pkg-config --modversion @0@)" = "@1@"'.format(
module, glib_version),
'test "$(pkg-config --variable=prefix @0@)" = "@1@"'.format(
module, get_option('prefix')),
]),
],
suite: ['gmodule', 'no-valgrind', 'pkg-config'],
env: {
'PKG_CONFIG_PATH': meson.project_build_root() / 'meson-private',
},
)
endforeach
endif