Commit 2346801b authored by Peter Hutterer's avatar Peter Hutterer

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's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 5516e9ea
...@@ -631,17 +631,16 @@ if get_option('tests') ...@@ -631,17 +631,16 @@ if get_option('tests')
def_no_main, def_no_main,
def_disable_backtrace def_disable_backtrace
] ]
test_litest_selftest_sources = [ test_litest_selftest_sources = lib_litest_sources + [
'test/litest-selftest.c', 'test/litest-selftest.c',
'test/litest.c', 'test/litest.c',
'test/litest-int.h', 'test/litest-int.h',
'test/litest.h' 'test/litest.h'
] ]
deps_litest_selftest = [dep_litest]
test_litest_selftest = executable('test-litest-selftest', test_litest_selftest = executable('test-litest-selftest',
test_litest_selftest_sources, test_litest_selftest_sources,
include_directories : [includes_src, includes_include], include_directories : [includes_src, includes_include],
dependencies : deps_litest_selftest, dependencies : deps_litest,
c_args : defs_litest_selftest, c_args : defs_litest_selftest,
install : false) install : false)
test('test-litest-selftest', test_litest_selftest) test('test-litest-selftest', test_litest_selftest)
...@@ -651,7 +650,7 @@ if get_option('tests') ...@@ -651,7 +650,7 @@ if get_option('tests')
test_symbols_leak, test_symbols_leak,
args : [ meson.current_source_dir() ]) args : [ meson.current_source_dir() ])
libinput_test_runner_sources = [ libinput_test_runner_sources = lib_litest_sources + [
'src/libinput-util.h', 'src/libinput-util.h',
'src/libinput-util.c', 'src/libinput-util.c',
'test/test-udev.c', 'test/test-udev.c',
...@@ -676,7 +675,7 @@ if get_option('tests') ...@@ -676,7 +675,7 @@ if get_option('tests')
libinput_test_runner = executable('libinput-test-suite-runner', libinput_test_runner = executable('libinput-test-suite-runner',
libinput_test_runner_sources, libinput_test_runner_sources,
include_directories : [includes_src, includes_include], include_directories : [includes_src, includes_include],
dependencies : dep_litest, dependencies : deps_litest,
c_args : [ def_LT_VERSION ], c_args : [ def_LT_VERSION ],
install : false) install : false)
test('libinput-test-suite-runner', test('libinput-test-suite-runner',
......
...@@ -26,12 +26,6 @@ ...@@ -26,12 +26,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void litest_keyboard_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_ACER_HAWAII_KEYBOARD);
litest_set_current_device(d);
}
static struct input_id input_id = { static struct input_id input_id = {
.bustype = 0x3, .bustype = 0x3,
.vendor = 0x4f2, .vendor = 0x4f2,
...@@ -194,15 +188,13 @@ static int events[] = { ...@@ -194,15 +188,13 @@ static int events[] = {
-1, -1, -1, -1,
}; };
struct litest_test_device litest_acer_hawaii_keyboard_device = { TEST_DEVICE("hawaii-keyboard",
.type = LITEST_ACER_HAWAII_KEYBOARD, .type = LITEST_ACER_HAWAII_KEYBOARD,
.features = LITEST_KEYS, .features = LITEST_KEYS,
.shortname = "hawaii-keyboard",
.setup = litest_keyboard_setup,
.interface = NULL, .interface = NULL,
.name = "Chicony ACER Hawaii Keyboard", .name = "Chicony ACER Hawaii Keyboard",
.id = &input_id, .id = &input_id,
.events = events, .events = events,
.absinfo = NULL, .absinfo = NULL,
}; )
...@@ -26,13 +26,6 @@ ...@@ -26,13 +26,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void
litest_touchpad_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_ACER_HAWAII_TOUCHPAD);
litest_set_current_device(d);
}
static struct input_event down[] = { static struct input_event down[] = {
{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
...@@ -98,11 +91,9 @@ static const char udev_rule[] = ...@@ -98,11 +91,9 @@ static const char udev_rule[] =
"\n" "\n"
"LABEL=\"touchpad_end\""; "LABEL=\"touchpad_end\"";
struct litest_test_device litest_acer_hawaii_touchpad_device = { TEST_DEVICE("hawaii-touchpad",
.type = LITEST_ACER_HAWAII_TOUCHPAD, .type = LITEST_ACER_HAWAII_TOUCHPAD,
.features = LITEST_TOUCHPAD | LITEST_CLICKPAD | LITEST_BUTTON, .features = LITEST_TOUCHPAD | LITEST_CLICKPAD | LITEST_BUTTON,
.shortname = "hawaii-touchpad",
.setup = litest_touchpad_setup,
.interface = &interface, .interface = &interface,
.name = "Chicony ACER Hawaii Keyboard Touchpad", .name = "Chicony ACER Hawaii Keyboard Touchpad",
...@@ -110,4 +101,4 @@ struct litest_test_device litest_acer_hawaii_touchpad_device = { ...@@ -110,4 +101,4 @@ struct litest_test_device litest_acer_hawaii_touchpad_device = {
.events = events, .events = events,
.absinfo = absinfo, .absinfo = absinfo,
.udev_rule = udev_rule, .udev_rule = udev_rule,
}; )
...@@ -30,13 +30,6 @@ ...@@ -30,13 +30,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void
litest_alps_dualpoint_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_ALPS_DUALPOINT);
litest_set_current_device(d);
}
static struct input_event down[] = { static struct input_event down[] = {
{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
...@@ -120,11 +113,9 @@ static const char udev_rule[] = ...@@ -120,11 +113,9 @@ static const char udev_rule[] =
"\n" "\n"
"LABEL=\"touchpad_end\""; "LABEL=\"touchpad_end\"";
struct litest_test_device litest_alps_dualpoint_device = { TEST_DEVICE("alps-dualpoint",
.type = LITEST_ALPS_DUALPOINT, .type = LITEST_ALPS_DUALPOINT,
.features = LITEST_TOUCHPAD | LITEST_BUTTON | LITEST_SEMI_MT, .features = LITEST_TOUCHPAD | LITEST_BUTTON | LITEST_SEMI_MT,
.shortname = "alps dualpoint",
.setup = litest_alps_dualpoint_setup,
.interface = &interface, .interface = &interface,
.name = "AlpsPS/2 ALPS DualPoint TouchPad", .name = "AlpsPS/2 ALPS DualPoint TouchPad",
...@@ -132,4 +123,4 @@ struct litest_test_device litest_alps_dualpoint_device = { ...@@ -132,4 +123,4 @@ struct litest_test_device litest_alps_dualpoint_device = {
.events = events, .events = events,
.absinfo = absinfo, .absinfo = absinfo,
.udev_rule = udev_rule, .udev_rule = udev_rule,
}; )
...@@ -30,13 +30,6 @@ ...@@ -30,13 +30,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void
litest_alps_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_ALPS_SEMI_MT);
litest_set_current_device(d);
}
static struct input_event down[] = { static struct input_event down[] = {
{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
...@@ -110,15 +103,13 @@ static struct input_absinfo absinfo[] = { ...@@ -110,15 +103,13 @@ static struct input_absinfo absinfo[] = {
{ .value = -1 } { .value = -1 }
}; };
struct litest_test_device litest_alps_device = { TEST_DEVICE("alps-semi-mt",
.type = LITEST_ALPS_SEMI_MT, .type = LITEST_ALPS_SEMI_MT,
.features = LITEST_TOUCHPAD | LITEST_BUTTON | LITEST_SEMI_MT, .features = LITEST_TOUCHPAD | LITEST_BUTTON | LITEST_SEMI_MT,
.shortname = "alps semi-mt",
.setup = litest_alps_setup,
.interface = &interface, .interface = &interface,
.name = "AlpsPS/2 ALPS GlidePoint", .name = "AlpsPS/2 ALPS GlidePoint",
.id = &input_id, .id = &input_id,
.events = events, .events = events,
.absinfo = absinfo, .absinfo = absinfo,
}; )
...@@ -30,12 +30,6 @@ ...@@ -30,12 +30,6 @@
* This is the keyboard device for this mouse. * This is the keyboard device for this mouse.
*/ */
static void litest_anker_mouse_kbd_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_ANKER_MOUSE_KBD);
litest_set_current_device(d);
}
static struct input_id input_id = { static struct input_id input_id = {
.bustype = 0x3, .bustype = 0x3,
.vendor = 0x4d9, .vendor = 0x4d9,
...@@ -209,15 +203,13 @@ static struct input_absinfo absinfo[] = { ...@@ -209,15 +203,13 @@ static struct input_absinfo absinfo[] = {
{ .value = -1 }, { .value = -1 },
}; };
struct litest_test_device litest_anker_mouse_kbd_device = { TEST_DEVICE("anker-kbd",
.type = LITEST_ANKER_MOUSE_KBD, .type = LITEST_ANKER_MOUSE_KBD,
.features = LITEST_KEYS | LITEST_WHEEL, .features = LITEST_KEYS | LITEST_WHEEL,
.shortname = "anker_kbd",
.setup = litest_anker_mouse_kbd_setup,
.interface = NULL, .interface = NULL,
.name = "USB Laser Game Mouse", .name = "USB Laser Game Mouse",
.id = &input_id, .id = &input_id,
.absinfo = absinfo, .absinfo = absinfo,
.events = events, .events = events,
}; )
...@@ -26,13 +26,6 @@ ...@@ -26,13 +26,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void
litest_appletouch_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_APPLETOUCH);
litest_set_current_device(d);
}
static struct input_event down[] = { static struct input_event down[] = {
{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
...@@ -100,11 +93,9 @@ static const char udev_rule[] = ...@@ -100,11 +93,9 @@ static const char udev_rule[] =
"\n" "\n"
"LABEL=\"touchpad_end\""; "LABEL=\"touchpad_end\"";
struct litest_test_device litest_appletouch_device = { TEST_DEVICE("appletouch",
.type = LITEST_APPLETOUCH, .type = LITEST_APPLETOUCH,
.features = LITEST_TOUCHPAD | LITEST_BUTTON | LITEST_SINGLE_TOUCH, .features = LITEST_TOUCHPAD | LITEST_BUTTON | LITEST_SINGLE_TOUCH,
.shortname = "appletouch",
.setup = litest_appletouch_setup,
.interface = &interface, .interface = &interface,
.name = "appletouch", .name = "appletouch",
...@@ -112,4 +103,4 @@ struct litest_test_device litest_appletouch_device = { ...@@ -112,4 +103,4 @@ struct litest_test_device litest_appletouch_device = {
.events = events, .events = events,
.absinfo = absinfo, .absinfo = absinfo,
.udev_rule = udev_rule, .udev_rule = udev_rule,
}; )
...@@ -26,12 +26,6 @@ ...@@ -26,12 +26,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void litest_apple_keyboard_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_APPLE_KEYBOARD);
litest_set_current_device(d);
}
static struct input_id input_id = { static struct input_id input_id = {
.bustype = 0x3, .bustype = 0x3,
.vendor = 0x5ac, .vendor = 0x5ac,
...@@ -223,15 +217,13 @@ static int events[] = { ...@@ -223,15 +217,13 @@ static int events[] = {
-1, -1 -1, -1
}; };
struct litest_test_device litest_apple_keyboard_device = { TEST_DEVICE("apple-keyboard",
.type = LITEST_APPLE_KEYBOARD, .type = LITEST_APPLE_KEYBOARD,
.features = LITEST_KEYS, .features = LITEST_KEYS,
.shortname = "apple_keyboard",
.setup = litest_apple_keyboard_setup,
.interface = NULL, .interface = NULL,
.name = "Apple Inc. Apple Internal Keyboard / Trackpad", .name = "Apple Inc. Apple Internal Keyboard / Trackpad",
.id = &input_id, .id = &input_id,
.events = events, .events = events,
.absinfo = NULL, .absinfo = NULL,
}; )
...@@ -26,12 +26,6 @@ ...@@ -26,12 +26,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void litest_magicmouse_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_MAGICMOUSE);
litest_set_current_device(d);
}
static struct input_event down[] = { static struct input_event down[] = {
{ .type = EV_ABS, .code = ABS_MT_SLOT, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_MT_SLOT, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_MT_TRACKING_ID, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_MT_TRACKING_ID, .value = LITEST_AUTO_ASSIGN },
...@@ -106,11 +100,9 @@ static const char udev_rule[] = ...@@ -106,11 +100,9 @@ static const char udev_rule[] =
"\n" "\n"
"LABEL=\"mouse_end\""; "LABEL=\"mouse_end\"";
struct litest_test_device litest_magicmouse_device = { TEST_DEVICE("litest-magicmouse-device",
.type = LITEST_MAGICMOUSE, .type = LITEST_MAGICMOUSE,
.features = LITEST_RELATIVE | LITEST_BUTTON | LITEST_WHEEL, .features = LITEST_RELATIVE | LITEST_BUTTON | LITEST_WHEEL,
.shortname = "magicmouse",
.setup = litest_magicmouse_setup,
.interface = &interface, .interface = &interface,
.name = "Apple Magic Mouse", .name = "Apple Magic Mouse",
...@@ -118,4 +110,4 @@ struct litest_test_device litest_magicmouse_device = { ...@@ -118,4 +110,4 @@ struct litest_test_device litest_magicmouse_device = {
.events = events, .events = events,
.absinfo = absinfo, .absinfo = absinfo,
.udev_rule = udev_rule, .udev_rule = udev_rule,
}; )
...@@ -29,12 +29,6 @@ ...@@ -29,12 +29,6 @@
/* Note: this is the second event node of this mouse only, the first event /* Note: this is the second event node of this mouse only, the first event
* node is just a normal mouse */ * node is just a normal mouse */
static void litest_mouse_gladius_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_MOUSE_GLADIUS);
litest_set_current_device(d);
}
static struct input_id input_id = { static struct input_id input_id = {
.bustype = 0x3, .bustype = 0x3,
.vendor = 0x0b05, .vendor = 0x0b05,
...@@ -318,15 +312,13 @@ static struct input_absinfo absinfo[] = { ...@@ -318,15 +312,13 @@ static struct input_absinfo absinfo[] = {
{ .value = -1 } { .value = -1 }
}; };
struct litest_test_device litest_mouse_gladius_device = { TEST_DEVICE("mouse-gladius",
.type = LITEST_MOUSE_GLADIUS, .type = LITEST_MOUSE_GLADIUS,
.features = LITEST_RELATIVE | LITEST_WHEEL | LITEST_KEYS, .features = LITEST_RELATIVE | LITEST_WHEEL | LITEST_KEYS,
.shortname = "mouse_gladius",
.setup = litest_mouse_gladius_setup,
.interface = NULL, .interface = NULL,
.name = "ASUS ROG GLADIUS", .name = "ASUS ROG GLADIUS",
.id = &input_id, .id = &input_id,
.absinfo = absinfo, .absinfo = absinfo,
.events = events, .events = events,
}; )
...@@ -30,13 +30,6 @@ ...@@ -30,13 +30,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void
litest_atmel_hover_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_ATMEL_HOVER);
litest_set_current_device(d);
}
static struct input_event down[] = { static struct input_event down[] = {
{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
...@@ -128,15 +121,13 @@ static struct input_absinfo absinfo[] = { ...@@ -128,15 +121,13 @@ static struct input_absinfo absinfo[] = {
{ .value = -1 } { .value = -1 }
}; };
struct litest_test_device litest_atmel_hover_device = { TEST_DEVICE("atmel-hover",
.type = LITEST_ATMEL_HOVER, .type = LITEST_ATMEL_HOVER,
.features = LITEST_TOUCHPAD | LITEST_BUTTON | LITEST_CLICKPAD | LITEST_HOVER, .features = LITEST_TOUCHPAD | LITEST_BUTTON | LITEST_CLICKPAD | LITEST_HOVER,
.shortname = "atmel hover",
.setup = litest_atmel_hover_setup,
.interface = &interface, .interface = &interface,
.name = "Atmel maXTouch Touchpad", .name = "Atmel maXTouch Touchpad",
.id = &input_id, .id = &input_id,
.events = events, .events = events,
.absinfo = absinfo, .absinfo = absinfo,
}; )
...@@ -26,12 +26,6 @@ ...@@ -26,12 +26,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void litest_bcm5974_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_BCM5974);
litest_set_current_device(d);
}
static struct input_event down[] = { static struct input_event down[] = {
{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
...@@ -121,16 +115,14 @@ static int events[] = { ...@@ -121,16 +115,14 @@ static int events[] = {
-1, -1 -1, -1
}; };
struct litest_test_device litest_bcm5974_device = { TEST_DEVICE("bcm5974",
.type = LITEST_BCM5974, .type = LITEST_BCM5974,
.features = LITEST_TOUCHPAD | LITEST_CLICKPAD | .features = LITEST_TOUCHPAD | LITEST_CLICKPAD |
LITEST_BUTTON | LITEST_APPLE_CLICKPAD, LITEST_BUTTON | LITEST_APPLE_CLICKPAD,
.shortname = "bcm5974",
.setup = litest_bcm5974_setup,
.interface = &interface, .interface = &interface,
.name = "bcm5974", .name = "bcm5974",
.id = &input_id, .id = &input_id,
.events = events, .events = events,
.absinfo = absinfo, .absinfo = absinfo,
}; )
...@@ -26,13 +26,6 @@ ...@@ -26,13 +26,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void litest_calibrated_touchscreen_setup(void)
{
struct litest_device *d =
litest_create_device(LITEST_CALIBRATED_TOUCHSCREEN);
litest_set_current_device(d);
}
static struct input_event down[] = { static struct input_event down[] = {
{ .type = EV_ABS, .code = ABS_MT_SLOT, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_MT_SLOT, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_MT_TRACKING_ID, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_MT_TRACKING_ID, .value = LITEST_AUTO_ASSIGN },
...@@ -87,11 +80,9 @@ static const char udev_rule[] = ...@@ -87,11 +80,9 @@ static const char udev_rule[] =
"\n" "\n"
"LABEL=\"calibrated_touchscreen_end\""; "LABEL=\"calibrated_touchscreen_end\"";
struct litest_test_device litest_calibrated_touchscreen_device = { TEST_DEVICE("calibrated-touchscreen",
.type = LITEST_CALIBRATED_TOUCHSCREEN, .type = LITEST_CALIBRATED_TOUCHSCREEN,
.features = LITEST_TOUCH, .features = LITEST_TOUCH,
.shortname = "calibrated-touchscreen",
.setup = litest_calibrated_touchscreen_setup,
.interface = &interface, .interface = &interface,
.name = "Calibrated Touchscreen", .name = "Calibrated Touchscreen",
...@@ -99,4 +90,4 @@ struct litest_test_device litest_calibrated_touchscreen_device = { ...@@ -99,4 +90,4 @@ struct litest_test_device litest_calibrated_touchscreen_device = {
.events = events, .events = events,
.absinfo = absinfo, .absinfo = absinfo,
.udev_rule = udev_rule, .udev_rule = udev_rule,
}; )
...@@ -26,12 +26,6 @@ ...@@ -26,12 +26,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void litest_cyborg_rat_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_CYBORG_RAT);
litest_set_current_device(d);
}
static struct input_id input_id = { static struct input_id input_id = {
.bustype = 0x3, .bustype = 0x3,
.vendor = 0x6a3, .vendor = 0x6a3,
...@@ -55,15 +49,13 @@ static int events[] = { ...@@ -55,15 +49,13 @@ static int events[] = {
-1 , -1, -1 , -1,
}; };
struct litest_test_device litest_cyborg_rat_device = { TEST_DEVICE("cyborg-rat",
.type = LITEST_CYBORG_RAT, .type = LITEST_CYBORG_RAT,
.features = LITEST_RELATIVE | LITEST_BUTTON | LITEST_WHEEL, .features = LITEST_RELATIVE | LITEST_BUTTON | LITEST_WHEEL,
.shortname = "cyborg_rat",
.setup = litest_cyborg_rat_setup,
.interface = NULL, .interface = NULL,
.name = "Saitek Cyborg R.A.T.5 Mouse", .name = "Saitek Cyborg R.A.T.5 Mouse",
.id = &input_id, .id = &input_id,
.absinfo = NULL, .absinfo = NULL,
.events = events, .events = events,
}; )
...@@ -26,13 +26,6 @@ ...@@ -26,13 +26,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void
litest_elantech_touchpad_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_ELANTECH_TOUCHPAD);
litest_set_current_device(d);
}
static struct input_event down[] = { static struct input_event down[] = {
{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
...@@ -105,15 +98,13 @@ static struct input_absinfo absinfo[] = { ...@@ -105,15 +98,13 @@ static struct input_absinfo absinfo[] = {
{ .value = -1 } { .value = -1 }
}; };
struct litest_test_device litest_elantech_touchpad_device = { TEST_DEVICE("elantech",
.type = LITEST_ELANTECH_TOUCHPAD, .type = LITEST_ELANTECH_TOUCHPAD,
.features = LITEST_TOUCHPAD | LITEST_BUTTON, .features = LITEST_TOUCHPAD | LITEST_BUTTON,
.shortname = "elantech",
.setup = litest_elantech_touchpad_setup,
.interface = &interface, .interface = &interface,
.name = "ETPS/2 Elantech Touchpad", .name = "ETPS/2 Elantech Touchpad",
.id = &input_id, .id = &input_id,
.events = events, .events = events,
.absinfo = absinfo, .absinfo = absinfo,
}; )
...@@ -26,13 +26,6 @@ ...@@ -26,13 +26,6 @@
#include "litest.h" #include "litest.h"
#include "litest-int.h" #include "litest-int.h"
static void
litest_generic_singletouch_touch_setup(void)
{
struct litest_device *d = litest_create_device(LITEST_GENERIC_SINGLETOUCH);
litest_set_current_device(d);
}
static struct input_event down[] = {