Commit graph

5 commits

Author SHA1 Message Date
Peter Hutterer
11adaadd51 test: let the device custom create method return a bool
This is so we can tell litest to create the device anyway, useful for when all
we have to do in the custom create is allocate some memory.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-22 16:23:17 +10:00
Peter Hutterer
2346801b0e test: switch to a TEST_DEVICE macro for all the litest test devices
The test device initialization code was a bit of duplicated boilerplate and
required adding a reference to the devices to the 'devices' list in litest.c.
Automate this with a new TEST_DEVICE macro that adds the devices to a custom
section in the binary, then loops throught that section to get the device out.

This reduces the boilerplate for each test device to just the TEST_MACRO and
the LITEST_foo device enum entry. It also now automates the shortname of the
device.

The device's shortname was standardised in this approach as well, lowercase
and dashes only.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-21 15:06:17 +10:00
Peter Hutterer
4c4d400bcb test: fix the 'all codes' keyboard device
The ...create() method returned the wrong device, so this one was never
actually used. Once we start using, we get test case failures related to the
device having BTN_foo events as well. For now, just disable those codes so we
have a keyboard with all keys and pass the tests. The rest needs better
fixing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-21 13:39:46 +10:00
Peter Hutterer
5d2501aa7d Drop HAVE_CONFIG_H ifdef
We have one. Yay. Lucky us. Go forth and celebrate.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-12-01 11:06:54 +10:00
Peter Hutterer
fb5a97211b test: add a keyboard test device with all codes enabled
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-17 07:58:15 +10:00