Commit graph

18 commits

Author SHA1 Message Date
Enric Balletbo i Serra
bb4404dd91 test: Get the print mode from the CK_VERBOSITY environment variable
On a test run it only prints the summary and one message per failed
test. While having this behaviour by default is nice it might be
interesting in some case to have more information print. Make the print
mode configurable from the environment variable CK_VERBOSITY, which can
have the values "silent", "minimal", "normal" or "verbose" so we can have
different outputs.

    $ sudo CK_VERBOSITY=verbose ./test-libevdev
    Running suite(s): libevdev init tests
     libevdev_has_event tests
     libevdev event tests
     100%: Checks: 79, Failures: 0, Errors: 0
     test-libevdev-init.c:23:P:test_new_device:test_new_device:0: Passed
     test-libevdev-init.c:28:P:test_free_device:test_free_device:0: Passed
     [ ... ]

Note that the default print mode doesn't change after this patch.

Signed-off-by: Enric Balletbo i Serra <eballetbo@redhat.com>
2023-04-19 16:40:14 +02:00
Peter Hutterer
60d4f1b2ae Change to the (always intended) MIT license
Due to what must've been a copy/paste error many years ago, the license text
for libevdev wasn't actually the MIT license. Let's rectify this, it was
always MIT intended anyway.

To make this more obvious and reduce the chance of copy/paste mistakes, use
the SPDX license identifier in the various source files. The two installed
public header files have the full license text.

All contributors with copyrightable contributions have ACKed the license
change to MIT, either in the MR directly [1] or privately in reply to an
email.

[1] https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/69

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Alexander Dahl <ada@thorsis.com>
Acked-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Acked-by: Armin K <krejzi@email.com>
Acked-by: Benjamin Tissoires <btissoir@redhat.com>
Acked-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Deepa Dinamani <deepa.kernel@gmail.com>
Acked-by: Emmanuele Bassi <ebassi@gnome.org>
Acked-by: Gaetan Nadon <memsize@videotron.ca>
Acked-by: George Thomas <georgefsthomas@gmail.com>
Acked-by: Michael Forney <mforney@mforney.org>
Acked-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Acked-by: Niclas Zeising <zeising@daemonic.se>
Acked-by: Owen W. Taylor <otaylor@fishsoup.net>
Acked-by: Peter Seiderer <ps.report@gmx.net>
Acked-by: Ran Benita <ran234@gmail.com>
Acked-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Scott Jann <sjann@knight-rider.org>
Acked-by: Thilo Schulz <thilo@tjps.eu>
Acked-by: polyphemus <rolfmorel@gmail.com>
2021-01-25 13:46:55 +10:00
Niclas Zeising
0af8c4054d tests: Disable attach debugger on FreeBSD
Disable attaching a debugger on FreeBSD, since FreeBSD lacks support for
PTRACE_ATTACH.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Peter Hutterer
4c8a7a265d config.h is a local include path
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:03:23 +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
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
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
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
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
b08ed615d3 test: whitespace fixes (newlines)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-05 19:16:08 +10:00
Peter Hutterer
0c01886985 test: abort on unexpected log messages
Add two log functions, one that aborts on a received message. We know when we
expect to receive an error, so anytime this happens unexpectedly should
terminate the test.

And for those tests do issue a log message, let them ignore it and don't
print anything.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-22 09:14:40 +10:00
Peter Hutterer
fd3118ea1a test: detect if we're running inside gdb and disable forking
The Check test framework forks by default which is annoying when running gdb.
Try to detect whether we're inside gdb by ptracing ourselves. If that works,
we're not inside a debugger. If it doesn't, then assume we're inside a
debugger and set CK_FORK to "no".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-24 09:14:12 +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
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
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
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