libevdev/test
Peter Hutterer 93bc9a329d Add per-device log handlers
The global log handler isn't a good choice for a low-level library. In the
caser of the X server, both evdev and synaptics are now using the libevdev but
are loaded from the same server process. Thus, there's only one log handler,
but evdev and synaptics don't talk to each other (a bit childish, I know).

Add a per-device log handler that overrides the global log handler, and fall
back to the global log handler if no device log handler is set. The log
macros take care of that automatically, especially as we can't do per-device
log handlers for the uinput code.

Note that we use the same struct for the global and device logging, so in each
instance one of the two function pointers is NULL. Suicide triggers are in
place in case we mess that up.

This also makes libevdev_new_from_fd() a bit less useful since we can't set
the log handler beforehand.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2014-06-05 15:16:06 +10:00
..
.gitignore Add a test for EVIOCREVOKE 2014-02-26 07:22:04 +10:00
Makefile.am test: unconditionally distribute the valgrind suppressions 2014-05-07 18:55:02 +10:00
test-common-uinput.c test: fix memleak when using the test-uinput device 2014-02-27 11:08:51 +10:00
test-common-uinput.h test: provide wrapper for fetching the devnode from a uinput test device 2013-09-13 08:59:06 +10:00
test-common.c test: abort on unexpected log messages 2014-01-22 09:14:40 +10:00
test-common.h test: abort on unexpected log messages 2014-01-22 09:14:40 +10:00
test-compile-pedantic.c test: add a build test for -Wpedantic 2013-11-23 09:00:53 +10:00
test-event-codes.c Provide separate lookup functions for zero-terminated strings 2013-11-01 08:18:41 +10:00
test-event-names.c test: remove NULL test for SW_MAX, 3.13 defines SW_MUTE_DEVICE 2014-01-29 15:08:12 +10:00
test-int-queue.c test: remove a bunch of superfluous empty lines 2014-02-25 13:05:30 +10:00
test-kernel.c test: remove checks for test device creation failure 2014-04-02 11:35:56 +10:00
test-libevdev-events.c test: silence some valgrind warnings 2014-04-28 08:27:06 +10:00
test-libevdev-has-event.c test: silence some valgrind warnings 2014-04-28 08:27:06 +10:00
test-libevdev-init.c Add per-device log handlers 2014-06-05 15:16:06 +10:00
test-link.c test: add basic link test 2013-12-12 13:19:52 +10:00
test-main.c test: whitespace fixes (newlines) 2014-03-05 19:16:08 +10:00
test-uinput.c test: abort on unexpected log messages 2014-01-22 09:14:40 +10:00
valgrind.suppressions test: run all tests through valgrind 2014-04-29 10:49:10 +10:00