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>
Showing
- meson.build 4 additions, 5 deletionsmeson.build
- test/litest-device-acer-hawaii-keyboard.c 2 additions, 10 deletionstest/litest-device-acer-hawaii-keyboard.c
- test/litest-device-acer-hawaii-touchpad.c 2 additions, 11 deletionstest/litest-device-acer-hawaii-touchpad.c
- test/litest-device-alps-dualpoint.c 2 additions, 11 deletionstest/litest-device-alps-dualpoint.c
- test/litest-device-alps-semi-mt.c 2 additions, 11 deletionstest/litest-device-alps-semi-mt.c
- test/litest-device-anker-mouse-kbd.c 2 additions, 10 deletionstest/litest-device-anker-mouse-kbd.c
- test/litest-device-apple-appletouch.c 2 additions, 11 deletionstest/litest-device-apple-appletouch.c
- test/litest-device-apple-internal-keyboard.c 2 additions, 10 deletionstest/litest-device-apple-internal-keyboard.c
- test/litest-device-apple-magicmouse.c 2 additions, 10 deletionstest/litest-device-apple-magicmouse.c
- test/litest-device-asus-rog-gladius.c 2 additions, 10 deletionstest/litest-device-asus-rog-gladius.c
- test/litest-device-atmel-hover.c 2 additions, 11 deletionstest/litest-device-atmel-hover.c
- test/litest-device-bcm5974.c 2 additions, 10 deletionstest/litest-device-bcm5974.c
- test/litest-device-calibrated-touchscreen.c 2 additions, 11 deletionstest/litest-device-calibrated-touchscreen.c
- test/litest-device-cyborg-rat-5.c 2 additions, 10 deletionstest/litest-device-cyborg-rat-5.c
- test/litest-device-elantech-touchpad.c 2 additions, 11 deletionstest/litest-device-elantech-touchpad.c
- test/litest-device-generic-singletouch.c 2 additions, 11 deletionstest/litest-device-generic-singletouch.c
- test/litest-device-gpio-keys.c 2 additions, 11 deletionstest/litest-device-gpio-keys.c
- test/litest-device-huion-pentablet.c 2 additions, 10 deletionstest/litest-device-huion-pentablet.c
- test/litest-device-ignored-mouse.c 2 additions, 10 deletionstest/litest-device-ignored-mouse.c
- test/litest-device-keyboard-all-codes.c 7 additions, 13 deletionstest/litest-device-keyboard-all-codes.c
Loading
Please register or sign in to comment