Commit graph

849 commits

Author SHA1 Message Date
Peter Hutterer
a2ac0f0889 GitLab CI: build with the various options
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-29 12:07:14 +10:00
Peter Hutterer
ad5142a1b3 Add GitLab CI
A simple version of it, we just pull down a few popular distros, build on them
and make sure distcheck passes.

https://gitlab.freedesktop.org/libevdev/libevdev/issues/2

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-29 12:07:10 +10:00
Peter Hutterer
c16d85b8b6 configure.ac: remove --disable-test-run
This flag was used to disable test runs during make distcheck. Now that we
have more checks and the environment variable, we can drop this flag.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-29 11:50:38 +10:00
Peter Hutterer
6345c1cca2 configure.ac: fix the gcov linker flags
Presumably this worked, but it certainly doesn't work anymore (neither on
RHEL7 nor on Fedora 28)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-29 11:50:37 +10:00
Peter Hutterer
e4c3a8ee7a test: add LIBEVDEV_SKIP_ROOT_TESTS environment variable check
Depending on the container, or other checks don't always work. Add an extra
environment variable instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-29 11:15:41 +10:00
Peter Hutterer
c4cfd7668a test: move the kernel test to the same infrastructure
We previously had this separate because it tested separate things. Now the
setup is generic enough that we should just re-use it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-15 15:19:05 +10:00
Peter Hutterer
1f9e087dac test: check for the device nodes to exist before testing
Even if we're root we may be running in a container without input device
nodes. In which case we should skip the test, not fail.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-15 15:19:05 +10:00
Peter Hutterer
805706a816 test: split some non-root tests into separate binaries
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-15 15:01:59 +10:00
Peter Hutterer
b642eddc31 test: sort-of autodetect whether we need root privileges
It's not really autodetection, we just declare the test suites that need root
privs. But this way we can generically check for it from the main() that we
re-use across tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-15 15:01:19 +10:00
Peter Hutterer
83ce8eb5be test: automate test suite handling
Move all tests to a special section, then loop through that section
to fetch all test suite. The result is that new tests only need to add the
source files without having to update everything else as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-15 15:00:24 +10:00
Peter Hutterer
bc5c72571d test: rename some tests for less ambiguity
"key" usually refers to one of KEY_ of EV_KEY in general, but here we're
testing event codes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-15 14:16:29 +10:00
Peter Hutterer
c3953e1bb8 Change all URLs to gitlab.fdo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-06 18:20:11 +10:00
Deepa Dinamani
3c6766c862 Update struct input_event
The struct input_event is not y2038 safe.
Update the struct according to the kernel patch:
https://lkml.org/lkml/2018/1/6/324

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-12 15:23:22 +10:00
Peter Hutterer
501f739564 include: sync event codes with kernel 4.16
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-04 10:54:43 +10:00
Peter Hutterer
7ae667ee89 libevdev 1.5.9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-08 15:25:28 +10:00
Peter Hutterer
fbeeef9cde test: skip tests when we're not root
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-02-26 17:12:08 +10:00
Peter Hutterer
6ff816163e Blacklist SW_MAX so it doesn't shadow SW_PEN_INSERTED
They have the same value, so the _MAX code would shadow the real code, causing
issues in any client that needs to get all event names from libevdev.
Specifically, the loop of:
  for each code in 0 to max-for-type:
      print(name)
would not show up the code (but the _MAX) code instead. This causes issues
with clients that rely on name resolution that works. And the _MAX values are
special values anyway.

Blacklist it in the script here, causing it to resolve from name to code, but
not from code to name (like other duplicated codes).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-02-26 17:12:08 +10:00
Peter Hutterer
a67d1964ff Blacklist REP_MAX so it doesn't shadow REP_PERIOD
They have the same value, so the _MAX code would shadow the real code, causing
issues in any client that needs to get all event names from libevdev.
Specifically, the loop of:
  for each code in 0 to max-for-type:
      print(name)
would not show up the code (but the _MAX) code instead. This causes issues
with clients that rely on name resolution that works. And the _MAX values are
special values anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-02-26 17:12:08 +10:00
Peter Hutterer
3799acd49e Drop the python map printing
leftover from when this was part of evemu

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-02-26 16:53:55 +10:00
Peter Hutterer
0f40ad8888 libevdev 1.5.8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-01-29 14:17:50 +10:00
Peter Hutterer
8df02686d3 Sync with kernel 4.15 (BTN_STYLUS3)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-01-29 14:13:58 +10:00
Peter Hutterer
e84897f29a test: add --no-install flag to be able to debug directly
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-12-13 10:01:58 +10:00
Peter Hutterer
0637d0237a When changing the fd, reset our grab state to ungrabbed
Previously, calling grabbing a device after changing the fd was a no-op
because libevdev's grab state didn't match the fd:

libevdev_grab(LIBEVDEV_GRAB);
  .. fd is grabbed
  .. internal state is 'grabbed'
libevdev_change_fd();
  .. new fd is ungrabbed
  .. internal state is 'grabbed'
libevdev_grab(LIBEVDEV_GRAB);
  .. argument matches internal state and we exit without grabbing the device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-12-13 10:01:58 +10:00
