tests: Add tests for SessionLimits interface

This adds tests for the getter and setter for session limits, giving us
65.9% branch coverage (but that includes `g_return_if_fail()` and
friends, which are impossible and pointless to test both sides of the
branch).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2019-12-06 17:06:21 +00:00
parent ee7ed7dc35
commit ec1af3ef55
2 changed files with 1210 additions and 2 deletions

View File

@ -33,9 +33,14 @@ accounts_service_iface_c = custom_target(
'@INPUT@'],
)
accounts_service_extension_ifaces = [
join_paths(meson.source_root(), 'accounts-service', 'com.endlessm.ParentalControls.AppFilter.xml'),
join_paths(meson.source_root(), 'accounts-service', 'com.endlessm.ParentalControls.SessionLimits.xml'),
]
accounts_service_extension_iface_h = custom_target(
'accounts-service-extension-iface.h',
input: ['com.endlessm.ParentalControls.AppFilter.xml'],
input: accounts_service_extension_ifaces,
output: ['accounts-service-extension-iface.h'],
command: [gdbus_codegen,
'--interface-info-header',
@ -44,7 +49,7 @@ accounts_service_extension_iface_h = custom_target(
)
accounts_service_extension_iface_c = custom_target(
'accounts-service-extension-iface.c',
input: ['com.endlessm.ParentalControls.AppFilter.xml'],
input: accounts_service_extension_ifaces,
output: ['accounts-service-extension-iface.c'],
command: [gdbus_codegen,
'--interface-info-body',
@ -59,6 +64,12 @@ test_programs = [
accounts_service_extension_iface_h,
accounts_service_extension_iface_c,
], deps],
['session-limits', [
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',

File diff suppressed because it is too large Load Diff