2018-10-06 01:47:45 +02:00
|
|
|
deps = [
|
2019-03-13 14:17:43 +01:00
|
|
|
dependency('gio-2.0', version: '>= 2.60.1'),
|
2018-12-10 16:09:51 +01:00
|
|
|
dependency('gio-unix-2.0', version: '>= 2.44'),
|
2019-03-13 14:18:38 +01:00
|
|
|
dependency('glib-2.0', version: '>= 2.60.0'),
|
2018-10-06 01:47:45 +02:00
|
|
|
dependency('gobject-2.0', version: '>= 2.44'),
|
2020-07-07 16:29:11 +02:00
|
|
|
dependency('glib-testing-0', fallback: ['libglib-testing', 'libglib_testing_dep']),
|
2019-02-26 18:43:56 +01:00
|
|
|
libmalcontent_dep,
|
2018-10-06 01:47:45 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
envs = test_env + [
|
|
|
|
'G_TEST_SRCDIR=' + meson.current_source_dir(),
|
|
|
|
'G_TEST_BUILDDIR=' + meson.current_build_dir(),
|
|
|
|
]
|
|
|
|
|
2019-03-13 14:17:43 +01:00
|
|
|
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@'],
|
|
|
|
)
|
|
|
|
|
2019-12-06 18:06:21 +01:00
|
|
|
accounts_service_extension_ifaces = [
|
2020-07-06 11:59:45 +02:00
|
|
|
join_paths(meson.current_source_dir(), '..', '..', 'accounts-service', 'com.endlessm.ParentalControls.AppFilter.xml'),
|
|
|
|
join_paths(meson.current_source_dir(), '..', '..', 'accounts-service', 'com.endlessm.ParentalControls.SessionLimits.xml'),
|
2019-12-06 18:06:21 +01:00
|
|
|
]
|
|
|
|
|
2019-03-13 14:17:43 +01:00
|
|
|
accounts_service_extension_iface_h = custom_target(
|
|
|
|
'accounts-service-extension-iface.h',
|
2019-12-06 18:06:21 +01:00
|
|
|
input: accounts_service_extension_ifaces,
|
2019-03-13 14:17:43 +01:00
|
|
|
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',
|
2019-12-06 18:06:21 +01:00
|
|
|
input: accounts_service_extension_ifaces,
|
2019-03-13 14:17:43 +01:00
|
|
|
output: ['accounts-service-extension-iface.c'],
|
|
|
|
command: [gdbus_codegen,
|
|
|
|
'--interface-info-body',
|
|
|
|
'--output', '@OUTPUT@',
|
|
|
|
'@INPUT@'],
|
|
|
|
)
|
|
|
|
|
2018-10-06 01:47:45 +02:00
|
|
|
test_programs = [
|
2019-03-13 14:17:43 +01:00
|
|
|
['app-filter', [
|
|
|
|
accounts_service_iface_h,
|
|
|
|
accounts_service_iface_c,
|
|
|
|
accounts_service_extension_iface_h,
|
2019-12-06 18:06:21 +01:00
|
|
|
accounts_service_extension_iface_c,
|
|
|
|
], deps],
|
|
|
|
['session-limits', [
|
|
|
|
accounts_service_iface_h,
|
|
|
|
accounts_service_iface_c,
|
|
|
|
accounts_service_extension_iface_h,
|
2019-03-13 14:17:43 +01:00
|
|
|
accounts_service_extension_iface_c,
|
|
|
|
], deps],
|
2018-10-06 01:47:45 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
installed_tests_metadir = join_paths(datadir, 'installed-tests',
|
2019-02-26 18:43:56 +01:00
|
|
|
'libmalcontent-' + libmalcontent_api_version)
|
2018-10-06 01:47:45 +02:00
|
|
|
installed_tests_execdir = join_paths(libexecdir, 'installed-tests',
|
2019-02-26 18:43:56 +01:00
|
|
|
'libmalcontent-' + libmalcontent_api_version)
|
2018-10-06 01:47:45 +02:00
|
|
|
|
|
|
|
foreach program: test_programs
|
|
|
|
test_conf = configuration_data()
|
|
|
|
test_conf.set('installed_tests_dir', installed_tests_execdir)
|
|
|
|
test_conf.set('program', program[0])
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
input: test_template,
|
|
|
|
output: program[0] + '.test',
|
|
|
|
install: enable_installed_tests,
|
|
|
|
install_dir: installed_tests_metadir,
|
|
|
|
configuration: test_conf,
|
|
|
|
)
|
|
|
|
|
|
|
|
exe = executable(
|
|
|
|
program[0],
|
|
|
|
[program[0] + '.c'] + program[1],
|
|
|
|
dependencies: program[2],
|
|
|
|
include_directories: root_inc,
|
|
|
|
install: enable_installed_tests,
|
|
|
|
install_dir: installed_tests_execdir,
|
|
|
|
)
|
|
|
|
|
|
|
|
test(
|
|
|
|
program[0],
|
|
|
|
exe,
|
|
|
|
env: envs,
|
|
|
|
args: ['--tap'],
|
|
|
|
)
|
|
|
|
endforeach
|