test: allow partial overriding the test devices
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 31 Mar 2014 04:54:46 +0000 (14:54 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 8 Apr 2014 05:07:02 +0000 (15:07 +1000)
commita9a24c33e7f8df0398605284508c57333046a09d
tree351bafbab6990dd56d5611a6f3fbc5b0c16c50de
parenta242d689891b18abf29d8a6a83d10a7f3fe3d01b
test: allow partial overriding the test devices

For specific tests we need something that e.g. looks like a touchpad, but has
a different name, a different number of slots, etc. In this case, the
following code will do exactly that:

struct input_absinfo overrides[] = {
 { .value = ABS_MT_SLOT, .minimum = 0, .maximum = 100 },
 { .value = -1 },
};

litest_create_device_with_overrides(LITEST_SYNAPTICS_CLICKPAD,
    NULL, NULL, &overrides, NULL);

For general event codes, overrides can only add to the set of events, they
can't remove.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
test/litest.c
test/litest.h