tests: Use gdbus-codegen to drop hand-coded interface definitions
Bump our GLib dependency to 2.60 so we can use `gdbus-codegen --interface-info-{body,header}` to generate interface definitions dynamically rather than hand-coding them. We actually need to depend on 2.60.1 so we get https://gitlab.gnome.org/GNOME/glib/merge_requests/721. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
a95ae0c182
commit
d9acee829a
5 changed files with 358 additions and 142 deletions
|
@ -1,5 +1,5 @@
|
|||
deps = [
|
||||
dependency('gio-2.0', version: '>= 2.44'),
|
||||
dependency('gio-2.0', version: '>= 2.60.1'),
|
||||
dependency('gio-unix-2.0', version: '>= 2.44'),
|
||||
dependency('glib-2.0', version: '>= 2.54.2'),
|
||||
dependency('gobject-2.0', version: '>= 2.44'),
|
||||
|
@ -12,8 +12,53 @@ envs = test_env + [
|
|||
'G_TEST_BUILDDIR=' + meson.current_build_dir(),
|
||||
]
|
||||
|
||||
gdbus_codegen = find_program('gdbus-codegen')
|
||||
|
||||
accounts_service_iface_h = custom_target(
|
||||
'accounts-service-iface.h',
|
||||
input: ['org.freedesktop.Accounts.xml'],
|
||||
output: ['accounts-service-iface.h'],
|
||||
command: [gdbus_codegen,
|
||||
'--interface-info-header',
|
||||
'--output', '@OUTPUT@',
|
||||
'@INPUT@'],
|
||||
)
|
||||
accounts_service_iface_c = custom_target(
|
||||
'accounts-service-iface.c',
|
||||
input: ['org.freedesktop.Accounts.xml'],
|
||||
output: ['accounts-service-iface.c'],
|
||||
command: [gdbus_codegen,
|
||||
'--interface-info-body',
|
||||
'--output', '@OUTPUT@',
|
||||
'@INPUT@'],
|
||||
)
|
||||
|
||||
accounts_service_extension_iface_h = custom_target(
|
||||
'accounts-service-extension-iface.h',
|
||||
input: ['com.endlessm.ParentalControls.AppFilter.xml'],
|
||||
output: ['accounts-service-extension-iface.h'],
|
||||
command: [gdbus_codegen,
|
||||
'--interface-info-header',
|
||||
'--output', '@OUTPUT@',
|
||||
'@INPUT@'],
|
||||
)
|
||||
accounts_service_extension_iface_c = custom_target(
|
||||
'accounts-service-extension-iface.c',
|
||||
input: ['com.endlessm.ParentalControls.AppFilter.xml'],
|
||||
output: ['accounts-service-extension-iface.c'],
|
||||
command: [gdbus_codegen,
|
||||
'--interface-info-body',
|
||||
'--output', '@OUTPUT@',
|
||||
'@INPUT@'],
|
||||
)
|
||||
|
||||
test_programs = [
|
||||
['app-filter', ['accounts-service-iface.h'], deps],
|
||||
['app-filter', [
|
||||
accounts_service_iface_h,
|
||||
accounts_service_iface_c,
|
||||
accounts_service_extension_iface_h,
|
||||
accounts_service_extension_iface_c,
|
||||
], deps],
|
||||
]
|
||||
|
||||
installed_tests_metadir = join_paths(datadir, 'installed-tests',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue