Commit graph

598 commits

Author SHA1 Message Date
Ronan Pigott
ac007401bb tools: fix typo in debug-events 2019-08-13 15:26:53 -07:00
Benjamin Tissoires
576bc2e5e6 tests: increase the timeout for the subprocess to receive the quit signal
On a very loaded machine, the process might not receive the quit signal
in a timely manner, and this introduce false positive results.

Add a longer timeout. This shouldn't interfere with the global time
spent in the tests, but will allow some loaded environment to pass
the tests.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-08-07 14:28:22 +02:00
Peter Hutterer
4ab8a51b68 tools: record: fix two memory leaks
Found by coverity.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-01 08:41:01 +10:00
Peter Hutterer
803519ae59 tools: record: fix segfault on exit
If we don't supply --with-libinput, the device is NULL so we can't unref it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-01 08:40:58 +10:00
Peter Hutterer
9c2ac8f9ee tools: record: when running from the builddir, load the quirks correctly
Fixes #324

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-24 14:57:56 +10:00
Peter Hutterer
b436585b5e tools: handle arguments correctly for the YAML verifier tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-24 14:57:56 +10:00
Peter Hutterer
9807019096 tools: skip the event tests for eventless recordings in the YAML verifier
When verifying a recording, let's skip those tests that require events but
don't have any.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-24 14:57:36 +10:00
pixl
cc370f53c4 Fixed a grammar error 2019-07-05 05:14:31 +00:00
Peter Hutterer
6a489b0636 tools: return 77 if gtk_init() fails in the debug-gui
And when that happens, skip the tests because what's happening here is that
you're running tests as root, but your X server doesn't allow root to connect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 21:09:22 +10:00
Peter Hutterer
b12084ef76 tools: skip debug-gui option testing if the debug-gui is disabled
Fixes #311

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 03:23:55 +00:00
Peter Hutterer
34afe3ba1c tools: improve the error messages for measure touch-size/touchpad-pressure
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-24 12:50:08 +10:00
Peter Hutterer
c3005ce48e tools: describe the various debug-gui features in the man page
There are too many things now to make it immediately obvious, let's describe
all this accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-13 11:02:42 +10:00
Peter Hutterer
8bfa1aa086 tools: handle pad strip/ring events in the debug-gui
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-13 11:02:42 +10:00
Peter Hutterer
e439d740f0 tools: display tablet and tablet pad buttons when pressed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-13 11:02:42 +10:00
Peter Hutterer
17d792445e tablet: add a the Totem tool type to the tablet interface
This is the public API only, not the internal bits, so nothing will work just
yet.

This interface addition is for the Dell Canvas Totem tool, so let's go with
the same name because options like "Rotary" are too ambiguous.

The totem is a knob that can be placed on the surface, it provides us with
location and rotation data. The touch major/minor fields are filled in by the
current totem, but they're always the same size.

The totem exports BTN_0 as well, so let's add that to the debug-events output.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-07 01:03:21 +00:00
Peter Hutterer
829673901c tools: add --apply-to to debug-events and debug-gui
All configuration options will only apply to the device with the given match
mattern. This makes it easier to test things like tapping on one device but
not on the other.

Exception is the sendevents pattern which applies independently.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-27 11:13:48 +10:00
Peter Hutterer
40f3e2603f tools: drop the valgrind check in the option-parsing test
It's not part of the valgrind test suite, so we don't need this check anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-07 04:48:00 +00:00
Peter Hutterer
d7b1ebef4b tools: we don't need a core file for failed option parser tests
SIGQUIT which we send to any successful test of libinput debug-event will
trigger a coredump. We don't need that one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-07 04:48:00 +00:00
Peter Hutterer
32bf9f2990 tools: fix waiting for the tool to quit in the options test
Just use the wait() timeout directly instead of sleep and kill. This allows us
to have a longer timeout and still get fast handling where the tool
immediately exits, but less failure when running on busy machines.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-09 13:41:03 +10:00
Peter Hutterer
80a52c28df tools: use American spelling for 'unrecognized'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-08 11:19:51 +10:00
Peter Hutterer
274b80d06c tools: switch measure-touchpad-tap to python-libevdev
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 04:33:11 +00:00
Peter Hutterer
33afe9f875 tools: switch measure-touchpad-pressure to python-libevdev
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 04:33:11 +00:00
Peter Hutterer
deb759a069 tools: switch measure-touch-size to python-libevdev
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 04:33:11 +00:00
Peter Hutterer
795c08eb44 tools: switch measure-fuzz to use python-libevdev
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 04:33:11 +00:00
Peter Hutterer
247b2344a5 tools: record: increase value size to 6 digits
Tablets commonly have higher axis ranges, might as well make sure they line
up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 09:45:29 +10:00
Peter Hutterer
56dfa2f6c0 test: fix tool option parsing tests for signals
Not sure how this ever worked correctly: a process terminated by a signal has
the negative signo as return code. This would apply to every debug-events and
debug-gui test because they have to get killed by a signal. This failed
occasionally, presumably a race with the GTK startup/signal handler/whatever.

