Peter Hutterer
d010c6a170
test: rename a variable to indicate suites, not tests
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062 >
2024-10-16 18:03:04 +10:00
Peter Hutterer
cd957b4e79
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 >
2024-10-16 18:03:04 +10:00
Peter Hutterer
cb0575b473
test: check for verbosity immediately in main()
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062 >
2024-10-16 18:03:04 +10:00
Peter Hutterer
75ce537342
test: check for empty tests immediately, not later when we're running
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062 >
2024-10-16 18:03:03 +10:00
Peter Hutterer
6d26d83f00
test: init the global devices/test lists immediately
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062 >
2024-10-16 18:03:03 +10:00
Peter Hutterer
50f6e4f195
test: add restore_tty helper and use it
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062 >
2024-10-16 18:03:03 +10:00
Peter Hutterer
1a1a8f5378
test: init the device list via argument
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062 >
2024-10-16 18:03:03 +10:00
Peter Hutterer
f7cc8e05f7
test: add a helper for deleting a created file
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062 >
2024-10-16 18:03:03 +10:00
Peter Hutterer
57a3313d33
test: switch a bunch of tests from abort() to one with a message
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062 >
2024-10-16 18:03:03 +10:00
Peter Hutterer
ecb2664e05
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 >
2024-10-16 18:03:03 +10:00
Peter Hutterer
d010c879ef
doc: correct that the test suite is indeed run in the CI
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062 >
2024-10-16 18:03:03 +10:00
Peter Hutterer
bd62da11e4
test: switch the tests to use enum comparisons
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
151c2feae6
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 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
5f4f72dca4
test: switch a bunch of integer comparisons to right sizes
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
f89fd6d924
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 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
0bc2bf60d2
test: add litest string comparison macros
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
9a5f888795
test: replace manual "almost equal" with the new double epsilon
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
237b15b401
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 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
825e521d9b
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 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
6e7dd8c111
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 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
84f96de974
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 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
3ed70e864f
test: add litest_assert_event_type_not_one_of
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
67061c1af0
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 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
99961d4bd1
test: fix missing END_TEST for strv_for_each_test
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
88feb3f25c
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 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
8696e80136
test: fix a data type in the utils test
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
7316a627d6
test: add a missing va_end
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059 >
2024-10-15 12:44:27 +10:00
Peter Hutterer
aecfcf3d1b
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 >
2024-10-15 09:56:19 +10:00
Peter Hutterer
c123a76b0d
test: make litest-test-suite --list YAML-compatible
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1060 >
2024-10-14 08:56:07 +00:00
Peter Hutterer
5b5776b148
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 >
2024-10-14 08:56:07 +00:00
Peter Hutterer
3577369805
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 >
2024-10-14 08:56:07 +00:00
Muhammad Talal Anwar
b89b0ccafb
quirks: add Logitech ERGO M575(S)
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1058 >
2024-10-07 21:06:05 +00:00
Peter Hutterer
2b77bdab5c
gestures: change a boolean to an enum for more expressive code
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049 >
2024-10-04 15:13:23 +10:00
Peter Hutterer
0fd074c974
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 >
2024-10-04 15:13:23 +10:00
Peter Hutterer
68a2ff0d49
gestures: get rid of tp_gestures_start
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049 >
2024-10-04 15:13:23 +10:00
Peter Hutterer
89596e61f8
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 >
2024-10-04 15:13:23 +10:00
Peter Hutterer
8899800de8
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 >
2024-10-04 15:13:23 +10:00
Peter Hutterer
e88007d4ae
gestures: push tp_gesture_start() for hold gestures into the state handling
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049 >
2024-10-04 15:13:23 +10:00
Peter Hutterer
fd0875029b
gestures: push tp_gesture_end() into the actual state machine
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049 >
2024-10-04 15:13:23 +10:00
Peter Hutterer
c1690d408a
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 >
2024-10-04 15:13:23 +10:00
Peter Hutterer
942fd0dc8f
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 >
2024-10-04 15:13:23 +10:00
Peter Hutterer
96500d81fb
gestures: replace switch-timeout based gesture_cancel calls with a state
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049 >
2024-10-04 15:13:23 +10:00
Peter Hutterer
6b5aeab51e
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 >
2024-10-04 15:13:23 +10:00
Peter Hutterer
c9c128f2b1
gestures: make a error message more informative
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049 >
2024-10-04 15:13:23 +10:00
Peter Hutterer
1d4e2e2e2d
gestures: log the finger count together with the gesture state
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049 >
2024-10-04 15:13:23 +10:00
Wentao Guan
4785a1cc09
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 >
2024-10-02 09:52:55 +00:00
WeirdTreeThing
9b4fefc972
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 >
2024-10-02 06:00:05 +00:00
Ajrat Makhmutov
c012e8a12a
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 >
2024-10-02 05:43:06 +00:00
Ajrat Makhmutov
601c1043b3
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 >
2024-10-02 05:43:06 +00:00
Peter Hutterer
b43061694c
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 >
2024-09-30 17:30:53 +00:00