mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-06-11 02:28:05 +00:00
tests: Check if loading a pre-built binary keep working with libfprint
The libfprint tod fake library is built using using libtod v1.90.1+tod1 and we need to ensure that it will continue working until we won't change ABI/API.
This commit is contained in:
+27
-9
@@ -196,11 +196,10 @@ endif
|
||||
|
||||
if get_option('tod')
|
||||
tod_envs = envs
|
||||
tod_envs.set('FP_TOD_DRIVERS_DIR', meson.current_build_dir())
|
||||
tod_envs.set('FP_TOD_KEEP_MODULES_OPEN', 'TRUE')
|
||||
tod_envs.set('FP_VIRTUAL_FAKE_DEVICE', 'yes')
|
||||
tod_envs.append('FP_DRIVERS_WHITELIST', 'fake_test_dev_tod')
|
||||
tod_envs.set('FP_TOD_TEST_DRIVER_NAME', 'fake_test_dev_tod')
|
||||
tod_envs.prepend('LD_LIBRARY_PATH', meson.build_root() / 'libfprint/tod')
|
||||
tod_c_args = [
|
||||
'-DTEST_TOD_DRIVER=1',
|
||||
]
|
||||
@@ -233,6 +232,17 @@ if get_option('tod')
|
||||
'fpi-device',
|
||||
]
|
||||
|
||||
tod_dirs = {
|
||||
'fake_test_dev_tod_current': meson.current_build_dir(),
|
||||
}
|
||||
|
||||
machine = run_command(meson.get_compiler('c'), '-dumpmachine').stdout().strip()
|
||||
if machine.startswith('x86_64-')
|
||||
tod_dirs += {
|
||||
'fake_test_dev_tod_v1': meson.current_source_dir() / 'tod-drivers',
|
||||
}
|
||||
endif
|
||||
|
||||
foreach test_name: tod_unit_tests
|
||||
basename = 'test-' + test_name
|
||||
sufix = test_name.endswith('-tod') ? '' : '-tod'
|
||||
@@ -246,12 +256,20 @@ if get_option('tod')
|
||||
],
|
||||
link_with: test_utils_tod,
|
||||
)
|
||||
test(test_name,
|
||||
find_program('test-runner.sh'),
|
||||
suite: ['unit-tests', 'tod'],
|
||||
args: [test_exe],
|
||||
env: tod_envs,
|
||||
depends: fake_driver,
|
||||
)
|
||||
|
||||
foreach tod_driver, tod_dir : tod_dirs
|
||||
tod_test_envs = tod_envs
|
||||
tod_test_envs.prepend('FP_DRIVERS_WHITELIST', tod_driver)
|
||||
tod_test_envs.set('FP_TOD_DRIVERS_DIR', tod_dir)
|
||||
tod_test_envs.set('FP_TOD_TEST_DRIVER_NAME', tod_driver)
|
||||
|
||||
test(test_name + '-' + tod_driver,
|
||||
find_program('test-runner.sh'),
|
||||
suite: ['unit-tests', 'tod', tod_driver],
|
||||
args: [test_exe],
|
||||
env: tod_test_envs,
|
||||
depends: fake_driver,
|
||||
)
|
||||
endforeach
|
||||
endforeach
|
||||
endif
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#ifdef TEST_TOD_DRIVER
|
||||
#define FP_COMPONENT "fake_test_dev_tod"
|
||||
#define FP_COMPONENT "fake_test_dev_tod_current"
|
||||
#else
|
||||
#define FP_COMPONENT "fake_test_dev"
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# TOD drivers to use for testing
|
||||
|
||||
This directory is used by the test-suite to load and verify pre-built drivers.
|
||||
|
||||
For main testing this directory should contain the "fake_test_dev" driver (AKA
|
||||
test-device-fake) built using the minimum libfprint TOD we want to support.
|
||||
|
||||
In this way the library is loaded during tests and tested for all the upstream
|
||||
tests and particularly test-fpi-device.
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user