This allows us to filter things based on argv before setting up tests, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
}
END_TEST
-int main (int argc, char **argv)
+void
+litest_setup_tests(void)
{
struct range abs_range = { 0, ABS_MISC };
struct range abs_mt_range = { ABS_MT_SLOT + 1, ABS_CNT };
litest_add_no_device("device:invalid devices", abs_mt_device_missing_res);
litest_add("device:wheel", device_wheel_only, LITEST_WHEEL, LITEST_RELATIVE|LITEST_ABSOLUTE);
-
- return litest_run(argc, argv);
}
}
END_TEST
-int
-main(int argc, char **argv)
+void
+litest_setup_tests(void)
{
litest_add_no_device("keyboard:seat key count", keyboard_seat_key_count);
litest_add_no_device("keyboard:key counting", keyboard_ignore_no_pressed_release);
litest_add_no_device("keyboard:key counting", keyboard_key_auto_release);
litest_add("keyboard:keys", keyboard_has_key, LITEST_KEYS, LITEST_ANY);
litest_add("keyboard:keys", keyboard_keys_bad_device, LITEST_ANY, LITEST_ANY);
-
- return litest_run(argc, argv);
}
{ 0, 0, 0, 0}
};
-int
+static int
litest_run(int argc, char **argv)
{
struct suite *s, *snext;
litest_event(d, EV_SYN, SYN_REPORT, 0);
}
+
+int
+main(int argc, char **argv)
+{
+ litest_setup_tests();
+
+ return litest_run(argc, argv);
+}
void *func,
const struct range *range);
-int litest_run(int argc, char **argv);
+extern void litest_setup_tests(void);
struct litest_device * litest_create_device(enum litest_device_type which);
struct litest_device * litest_add_device(struct libinput *libinput,
enum litest_device_type which);
}
END_TEST
-int main (int argc, char **argv)
+void
+litest_setup_tests(void)
{
litest_add_no_device("log:defaults", log_default_priority);
litest_add_no_device("log:logging", log_handler_invoked);
litest_add_no_device("log:logging", log_handler_NULL);
litest_add_no_device("log:logging", log_priority);
-
- return litest_run(argc, argv);
}
}
END_TEST
-int main (int argc, char **argv)
+void
+litest_setup_tests(void)
{
litest_add_no_device("events:conversion", event_conversion_device_notify);
litest_add_for_device("events:conversion", event_conversion_pointer, LITEST_MOUSE);
litest_add_no_device("misc:dpi parser", dpi_parser);
litest_add_no_device("misc:wheel click parser", wheel_click_parser);
litest_add_no_device("misc:trackpoint accel parser", trackpoint_accel_parser);
-
- return litest_run(argc, argv);
}
}
END_TEST
-int
-main(int argc, char **argv)
+void
+litest_setup_tests(void)
{
litest_add_no_device("path:create", path_create_NULL);
litest_add_no_device("path:create", path_create_invalid);
litest_add_for_device("path:device events", path_remove_device, LITEST_SYNAPTICS_CLICKPAD);
litest_add_for_device("path:device events", path_double_remove_device, LITEST_SYNAPTICS_CLICKPAD);
litest_add_no_device("path:seat", path_seat_recycle);
-
- return litest_run(argc, argv);
}
}
END_TEST
-int main (int argc, char **argv)
+void
+litest_setup_tests(void)
{
litest_add("pointer:motion", pointer_motion_relative, LITEST_RELATIVE, LITEST_ANY);
litest_add("pointer:motion", pointer_motion_absolute, LITEST_ABSOLUTE, LITEST_ANY);
litest_add("pointer:middlebutton", middlebutton_default_clickpad, LITEST_CLICKPAD, LITEST_ANY);
litest_add("pointer:middlebutton", middlebutton_default_touchpad, LITEST_TOUCHPAD, LITEST_CLICKPAD);
litest_add("pointer:middlebutton", middlebutton_default_disabled, LITEST_ANY, LITEST_BUTTON);
-
- return litest_run(argc, argv);
}
}
END_TEST
-int
-main(int argc, char **argv)
+void
+litest_setup_tests(void)
{
litest_add("touch:frame", touch_frame_events, LITEST_TOUCH, LITEST_ANY);
litest_add_no_device("touch:abs-transform", touch_abs_transform);
litest_add("touch:protocol a", touch_protocol_a_init, LITEST_PROTOCOL_A, LITEST_ANY);
litest_add("touch:protocol a", touch_protocol_a_touch, LITEST_PROTOCOL_A, LITEST_ANY);
litest_add("touch:protocol a", touch_protocol_a_2fg_touch, LITEST_PROTOCOL_A, LITEST_ANY);
-
- return litest_run(argc, argv);
}
}
END_TEST
-int main(int argc, char **argv)
+void
+litest_setup_tests(void)
{
struct range multitap_range = {3, 8};
litest_add_for_device("touchpad:trackpoint", touchpad_trackpoint_buttons_softbuttons, LITEST_SYNAPTICS_TRACKPOINT_BUTTONS);
litest_add_for_device("touchpad:trackpoint", touchpad_trackpoint_buttons_2fg_scroll, LITEST_SYNAPTICS_TRACKPOINT_BUTTONS);
litest_add_for_device("touchpad:trackpoint", touchpad_trackpoint_no_trackpoint, LITEST_SYNAPTICS_TRACKPOINT_BUTTONS);
-
- return litest_run(argc, argv);
}
}
END_TEST
-int main(int argc, char **argv)
+void
+litest_setup_tests(void)
{
litest_add("trackpoint:middlebutton", trackpoint_middlebutton, LITEST_POINTINGSTICK, LITEST_ANY);
litest_add("trackpoint:middlebutton", trackpoint_middlebutton_noscroll, LITEST_POINTINGSTICK, LITEST_ANY);
litest_add("trackpoint:scroll", trackpoint_scroll, LITEST_POINTINGSTICK, LITEST_ANY);
litest_add("trackpoint:scroll", trackpoint_scroll_source, LITEST_POINTINGSTICK, LITEST_ANY);
-
- return litest_run(argc, argv);
}
}
END_TEST
-int
-main(int argc, char **argv)
+void
+litest_setup_tests(void)
{
litest_add_no_device("udev:create", udev_create_NULL);
litest_add_no_device("udev:create", udev_create_seat0);
litest_add_for_device("udev:suspend", udev_suspend_resume, LITEST_SYNAPTICS_CLICKPAD);
litest_add_for_device("udev:device events", udev_device_sysname, LITEST_SYNAPTICS_CLICKPAD);
litest_add_for_device("udev:seat", udev_seat_recycle, LITEST_SYNAPTICS_CLICKPAD);
-
- return litest_run(argc, argv);
}