Commit graph

32 commits

Author SHA1 Message Date
Peter Hutterer
067426385e test: unconditionally distribute the valgrind suppressions
Reported-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-05-07 18:55:02 +10:00
Peter Hutterer
a93baace89 test: run all tests through valgrind
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2014-04-29 10:49:10 +10:00
Peter Hutterer
974e330ac2 test: disable parallel testing
The tests create devices on the host system, avoid running them in parallel to
avoid interference between the test devices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2014-04-29 10:48:36 +10:00
Peter Hutterer
befe33620b test: the kernel test build doesn't need to link to libevdev
We statically compile libevdev in anyway through $(common_sources)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-04-02 11:35:12 +10:00
Peter Hutterer
061927dd76 Add a test for EVIOCREVOKE
New in 3.12, EVIOCREVOKE revokes access to an evdev device. This is unlikely
to be used by a libevdev user, see.
http://lists.freedesktop.org/archives/input-tools/2014-January/000688.html

This patch adds a new test-kernel binary that tests the kernel API directly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2014-02-26 07:22:04 +10:00
Peter Hutterer
e947fdc4c7 test: add basic link test
This test doesn't do anything but compile and link against libevdev. It's a
simple protection to avoid linker errors. If we ever have libs we depend on
and they don't get resolved properly, this test should warn us in time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-12 13:19:52 +10:00
Peter Hutterer
2487950f65 test: split tests into run-time and build-time tests
The build-time tests don't do anything, we don't need to run them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-12 12:57:21 +10:00
Gaetan Nadon
81780fc4d2 test-compile-pedantic: replace -Wpedantic with -pedantic
-Wpedantic is a relatively new option, with -pedantic being the old version of
it that works on older gcc versions too.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-11-26 09:53:08 +10:00
Peter Hutterer
a742d253b7 test: add a build test for -Wpedantic
A user of libevdev may be compiled with -Wpedantic. Our header files should
not produce any warnings, so add a simple test that merely includes both
public header files and compiles with -Wpedantic -Werror.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-23 09:00:53 +10:00
David Herrmann
523f34b2d9 Add name-resolver unit tests
A bunch of tests for the new name resolver.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-31 11:24:26 +10:00
David Herrmann
12717d796c Add libevdev_event_type/code_from_name() resolvers
Three new helpers are added:
(1) libevdev_event_type_from_name() takes a string describing an EV_*
event type and returns the given event-type constant.
(2) libevdev_event_code_from_name() takes a string describing an event
code and returns the given event-code constant.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-31 11:24:23 +10:00
Peter Hutterer
2a3219f55d Add a copy of linux/input.h
This avoids a number of otherwise required ifdefs when building on older kernels

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23 09:04:34 +10:00
Peter Hutterer
21356cca57 test: add uinput creation tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-08-29 13:54:49 +10:00
Peter Hutterer
1acbfb3579 Add support for uinput device creation
This lets libevdev provide a relatively generic interface for the
creation of uinput devices so we don't need to duplicate this across
multiple projects.

Most of this is lifted from the current test implementation, with a
couple of minor changes.

EV_REP needs special handling:
   Kernel allows to set the EV_REP bit, it doesn't set REP_* bits (which we
   wrap anyway) but it will also set the default values (500, 33).

Device node is guessed based on the sysfs path:
   The sysfs path contains a eventN file, that corresponds to our
   /dev/input/eventN number. Use it so clients can quickly get the device
   node, without a libudev dependency.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-29 13:54:46 +10:00
Peter Hutterer
1619613414 Make the tests optional to drop unneeded dependencies
libevdev has no external dependencies and both check and libudev are
only required for running the unit-tests. Make them optional.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-08-13 07:11:50 +10:00
Peter Hutterer
baf248fa4a test: move device creation into a shared function
remove some of that code duplication in the tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-29 18:19:42 +10:00
Peter Hutterer
a30f4cfa8a test: prepare a common header file for all tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-29 18:00:42 +10:00
Peter Hutterer
671a1e2feb test: add test for event polling and SYN_DROPPED handling
Rudimentary only, but it's a start

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 13:32:38 +10:00
Peter Hutterer
9b7cc815ea Revert "test: Hook up gcov to require the test name"
This reverts commit c590c70ea467b37e96b2b4cb41d91776519b569d.
2013-06-27 10:41:54 +10:00
Peter Hutterer
9e81874c49 Pull all tests together into one binary
Easier to monitor gcov coverage that way

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 10:41:54 +10:00
Peter Hutterer
32f86f97f6 test: Hook up gcov to require the test name
Make check will simply overwrite results of a previous test. Hook up gcov so that the test has to be
explicitly passed to avoid confusion here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 10:41:54 +10:00
Peter Hutterer
2da68a74e6 Fix distcheck
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 10:41:54 +10:00
Peter Hutterer
1d3e130ae8 test: fix includes for distcheck
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 10:41:54 +10:00
Peter Hutterer
cd66429c18 test: add test for internal event queue
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 10:41:54 +10:00
Peter Hutterer
b06f6e9d41 Hook up gcov
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 10:41:54 +10:00
Peter Hutterer
ad8e0d2857 Directly compile libevdev sources
This avoids messing around with libtool for debugging. I may revert this
once the library is actually slightly stable, but for now this makes things
easier.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 10:41:54 +10:00
Peter Hutterer
a2e058bc8b Add a test for event the various libevdev_has_event * functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 10:41:52 +10:00
Peter Hutterer
645d5d3a64 test: add infrastructure for uinput device tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-26 17:47:24 +10:00
Peter Hutterer
7c860d6002 Set up a test harness
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-04 11:39:33 +10:00
Peter Hutterer
fe34f7cff7 Move libevdev-events over to a tools directory
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-04 11:39:32 +10:00
Peter Hutterer
ea705612e1 Merge libevdev-print and libevdev-events into one binary
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-04 11:39:32 +10:00
Peter Hutterer
a3255d3ec7 libevdev is a library to handle evdev devices
Two main goals of this library:
- 'transparently' handle SYN_DROPPED events
- avoid errors in ioctl handling by providing a simpler interface.

Keeps a cached copy of the device for quick querying.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-05-29 15:33:21 +10:00