Peter Hutterer
022b2bc3b0 include: sync with kernel 4.13
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-04 12:44:14 +10:00
Peter Hutterer
eefaca6f9f tools: add a script to sync the kernel header files
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-03 10:13:40 +10:00
Peter Hutterer
7ae59b1e9f include: sync with kernel v4.12
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-03 10:13:40 +10:00
Peter Hutterer
c6e11a0a80 uinput: make a note that the syspath we return is the input node
And not the syspath for the /dev/input/eventX node

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-03 09:55:29 +10:00
Peter Hutterer
b08a3c70e5 test: remove test for ULONG_MAX queue allocation
Fixes the warning:
../libevdev/libevdev-int.h:231:15: warning: argument 1 value
‘18446744073709551615’ exceeds maximum object size 9223372036854775807
[-Walloc-size-larger-than=]

That's now part of gcc's -Wall, so let's rely on that for code. Arguably, the
queue code is simple enough that we don't need a test for ENOMEM anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-05-09 13:43:05 +10:00
Peter Hutterer
7295576980 test: drop unused parameters from test's main()
Not needed, so let's get rid of the compiler warning.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-05-09 13:42:56 +10:00
Peter Hutterer
a9b3deb60f test: disable coredumps during test suite runs
It's a test suite, it shouldn't fill up the file system or the journal with
coredumps.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-05-09 08:12:43 +10:00
Peter Hutterer
78322a9b45 libevdev 1.5.7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-04 10:35:01 +10:00
Peter Hutterer
abfb307e18 Fix an indentation issues
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-25 09:27:16 +10:00
Peter Hutterer
0b482b5f11 doc: add links to git repositories on the main page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-24 14:42:00 +10:00
Mihail Konev
e7955544fe autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26 14:25:02 +10:00
Peter Hutterer
b13d67af9b autogen.sh: use exec for configure
No point in waiting around until it finishes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 14:23:18 +10:00
Peter Hutterer
a072277ba9 autogen.sh: escape $srcdir before configure
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 14:22:34 +10:00
Peter Hutterer
1ec01b1310 tools: print an error if we don't have any matching events in the dpi tool
Beats crashing by dereferencing a null-pointer (when we access
m->frequencies[idx])

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-01-17 14:50:29 +10:00
Peter Hutterer
a155a977b7 tools: move udev printf into the print_summary() helper
No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-01-17 14:42:13 +10:00
Peter Hutterer
24dafff909 configure.ac: enable subdir-objects
The main thing holding us back here was our gcov hacks. We used to rebuild the
libevdev sources locally inside test/ with the gcov flags so that we could
leave the main libevdev sources untouched. This doesn't work well with
subdir-objects - we have to link to libevdev.la instead.

To enable gcov, we now have to apply the gcov flags to the main library
object. But this also means that when running, the notes files will be
somewhere within the libevdev/ directory, not the test/ directory. Working
around this in automake gets nasty quickly, so just add a script that knows
how to search for things.

No functional changes unless --enable-gcov is given at configure time - then
don't install the library.

The gcov reports are now in test/gcov-reports/

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-01-09 09:40:28 +10:00
Peter Hutterer
1ee17e18ac test: fix a Makefile.am comment
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-06 11:28:58 +10:00
Peter Hutterer
d447a75e9e libevdev 1.5.6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-04 13:04:58 +10:00
Nayan Deshmukh
f7188aabc9 Fix typos in Documentation
Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 07:43:41 +10:00
Peter Hutterer
8a47a03044 include: update to v4.9 linux/input.h headers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-12 10:07:07 +10:00
Peter Hutterer
452847a314 libevdev 1.5.5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-01 07:55:25 +10:00
Peter Hutterer
b261868b0a Disable test runs on make distcheck
The tests all need root, but running distcheck as root is not ideal. Disable
the test runs (but not the build) to make it easier to verify distcheck works
as intended.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-11-30 20:34:46 +10:00
Nathan Baker
e938e0b959 Fix minor error in doxygen example code
The incorrect variable was checked as a return code in an example, and
that can be confusing for people trying to learn or use the example code
as a starting point.
2016-11-14 07:10:02 +10:00
Peter Hutterer
61f0a0f9ad tools: print the mean frequency together with the max frequency
And if they're 30% out, print a warning. On the ThinkPad X1 Wireless Touch
Mouse (when connected via bluetooth) we get a bunch of events at the start of
the movement, all less than 1ms apart. Best guess is that the device goes to
low-power, then notices the movement and buffers the event until the BT
connection is back up. Then it sends all events at once. Usually they're less
than 1ms apart, but at one recording showed a 37ms delay before we go back to
the normal 70ms (~15Hz) the mouse has otherwise.

This is unpredictable enough that we can't just work around it so instead
print a warning to the user so they can go investigate.

https://bugs.freedesktop.org/show_bug.cgi?id=97812

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-09-21 16:57:29 +10:00
Peter Hutterer
55c43b19cf tools: rename frequency to max_frequency in the dpi tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-19 10:55:51 +10:00
Peter Hutterer
94385480ff tools: use uint64_t, not doubles for the µs parameters
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-16 07:26:42 +10:00
Peter Hutterer
2a612997ab tools: fix kernel-announced width/height
Side-effect of 240ba34ebd was that "touchpad size as listed by the kernel"
was now dependent on the values we got. This one is a static one based on the
axis info.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-15 11:57:52 +10:00