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:
Marco Trevisan (Treviño)
2020-12-04 02:08:59 +01:00
parent 7b0df77c49
commit 80cf417b30
4 changed files with 37 additions and 10 deletions
+27 -9
View File
@@ -196,11 +196,10 @@ endif
if get_option('tod') if get_option('tod')
tod_envs = envs 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_TOD_KEEP_MODULES_OPEN', 'TRUE')
tod_envs.set('FP_VIRTUAL_FAKE_DEVICE', 'yes') 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.set('FP_TOD_TEST_DRIVER_NAME', 'fake_test_dev_tod')
tod_envs.prepend('LD_LIBRARY_PATH', meson.build_root() / 'libfprint/tod')
tod_c_args = [ tod_c_args = [
'-DTEST_TOD_DRIVER=1', '-DTEST_TOD_DRIVER=1',
] ]
@@ -233,6 +232,17 @@ if get_option('tod')
'fpi-device', '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 foreach test_name: tod_unit_tests
basename = 'test-' + test_name basename = 'test-' + test_name
sufix = test_name.endswith('-tod') ? '' : '-tod' sufix = test_name.endswith('-tod') ? '' : '-tod'
@@ -246,12 +256,20 @@ if get_option('tod')
], ],
link_with: test_utils_tod, link_with: test_utils_tod,
) )
test(test_name,
find_program('test-runner.sh'), foreach tod_driver, tod_dir : tod_dirs
suite: ['unit-tests', 'tod'], tod_test_envs = tod_envs
args: [test_exe], tod_test_envs.prepend('FP_DRIVERS_WHITELIST', tod_driver)
env: tod_envs, tod_test_envs.set('FP_TOD_DRIVERS_DIR', tod_dir)
depends: fake_driver, 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 endforeach
endif endif
+1 -1
View File
@@ -19,7 +19,7 @@
*/ */
#ifdef TEST_TOD_DRIVER #ifdef TEST_TOD_DRIVER
#define FP_COMPONENT "fake_test_dev_tod" #define FP_COMPONENT "fake_test_dev_tod_current"
#else #else
#define FP_COMPONENT "fake_test_dev" #define FP_COMPONENT "fake_test_dev"
#endif #endif
+9
View File
@@ -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.
Binary file not shown.