Peter Hutterer [Sun, 13 Oct 2024 23:24:26 +0000 (09:24 +1000)]
test: filter out duplicate name/device combos in --list
This doesn't have an effect yet because ranged tests are handled inside
check. But in the future these tests will be split up individually so
de-duplicating is useful here.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>
Peter Hutterer [Sat, 12 Oct 2024 00:35:29 +0000 (10:35 +1000)]
test: make litest_backtrace() available from outside litest.c
Prep-work for adding a new runner
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>
Peter Hutterer [Thu, 17 Oct 2024 01:45:22 +0000 (11:45 +1000)]
test: append, not insert the suites
list_append() came later than list_insert() and there's an argument to
be made that tests added later should be run first since they're less
likely to succeed. But it's a lot harder to read test logs when they are
in reverse order, and with the TEST_COLLECTION() macro the order of the
test suite is not obvious anyway.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>
Peter Hutterer [Mon, 21 Oct 2024 01:07:34 +0000 (11:07 +1000)]
util: add a bunch more time conversions
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>
Peter Hutterer [Mon, 21 Oct 2024 01:07:14 +0000 (11:07 +1000)]
util: move libinput_now() into a utility function
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>
Peter Hutterer [Tue, 15 Oct 2024 01:52:12 +0000 (11:52 +1000)]
util: add xclose(fd) to close-and-reset an fd
This prevents accidentally leaving the fd set after closing.
And it includes the -1 check so we don't need this everywhere ourselves
(not that we use it right now but valgrind likes to complain about
this).
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>
Peter Hutterer [Tue, 29 Oct 2024 03:25:20 +0000 (13:25 +1000)]
pre-commit: drop black, use ruff-format instead
And switch to the current-ish version of the ruff pre-commit hook,
including updating the repo.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1072>
Peter Hutterer [Tue, 29 Oct 2024 03:26:57 +0000 (13:26 +1000)]
tools: change direct type check to isinstance
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1072>
Peter Hutterer [Wed, 19 Jun 2024 23:50:15 +0000 (09:50 +1000)]
util: make a float to int conversion explicit
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1071>
Peter Hutterer [Sun, 20 Oct 2024 23:16:04 +0000 (09:16 +1000)]
util: add the backtrace printing function as separate util
Might as well make this easier to re-use since it doesn't do anything
specific to litest.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1066>
Peter Hutterer [Tue, 22 Oct 2024 05:03:09 +0000 (15:03 +1000)]
pad: default a pad group to mode 0 if all LEDs are off
Since our API doesn't accomodate for "dunno" we need to pick a mode that
we are actually in. This happens on the Intuos Pro 2 (PTH-660) which has
all LEDs on brightness zero, resulting in a failure to set up the modes
and we're left without a mode button.
Fix it by just picking zero as the default mode until specified
otherwise.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1069>
Peter Hutterer [Tue, 22 Oct 2024 03:34:46 +0000 (13:34 +1000)]
pad: move a function to save on an ifdef
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1069>
Peter Hutterer [Tue, 22 Oct 2024 02:15:04 +0000 (12:15 +1000)]
pad: don't print a clobbered errno
is_litest_device() may change errno since it calls into libudev.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1069>
Peter Hutterer [Tue, 22 Oct 2024 01:55:09 +0000 (11:55 +1000)]
tools: print full pad mode group info in libinput-list-devices
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1068>
Peter Hutterer [Tue, 22 Oct 2024 01:54:45 +0000 (11:54 +1000)]
tools: add rel dial support to libinput-list-devices
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1068>
Peter Hutterer [Thu, 17 Oct 2024 23:42:11 +0000 (09:42 +1000)]
test: split the touchpad tests into a palm and a dwt test collection
dwt and palm tests have a lot of timeouts to wait for so let's split
those out.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
Peter Hutterer [Thu, 17 Oct 2024 23:30:12 +0000 (09:30 +1000)]
test: split the tablet left-handed tests out into a separate collection
These aren't complicated but there's a lot of them so let's run them
separately to make the overall tablet test shorter.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
Peter Hutterer [Thu, 17 Oct 2024 22:56:38 +0000 (08:56 +1000)]
CI: move the "device" test suite to the "misc" set of suites
That one is still with the gestures but only takes 1-2 minutes, the
gestures takes 13 minutes. Let's move it to misc which currently has an
overall runtime of only 2 min anyway.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
Peter Hutterer [Thu, 17 Oct 2024 09:35:16 +0000 (19:35 +1000)]
test: split out the touchpad tap tests into multiple collections
These take a long time and have a reasonable high chance of failure due
to the timing constraints. Let's split them up so they don't hog the
runners for that long and in case they fail, we only need to re-run a
short test.
Before: one test running approx 21 min, now 3 tests running approx 7 +
11 + 4 min.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
Peter Hutterer [Thu, 17 Oct 2024 09:34:11 +0000 (19:34 +1000)]
meson: break out the test suites into manual list
If we start having multiple TEST_COLLECTION() in the same file we can
no longer use the file name - so a manually maintained list it is.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
Peter Hutterer [Thu, 17 Oct 2024 09:25:39 +0000 (19:25 +1000)]
test: make the TEST_COLLECTION() macro re-usable in the same file
Concat the line number to the generated variable names, this way we can
have more than one TEST_COLLECTION() in the same file.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
Peter Hutterer [Thu, 17 Oct 2024 09:55:25 +0000 (19:55 +1000)]
test: detach the suite handling from the file names
Instead of extracting the suite name from the test's file name use the
current suite that is being parsed. This way we pave the way for
multiple suites in the same file.
This uses a global because otherwise we'd have to redo all the
litest_add() functions but it does the job here.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
Peter Hutterer [Thu, 17 Oct 2024 10:30:08 +0000 (20:30 +1000)]
test: match the tablet's pad test collection with the file name
This is currently a requirement, so let's match this before we run
into issues here re-structuring stuff.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1065>
Peter Hutterer [Thu, 17 Oct 2024 22:38:47 +0000 (08:38 +1000)]
tablet: fix a memory leak caused by an early return
Previously we'd return early, failing to libwacom_destroy() the device.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1064>
Peter Hutterer [Thu, 17 Oct 2024 03:57:19 +0000 (13:57 +1000)]
CI: set the LITEST_JOBS in the template, not the script
Fixes: 70c57e964450 ("CI: drop the job count for the valgrind test suite to 2")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1063>
Peter Hutterer [Wed, 16 Oct 2024 01:27:27 +0000 (11:27 +1000)]
test: use a litest helper instead of return code comparison
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
Peter Hutterer [Wed, 16 Oct 2024 01:26:15 +0000 (11:26 +1000)]
test: rename a variable to indicate suites, not tests
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
Peter Hutterer [Wed, 16 Oct 2024 01:24:15 +0000 (11:24 +1000)]
test: rename all_tests to all_test_suites
This is a a list of struct suite with the various tests inside that
suite.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
Peter Hutterer [Wed, 16 Oct 2024 01:14:11 +0000 (11:14 +1000)]
test: check for verbosity immediately in main()
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
Peter Hutterer [Wed, 16 Oct 2024 01:12:42 +0000 (11:12 +1000)]
test: check for empty tests immediately, not later when we're running
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
Peter Hutterer [Wed, 16 Oct 2024 01:10:18 +0000 (11:10 +1000)]
test: init the global devices/test lists immediately
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
Peter Hutterer [Wed, 16 Oct 2024 00:55:55 +0000 (10:55 +1000)]
test: add restore_tty helper and use it
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
Peter Hutterer [Wed, 16 Oct 2024 00:26:31 +0000 (10:26 +1000)]
test: init the device list via argument
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
Peter Hutterer [Tue, 15 Oct 2024 01:46:58 +0000 (11:46 +1000)]
test: add a helper for deleting a created file
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
Peter Hutterer [Mon, 14 Oct 2024 11:35:36 +0000 (21:35 +1000)]
test: switch a bunch of tests from abort() to one with a message
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
Peter Hutterer [Mon, 14 Oct 2024 11:42:26 +0000 (21:42 +1000)]
test: fix litest_abort_msg() not starting a new line
Most callers of litest_abort_msg() don't add '\n' so the output was
mangled.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
Peter Hutterer [Tue, 15 Oct 2024 05:31:52 +0000 (15:31 +1000)]
doc: correct that the test suite is indeed run in the CI
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
Peter Hutterer [Mon, 16 Sep 2024 06:49:38 +0000 (16:49 +1000)]
test: switch the tests to use enum comparisons
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Mon, 16 Sep 2024 06:30:40 +0000 (16:30 +1000)]
test: add macros to compare enum values
This requires switching a lot of int_eq/int_ne over to enum_eq/enum_ne
because the compiler doesn't infer the right type from a harcoded enum
value - it just defaults to int.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Fri, 11 Oct 2024 03:55:56 +0000 (13:55 +1000)]
test: switch a bunch of integer comparisons to right sizes
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Mon, 16 Sep 2024 06:20:26 +0000 (16:20 +1000)]
test: switch ck_assert over to litest_assert
This is the first step in switching away from the check framework.
Our litest macros already do almost exactly the same anyway so most of
this is a simple sed with a few compiler fixes where things mismatch
(nonnull -> notnull) and (_tol -> _epsilon).
This now generates a whole bunch of integer mismatch warnings: check
casts everything to intmax_t whereas we use typeof, so lots of warnings
especially for enums.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Mon, 16 Sep 2024 06:13:44 +0000 (16:13 +1000)]
test: add litest string comparison macros
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Mon, 14 Oct 2024 00:14:56 +0000 (10:14 +1000)]
test: replace manual "almost equal" with the new double epsilon
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Mon, 14 Oct 2024 05:26:57 +0000 (15:26 +1000)]
test: fix some checks using ints to compare doubles
Theoretically we should be using ck_assert_double_eq here for
consistency but this patch is part of a series eventually
replacing those calls, so let's jump to litest_assert_double
directly to avoid further rebase conflicts.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Mon, 14 Oct 2024 05:20:21 +0000 (15:20 +1000)]
test: fix a touch test comparing ints to doubles
We were checking doubles for integers but better to check that we're
close to the maximum range without actually being over.
This worked because check typecasts to uint_max_t but let's be explicit
here.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Mon, 16 Sep 2024 06:05:11 +0000 (16:05 +1000)]
test: add a macro to compare two doubles with a specific epsilon
Same as ck_assert_double_tol
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Sun, 13 Oct 2024 01:06:39 +0000 (11:06 +1000)]
test: initialize a variable to make scan-build happy
Assuming safe_atoi works as expected, `fuzz` cannot be
uninitialized by the time we get here. But let's init it anyway to make
scan-build happy.
[202/249] Compiling C object libinput-test-suite.p/test_test-touch.c.o
../../../test/test-touch.c:964:2: warning: Assigned value is garbage or undefined [core.uninitialized.Assign]
964 | litest_assert_int_eq(fuzz, 10); /* device-specific */
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note that this error message is the result of a follow-up commit,
this commit is shuffled before so we have bisectable build.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Mon, 14 Oct 2024 08:58:24 +0000 (18:58 +1000)]
test: add litest_assert_event_type_not_one_of
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Tue, 8 Oct 2024 09:27:28 +0000 (19:27 +1000)]
test: replace ck_abort with litest_abort_msg()
Weirdly, that also required initializing two variables to NULL to stop a
compiler warning.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Sat, 12 Oct 2024 10:21:59 +0000 (20:21 +1000)]
test: fix missing END_TEST for strv_for_each_test
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Sun, 13 Oct 2024 09:01:50 +0000 (19:01 +1000)]
test: fix double parsing test
We should check that we actually have a double here...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Sat, 12 Oct 2024 10:21:20 +0000 (20:21 +1000)]
test: fix a data type in the utils test
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Mon, 14 Oct 2024 08:56:05 +0000 (18:56 +1000)]
test: add a missing va_end
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Peter Hutterer [Mon, 14 Oct 2024 09:29:15 +0000 (19:29 +1000)]
test: fix uinput creation for the slotted devices with too many slots
Kernel commit
206f533a0a7c
"Input: uinput - reject requests with unreasonable number of slots"
limits the number of slots to 99 - let's manually adjust that so we can
keep creating uinput devices.
Since these are just a test device and we don't use the slots here
anyway (they're all fake MT devices) we can manually work around this.
The real devices won't be affected by this since this is a limitation
in uinput, not the input subsystem.
Also move the comment one line up in the ms-surface device, the previous
comment referred to the wrong event code.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1061>
Peter Hutterer [Sun, 13 Oct 2024 23:14:59 +0000 (09:14 +1000)]
test: make litest-test-suite --list YAML-compatible
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1060>
Peter Hutterer [Sun, 13 Oct 2024 09:20:57 +0000 (19:20 +1000)]
test: move the test devices into the test_device_section
Better naming this way
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1060>
Peter Hutterer [Sun, 13 Oct 2024 09:16:32 +0000 (19:16 +1000)]
test: switch unused argc/argv to the list of tests
This means we don't rely on the "all_tests" global here though it also
means we need to move the cleanup into the caller.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1060>
Muhammad Talal Anwar [Mon, 7 Oct 2024 21:06:05 +0000 (21:06 +0000)]
quirks: add Logitech ERGO M575(S)
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1058>
Peter Hutterer [Fri, 13 Sep 2024 05:31:34 +0000 (15:31 +1000)]
gestures: change a boolean to an enum for more expressive code
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Peter Hutterer [Fri, 13 Sep 2024 04:41:36 +0000 (14:41 +1000)]
gestures: add debugging for state transitions
Our state machine allows falling through multiple transitions, so let's
make it possible to debug this.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Peter Hutterer [Fri, 13 Sep 2024 02:34:41 +0000 (12:34 +1000)]
gestures: get rid of tp_gestures_start
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Peter Hutterer [Fri, 13 Sep 2024 01:58:26 +0000 (11:58 +1000)]
gestures: rename gesture_notify_hold to gesture_notify_hold_begin()
HOLD gestures only have begin/end so let's rename this so it's
immediately obvious which one we're sending.
notify_swipe/pinch pass the event type in so it's clear that it's a
BEGIN vs an UPDATE.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Peter Hutterer [Fri, 13 Sep 2024 01:25:22 +0000 (11:25 +1000)]
gestures: rename most events to FOO_START
These events aren't used to signal scroll/swipe/pinch/..., merely to
signal the start of that gesture. So let's rename it to make the code
clearer (e.g. why do we log a bug when for a FOO event when we're in
state FOO?).
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Peter Hutterer [Thu, 12 Sep 2024 10:10:42 +0000 (20:10 +1000)]
gestures: push tp_gesture_start() for hold gestures into the state handling
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Peter Hutterer [Thu, 12 Sep 2024 09:36:38 +0000 (19:36 +1000)]
gestures: push tp_gesture_end() into the actual state machine
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Peter Hutterer [Thu, 12 Sep 2024 08:47:36 +0000 (18:47 +1000)]
gestures: log a bug if we're trying to reset an actual gesture
Now that end/cancel are separate states, we shouldn't get here.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Peter Hutterer [Mon, 9 Sep 2024 03:59:25 +0000 (13:59 +1000)]
gestures: distinguish between a gesture reset and a gesture end/cancel
All current states treat them the same way but let's distinguish those
two so we can have different code depending on whether a gesture was
cancelled/reset or ended properly.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Peter Hutterer [Thu, 12 Sep 2024 08:29:40 +0000 (18:29 +1000)]
gestures: replace switch-timeout based gesture_cancel calls with a state
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Peter Hutterer [Tue, 10 Sep 2024 03:00:36 +0000 (13:00 +1000)]
gestures: rename tp_gesture_handle_state and tp_gesture_post_gesture
Confusingly, tp_gesture_handle_state() would do almost nothing with our
state machine and the various tp_gesture_handle_state_foo() were called
later from tp_gesture_post_gesture().
Rename those functions into so that we have
tp_gesture_update_finger_state() first followed by
tp_gesture_handle_state() which is responsible for dealing with the
state machine.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Peter Hutterer [Thu, 12 Sep 2024 09:45:33 +0000 (19:45 +1000)]
gestures: make a error message more informative
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Peter Hutterer [Fri, 13 Sep 2024 04:10:51 +0000 (14:10 +1000)]
gestures: log the finger count together with the gesture state
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>
Wentao Guan [Mon, 23 Sep 2024 08:51:47 +0000 (08:51 +0000)]
quirks: add a quirk for the HONOR MagicBook Art 14 touchpad
The touchpad need ModelPressurePad=1 to enable moving cursor,
and need AttrEventCode=-BTN_RIGHT to use right key by touchpad
two-fingers press..
Closes: #1040
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1040
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1053>
WeirdTreeThing [Mon, 30 Sep 2024 01:37:22 +0000 (21:37 -0400)]
quirks: Add quirk for Google Chromebook Cret
Signed-off-by: Brady Norander <bradyn127@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1056>
Ajrat Makhmutov [Tue, 24 Sep 2024 15:22:00 +0000 (18:22 +0300)]
quirks: touchpad quirk for ICL Si1516/Si1512
Exactly the same quirk as for Graviton N15i-k2 and Graviton N15i.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1054>
Ajrat Makhmutov [Tue, 24 Sep 2024 15:15:01 +0000 (18:15 +0300)]
quirks: touchpad quirk for Graviton N15i
Exactly the same quirk as for Graviton N15i-K2.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1054>
Peter Hutterer [Mon, 30 Sep 2024 13:39:30 +0000 (15:39 +0200)]
CI: skip the valgrind tests for marge-bot
marge-bot rebases and edits the commit message but there's not way for
it to introduce a memleak that wasn't spotted in the user pipeline
first. Since those tests are very flaky, let's skip them when running
the marge-bot pipeline.
Closes #1042
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1057>
Peter Hutterer [Fri, 20 Sep 2024 11:33:38 +0000 (21:33 +1000)]
Fix a few potential NULL dereferences
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1052>
Peter Hutterer [Fri, 20 Sep 2024 11:16:20 +0000 (21:16 +1000)]
util: add a safe version of strlen
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1052>
Daniel Fuchs [Tue, 24 Sep 2024 16:07:27 +0000 (16:07 +0000)]
quirks: adjust pressure range for Google Krane, Wormdingler and Coachz
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1055>
Peter Hutterer [Wed, 4 Sep 2024 05:26:39 +0000 (15:26 +1000)]
tools: add --set-calibration to the debug-events man page
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1051>
Peter Hutterer [Mon, 16 Sep 2024 06:08:02 +0000 (16:08 +1000)]
test: fix macro grouping in the litest.h header
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1050>
Peter Hutterer [Wed, 18 Sep 2024 04:44:38 +0000 (14:44 +1000)]
test: use litest_assert_event_type instead of direct type check
This provides better debugging logs and is slightly less code in
the checks too.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1050>
Peter Hutterer [Wed, 18 Sep 2024 08:28:26 +0000 (18:28 +1000)]
test: use litest_wait_for_event instead of a NONE event check
Technically we're not really waiting here since we expect the
event to already be there but for these tests the distinction doesn't
matter.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1050>
Peter Hutterer [Wed, 18 Sep 2024 08:37:33 +0000 (18:37 +1000)]
test: fix use of wrong enum for setting clickfinger maps
Hidden by ck_asset_int_eq type-casing everything to intmax_t
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1050>
Peter Hutterer [Wed, 18 Sep 2024 04:57:51 +0000 (14:57 +1000)]
test: use litest_assert_empty_queue instead of a manual none check
This provides better debugging printfs and is the now-recommended way to
check this.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1050>
Peter Hutterer [Fri, 13 Sep 2024 05:13:38 +0000 (15:13 +1000)]
test: add litest_dispatch() for better test debugging
Wraps libinput_dispatch() with a location which will make things a bit
easier to track. Output (in --verbose) is something like:
gestures_swipe_3fg_unaccel_fn():1346 - dispatching
Which makes it easier to associate the various calls to libinput
dispatch with the other output from libinput.
This patch switches all uses of libinput_dispatch() in test cases over
but not the litest functions that may call dispatch too. Remains to be
seen if that is necessary.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1048>
Peter Hutterer [Fri, 13 Sep 2024 02:56:28 +0000 (12:56 +1000)]
test: abort on libinput bugs again
This was always intended but a bug prevented the actual abort.
strstr returns NULL when we cannot find the substring so we always
triggered the first noop condition on bugs.
Fixes: bd7b91065b13 ("evdev: warn if our event processing lags by 10ms or more")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1048>
Peter Hutterer [Thu, 12 Sep 2024 03:40:44 +0000 (13:40 +1000)]
test: improve event debugging a bit
Add a litest_checkpoint macro and convert a few of the litest_assert
macros to make use of that - this gives us a printf of the call site in
case it fails.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1048>
Peter Hutterer [Thu, 12 Sep 2024 04:59:38 +0000 (14:59 +1000)]
test: highlight the gesture state machine log messages in yellow
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1048>
Peter Hutterer [Thu, 12 Sep 2024 04:59:06 +0000 (14:59 +1000)]
gestures: use a colon-suffixed debug prefix like the other state machines
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1048>
Peter Hutterer [Wed, 11 Sep 2024 06:23:08 +0000 (16:23 +1000)]
test: make litest_wait_for_event_of_type auto-terminating
Wrap this in a macro so we cannot forget to pass -1
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1048>
Peter Hutterer [Wed, 11 Sep 2024 06:19:33 +0000 (16:19 +1000)]
test: make litest_drain_events_of_type auto-terminating
Wrap this in a macro so we cannot forget to pass -1
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1048>
Peter Hutterer [Sun, 8 Sep 2024 23:45:46 +0000 (09:45 +1000)]
triage-policies: add reminder for info in commit messages
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1043>
Peter Hutterer [Sun, 8 Sep 2024 23:38:49 +0000 (09:38 +1000)]
triage-policies: add a blurb for the help-needed label
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1043>
Peter Hutterer [Mon, 9 Sep 2024 05:25:52 +0000 (15:25 +1000)]
tools/debug-events: move the event type str to a helper function
This isn't really necessary for the code as-is it makes debugging things
easier.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1044>
Peter Hutterer [Tue, 10 Sep 2024 04:44:23 +0000 (14:44 +1000)]
gestures: cancel the hold before initializing the pinch
If we're in state HOLD we have an ongoing hold gesture - make sure we
cancel that one first before we initialize the pinch.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1046>
Peter Hutterer [Tue, 10 Sep 2024 02:09:29 +0000 (12:09 +1000)]
triage-policies: point to the new hid-recorder written in rust
It provides a more useful and easier to read report output, so let's go
with that.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1045>
Peter Hutterer [Fri, 6 Sep 2024 04:21:06 +0000 (14:21 +1000)]
CI: retry valgrind jobs if they fail
Our valgrind jobs are very timing-sensitive so it's very common that
they fail with an error when the reason is just valgrind being slower
and we miss a deadline somewhere.
Retry them if they fail, hopefully that gives us more reliable
pipelines.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1040>
Peter Hutterer [Fri, 6 Sep 2024 04:45:30 +0000 (14:45 +1000)]
tools/debug-events: add ability to compress motion events
If --compress-motion-events is given (and stdout is a tty) reduce
the output printed to one line per repeated motion/axis/scroll sequence
(with a count). Example output:
event6 POINTER_MOTION 108 +1.912s 1.00/ -1.00 ( +1.00/ -1.00))
event6 POINTER_BUTTON +2.008s BTN_LEFT (272) pressed, seat count: 1
event6 POINTER_BUTTON +2.074s BTN_LEFT (272) released, seat count: 0
event6 POINTER_MOTION 39 +5.249s 0.00/ 0.99 ( +0.00/ +1.00)
event6 POINTER_BUTTON +5.385s BTN_LEFT (272) pressed, seat count: 1
event6 POINTER_MOTION 66 +6.031s -1.00/ 0.00 ( -1.00/ +0.00)
event6 POINTER_BUTTON +6.401s BTN_LEFT (272) released, seat count: 0
The event count (108, 39 and 66) is only printed for more than one event
in sequence so the output is otherwise identical (but 4 spaces wider
now)
If stdout is not a tty the event count is printed but no compression
happens since we rely on a ansi escape sequence for that. Could be fixed
by changing the current print statements to print a \n before the
current event instead of at the end of the current line.
This makes debugging events easier as button events and similar are no
longer obscured by pages of motion events in between.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1041>
Peter Hutterer [Mon, 9 Sep 2024 05:30:05 +0000 (15:30 +1000)]
tools/debug-events: ignore old-style pointer axis events completely
Since they're interleaved with the more modern finger/wheel/continuous
events they mess up our repeate count, preventing compression for those
events.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1041>