Fix this by a) sending SIGQUIT because that won't get handled by the tools and
b) prending that if we get a -SIGQUIT exit code, everything is fine.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-28 15:47:31 +10:00
Peter Hutterer
79293ea456 tools: fix the tool option parse test to handle unittest arguments
Pass arguments we don't handle directly through to the unittest module. This
way we can filter tests with -k testname etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-28 15:47:31 +10:00
Peter Hutterer
26702e4d73 Fix three coverity complaints
Two resource leaks, one uninitialized variable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-25 15:15:13 +10:00
Peter Hutterer
a4b9813b92 tools: flake8 fixes, typo fixes and missing exception handling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-15 12:01:51 +10:00
Peter Hutterer
d4f5faae0d tools: move the builddir lookup function out to a separate file
We want to use this from the tests as well soon, so let's move it to a more
generic location. This also changes the API to be slightly more sensible, a
free() is the same cost (and safer) than passing a static buffer in and hoping
we didn't get the size wrong.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-14 11:28:05 +10:00
Peter Hutterer
d7282a3d9d tools: skip the option parsing test during valgrind
We don't want to valgrind through python...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-12 15:10:15 +10:00
Peter Hutterer
1150a8442f tools: display the discrete axis steps too
Draw a second smaller scroll bar that moves with every discrete step. For that
to work, we have to accumulate the value from the normal scroll events until
we get the first discrete one, then move up.

The value per discrete event changes depending on the click wheel angle, so we
can't just use discrete on its own if we want the two scroll bars aligned.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-04 15:47:27 +10:00
Peter Hutterer
d213804de8 tools: group the scroll bits into a struct
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-04 15:47:27 +10:00
Peter Hutterer
1272db297a tools: record: print a helpful error message when we don't have devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-04 04:54:27 +00:00
Peter Hutterer
e0008d3dc2 tools: debug-gui: change the tablet color
Grey isn't pretty enough

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-14 13:08:51 +10:00
Peter Hutterer
f954cb29e4 tools: debug-gui: add a previously unbalanced cairo_restore()
And remove some of the unnecessary ones

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-14 13:02:13 +10:00
Peter Hutterer
c1ee05fb9a tools: debug-gui: move the pointer delta code to draw_pointer
Not sure why this was in draw_tablet(), probably copy/paste

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-14 13:02:13 +10:00
Peter Hutterer
e038a22360 tools: draw the tablet before the touch points
On the Dell Canvas Totem, the tool will cancel existing touch points and to
visually debug that, we need the touchpoints to be drawn over the tool.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-13 18:45:04 +10:00
Peter Hutterer
5b85cf06d8 tools: draw other buttons in the debug-gui
Buttons that aren't lmr are drawn in a separate button square now with the
name as it comes from the kernel. This only handles one button at a time, but
it'll do for debugging.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-13 07:26:54 +00:00
Peter Hutterer
335fe99a32 tools: debug-gui: move the lmr button handling into a substruct
No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-13 07:26:54 +00:00
Peter Hutterer
790a301d13 tools: debug-gui: show cancelled touches as unfilled circles
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-13 07:26:54 +00:00
Peter Hutterer
c8599ea2ae tools: document show-keycodes option for libinput-record
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-17 10:00:30 +10:00
Peter Hutterer
b8a04553de tools: libinput-record: record the hid report descriptor where available
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-02 15:24:04 +00:00
Peter Hutterer
29e83bcf94 tools: measure-fuzz: slightly expand the help
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-02 04:59:48 +00:00
Peter Hutterer
b11fe3e91a tools: measure-fuzz: fix a typo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-02 04:59:48 +00:00
Peter Hutterer
447551aafb tools: measure-fuzz: downgrade the fuzz mismatch error to just a warning
Related to #199

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-02 04:59:48 +00:00
Peter Hutterer
a904738730 tools: measure-fuzz: fix exception printing
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/x86_64-linux-gnu/libinput/libinput-measure-fuzz", line 464, in <module>
    main(sys.argv)
  File "/usr/lib/x86_64-linux-gnu/libinput/libinput-measure-fuzz", line 458, in main
    print('Error: {}'.format(e.message))
AttributeError: 'InvalidConfigurationError' object has no attribute 'message'

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>:
2019-01-02 04:59:48 +00:00
Peter Hutterer
96a0e8ed66 tools: don't apply config options on device removed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-12-19 15:55:42 +10:00
Peter Hutterer
b033bc2677 tools: draw evdev events in the debug-gui
Listen to the pure evdev events from each device and print them. This makes it
slightly easier to associate certain jumps with the output, or otherwise see
that events are coming in even when libinput doesn't seem to process them
anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 15:22:20 +10:00
Peter Hutterer
4e469291b1 tools: let debug-events take a device path
This is the most common use-case other than "all from udev", so let's just
parse a device path correctly without requiring --device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00