From 01663c1fb50a15e42ce5a64d05fb7a1c8b714039 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 4 Dec 2020 16:40:18 +0100 Subject: [PATCH] tests: Allow multiple tests per driver Allow multiple tests per driver by using the first section of the directory name, before the separating '-', as the driver name. --- tests/README.md | 4 ++++ tests/meson.build | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/README.md b/tests/README.md index 88608a4..20fdf9f 100644 --- a/tests/README.md +++ b/tests/README.md @@ -20,6 +20,10 @@ A new 'capture' test is created by means of `capture.py` script: `mkdir DRIVER` + Note that the name must be the exact name of the libfprint driver, + or the exact name of the driver followed by a `-` and a unique identifier + of your choosing. + 2. Prepare your execution environment. In the next step a working and up to date libfprint is needed. This can be diff --git a/tests/meson.build b/tests/meson.build index bc6fe73..e64ef5e 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -83,10 +83,15 @@ if get_option('introspection') endforeach foreach driver_test: drivers_tests + if driver_test.contains('-') + driver_name = driver_test.split('-')[0] + else + driver_name = driver_test + endif driver_envs = envs - driver_envs.set('FP_DRIVERS_WHITELIST', driver_test) + driver_envs.set('FP_DRIVERS_WHITELIST', driver_name) - if (driver_test in supported_drivers and + if (driver_name in supported_drivers and gusb_dep.version().version_compare('>= 0.3.0')) test(driver_test, find_program('umockdev-test.py'),