Putting an EVIOCGRAB on the device before sending those events means no-one
else sees those events - particularly upower. This means no-one else knows the
lid is on or off and thus we never blank the screen (or suspend/shut down but
those are inhibited anyway).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This triggers on Fedora 30, even though skip skip the tools options test when
running under valgrind.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We don't check for correctness in the output as such, just that whatever
combination of cmdline arguments still works/doesn't work. This is the
scaffolding and a few tests, but needs to be filled in, especially for
libinput measure and for some more complex combinations.
valgrind: requires one more python-related suppression
gitlab-ci: requires another environment variable so we know to skip the
--device tests (udev will time out on those)
meson: skip the test run in release builds, we pass the full path to the built
libinput tool but rely on the subtool lookup that won't work in a
release build
Fixes#174
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Failing the leftover-rules check in the valgrind stage because
==1491== Invalid read of size 16
==1491== at 0x5320AE8: __wcsnlen_sse4_1 (in /usr/lib64/libc-2.27.so)
==1491== by 0x5310AD1: wcsrtombs (in /usr/lib64/libc-2.27.so)
==1491== by 0x1AA403: ??? (in /usr/bin/bash)
==1491== by 0x1AB3E3: glob_filename (in /usr/bin/bash)
==1491== by 0x179FF1: shell_glob_filename (in /usr/bin/bash)
==1491== by 0x1752CD: ??? (in /usr/bin/bash)
==1491== by 0x14C05F: ??? (in /usr/bin/bash)
==1491== by 0x14E2E3: execute_command_internal (in /usr/bin/bash)
==1491== by 0x14FBC5: execute_command (in /usr/bin/bash)
==1491== by 0x137598: reader_loop (in /usr/bin/bash)
==1491== by 0x135D38: main (in /usr/bin/bash)
==1491== Address 0x5651fd0 is 32 bytes before a block of size 128 in arena "client"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
An aborted test run can sometimes leave udev rules as detritus. Test for that
so we don't get test case failures triggered by those rules.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If the kernel sends us a button press for a button that is thought to be down
we have lost track of the state of the button. Ignore the button press event,
in the hope that the next release makes things right again.
A release event may be masked if another process grabs the device for some
period of time, e.g. libinput debug-events --grab.
https://bugs.freedesktop.org/show_bug.cgi?id=101796
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Running through mesontest also runs parse-hwdb through valgrind and
gives us a bunch of leaks that originate within Python somewhere - we don't
care about those.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The check unit test framework isn't particularly suited to having ck_assert*
calls in helper functions. A failed assertion in a helper function or the
litest framework merely gives us a the failed line in litest.c.
which doesn't tell us which test actually failed.
Add a backtracing facility with litest_backtrace(). And since this requires
wrapping all ck_assert macros with litest_assert() this patch ended up
replacing/duplicating a bunch of ck_assert_* bits. So rather than
ck_assert_int_eq() we now use litest_assert_int_eq(), etc. in the litest
framework itself.
The int comparison macros are more type-safe than ck_assert()'s macros which
just cast all the ints to intmax_t.
Backtrace is spewed to stderr, which is good enough for debugging. Example
backtrace:
FAILED COMPARISON: status != expected
Resolved to: 0 != 0
in disable_button_scrolling() (pointer.c:115)
Backtrace:
0: ./test/test-pointer (litest_fail_comparison_int+0xab) [0x40973b]
1: ./test/test-pointer (disable_button_scrolling+0x174) [0x40421b]
2: ./test/test-pointer (middlebutton_middleclick+0x40) [0x40829c]
3: /lib64/libcheck.so.0 (srunner_run+0x7f5) [0x7f0e8a277025]
4: ./test/test-pointer (litest_run+0x107) [0x40a42b]
5: ./test/test-pointer (main+0x2fa) [0x4090e7]
6: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f0e88f5e790]
7: ./test/test-pointer (_start+0x29) [0x403ce9]
8: ? (?+0x29) [0x29]
litest_backtrace() itself is copied from xserver/os/backtrace.c which git
blame attributes to Marcin.
CC: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
A tablet hotplug event is rare and not a time-critical event, so we load the
database on tablet init and throw it away again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Stephen Chandler Paul <thatslyude@gmail.com>