tests/create-driver-test: Use argparse and allow to record only one case

This commit is contained in:
Marco Trevisan (Treviño)
2026-07-23 14:36:02 +02:00
parent 71cff7966e
commit c02d58a369
2 changed files with 33 additions and 30 deletions
+7 -4
View File
@@ -14,9 +14,9 @@ script, capture it and store the capture to `custom.pcapng`.
'capture' and 'custom' Test Creation
------------------------------------
For image devices the `capture.py` script will be used to capture one reference
image. If the driver is a non-image driver, then a `custom.py` script should be
created in advance, which will be run instead.
For image devices, use the `capture` test to capture one reference image. For
non-image drivers, create a `custom.py` script in advance and select the
`custom` test instead.
1. Make sure that libfprint is built with support for the device driver
that you want to create a test case for.
@@ -26,9 +26,12 @@ created in advance, which will be run instead.
but the hardware is slightly different, you might want to pass a variant
name as a command-line options, for example:
```sh
$ sudo tests/create-driver-test.py driver [variant]
$ sudo tests/create-driver-test.py [--test capture|custom] driver [variant]
```
By default, the tool runs `capture.py` and, when present, the test directory's
`custom.py`. Use `--test capture` or `--test custom` to record only that test.
3. If the capture is not successful, run the tool again to start another capture.
4. Add driver test name to `drivers_tests` in the `meson.build`, as instructed,