From ba07c74006687f46f5a69a23c21bd024a1b43f12 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Wed, 8 Jan 2020 18:40:41 +0100 Subject: [PATCH] tests: Always add dummy skipping tests Just hiding tests that cannot be run does not seem like the best idea. So add dummy tests that are skipped, to denote that we could test more than we actually do (even if it is just for drivers that are not enabled). --- tests/meson.build | 49 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index d46d1c8..912b500 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -16,6 +16,12 @@ envs.set('FP_DRIVERS_WHITELIST', 'virtual_image') envs.set('NO_AT_BRIDGE', '1') +drivers_tests = [ + 'elan', + 'vfs5011', + 'synaptics', +] + if get_option('introspection') envs.prepend('GI_TYPELIB_PATH', join_paths(meson.build_root(), 'libfprint')) @@ -26,25 +32,44 @@ if get_option('introspection') env: envs, depends: libfprint_typelib, ) + else + test('virtual-image', + find_program('sh'), + args: ['-c', 'exit 77'] + ) endif - drivers_tests = [ - 'elan', - 'vfs5011', - 'synaptics', - ] - foreach driver_test: drivers_tests driver_envs = envs driver_envs.set('FP_DRIVERS_WHITELIST', driver_test) + if driver_test in drivers + test(driver_test, + find_program('umockdev-test.py'), + args: join_paths(meson.current_source_dir(), driver_test), + env: driver_envs, + suite: ['drivers'], + timeout: 10, + depends: libfprint_typelib, + ) + else + test(driver_test, + find_program('sh'), + args: ['-c', 'exit 77'] + ) + endif + endforeach +else + warning('Skipping all driver tests as introspection bindings are missing') + test('virtual-image', + find_program('sh'), + args: ['-c', 'exit 77'] + ) + + foreach driver_test: drivers_tests test(driver_test, - find_program('umockdev-test.py'), - args: join_paths(meson.current_source_dir(), driver_test), - env: driver_envs, - suite: ['drivers'], - timeout: 10, - depends: libfprint_typelib, + find_program('sh'), + args: ['-c', 'exit 77'] ) endforeach endif