#include "litest.h"
#include "litest-int.h"
#include "libinput-util.h"
+#include "quirks.h"
#include <linux/kd.h>
const char *filter_test = NULL;
const char *filter_device = NULL;
const char *filter_group = NULL;
+static struct quirks_context *quirks_context;
struct created_file {
struct list link;
}
}
+LIBINPUT_ATTRIBUTE_PRINTF(3, 0)
+static inline void
+quirk_log_handler(struct libinput *unused,
+ enum libinput_log_priority priority,
+ const char *format,
+ va_list args)
+{
+ if (priority < LIBINPUT_LOG_PRIORITY_ERROR)
+ return;
+
+ vfprintf(stderr, format, args);
+}
+
static int
litest_run_suite(struct list *tests, int which, int max, int error_fd)
{
struct name *n, *tmp;
struct list testnames;
+ quirks_context = quirks_init_subsystem(getenv("LIBINPUT_DATA_DIR"),
+ NULL,
+ quirk_log_handler,
+ NULL,
+ QLOG_LIBINPUT_LOGGING);
+
/* Check just takes the suite/test name pointers but doesn't strdup
* them - we have to keep them around */
list_init(&testnames);
free(n);
}
+ quirks_context_unref(quirks_context);
+
return failed;
}
d->libinput = libinput;
d->libinput_device = libinput_path_add_device(d->libinput, path);
+ d->quirks = quirks_fetch_for_device(quirks_context,
+ libinput_device_get_udev_device(d->libinput_device));
+
litest_assert(d->libinput_device != NULL);
libinput_device_ref(d->libinput_device);
litest_assert_int_eq(d->skip_ev_syn, 0);
+ quirks_unref(d->quirks);
+
if (d->libinput_device) {
libinput_path_remove_device(d->libinput_device);
libinput_device_unref(d->libinput_device);