test: add litest-runner as test suite runner
authorPeter Hutterer <peter.hutterer@who-t.net>
Sat, 12 Oct 2024 00:31:42 +0000 (10:31 +1000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 30 Oct 2024 23:20:42 +0000 (23:20 +0000)
commit41c08f081627e206e16acbcfbd9157ac9944b921
tree75ffe8f623dbeb7dfb483eb775b0c999f35308f1
parentd94407f810db6ab3bfe837bb4682f60bfdd601d1
test: add litest-runner as test suite runner

This replaces check. The code is a copy of pwtest which I wrote years
ago for pipewire but adjusted for us here the last few days.

There are a few advantages over check:
- Ability to SKIP tests or mark them as NOT_APPLICABLE, the latter
  of which is used for early checks if a device doesn't meet
  requirements.
- it captures stdout/stderr separately
- colors!
- YAML output format makes it a lot easier to read the results and
  eventually parse them for e.g. "restart failed tests"

Less abstraction: we set up the tests, pass them to the runner and run
them with the given number of forks. This is an improvement over before
where we forked into N test suites which each called check which then
forked again. Since we're now keeping track of those processes
ourselves we can also write tests that are expected to fail with
signals.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>
25 files changed:
meson.build
test/litest-runner.c [new file with mode: 0644]
test/litest-runner.h [new file with mode: 0644]
test/litest-selftest.c
test/litest.c
test/litest.h
test/test-device.c
test/test-gestures.c
test/test-keyboard.c
test/test-log.c
test/test-misc.c
test/test-pad.c
test/test-path.c
test/test-pointer.c
test/test-quirks.c
test/test-switch.c
test/test-tablet.c
test/test-totem.c
test/test-touch.c
test/test-touchpad-buttons.c
test/test-touchpad-tap.c
test/test-touchpad.c
test/test-trackball.c
test/test-trackpoint.c
test/test-udev.c