libfprint/SOURCES/0171-tests-Always-add-dummy-skipping-tests.patch
2021-09-09 20:12:48 +00:00

91 lines
2.5 KiB
Diff

From 3e3dcf39a5a1e1bf3419f1b31012ca16f28e361d Mon Sep 17 00:00:00 2001
From: Benjamin Berg <bberg@redhat.com>
Date: Wed, 8 Jan 2020 18:40:41 +0100
Subject: [PATCH 171/181] 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
--
2.24.1