mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
tests: Add testing to the synaptics driver
As the driver is not a normal image device, we need to add a custom script to test it. Note that the ioctl dump must also be manually modified unfortunately as the state is tracked incorrectly for the device by umockdev-record.
This commit is contained in:
@@ -56,10 +56,25 @@ def capture():
|
||||
# Compare the images, they need to be identical
|
||||
cmp_pngs(os.path.join(tmpdir, "capture.png"), os.path.join(ddir, "capture.png"))
|
||||
|
||||
def custom():
|
||||
ioctl = os.path.join(ddir, "custom.ioctl")
|
||||
device = os.path.join(ddir, "device")
|
||||
dev = open(ioctl).readline().strip()
|
||||
assert dev.startswith('@DEV ')
|
||||
dev = dev[5:]
|
||||
|
||||
subprocess.check_call(['umockdev-run', '-d', device,
|
||||
'-i', "%s=%s" % (dev, ioctl),
|
||||
'--',
|
||||
'%s' % os.path.join(ddir, "custom.py")])
|
||||
|
||||
try:
|
||||
if os.path.exists(os.path.join(ddir, "capture.ioctl")):
|
||||
capture()
|
||||
|
||||
if os.path.exists(os.path.join(ddir, "custom.ioctl")):
|
||||
custom()
|
||||
|
||||
finally:
|
||||
shutil.rmtree(tmpdir)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user