weston/tests
Pekka Paalanen babb3b3bc2 tests: thread-based client harness
This replaces the old test harness with a new one.

The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.

The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.

The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.

The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.

This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.

Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.

The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:34 +00:00
..
reference Optimize PNGs with zopflipng 2019-03-28 10:09:52 +00:00
bad-buffer-test.c shared: Use memfd_create() when available 2019-10-24 07:32:17 +00:00
config-parser-test.c tests/config-parser: Remove useless duplicate test 2019-11-28 19:24:13 +00:00
devices-test.c tests: Add test for seat destruction and creation 2018-02-15 13:14:57 +02:00
event-test.c tests: Move wl_pointer tests to their own file 2017-12-12 12:17:08 +02:00
input-timestamps-helper.c tests: replace fprintf() with testlog() 2019-11-22 12:54:10 +02:00
input-timestamps-helper.h tests: Introduce input timestamps helper 2018-02-20 10:20:29 +02:00
internal-screenshot-test.c tests: replace fprintf() with testlog() 2019-11-22 12:54:10 +02:00
internal-screenshot.ini tests: Add internal test for the weston test screenshot capability 2015-05-21 15:06:11 -07:00
ivi-layout-internal-test.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
ivi-layout-test-client.c tests: replace fprintf() with testlog() 2019-11-22 12:54:10 +02:00
ivi-layout-test-plugin.c tests/ivi: rename test_section 2019-11-22 16:09:20 +02:00
ivi-shell-app-test.c tests: replace fprintf() with testlog() 2019-11-22 12:54:10 +02:00
ivi-test.h ivi-shell: implement surface_on_many_layer test 2016-06-29 11:32:23 +03:00
keyboard-test.c libweston: Implement keyboard timestamps for input_timestamps_unstable_v1 2018-02-20 15:09:53 +02:00
linux-explicit-synchronization-test.c libweston: Advertise minor version 2 of zwp_linux_explicit_synchronization_v1 2019-08-02 15:00:08 +00:00
matrix-test.c Rename matrix.h to libweston/matrix.h 2019-04-18 12:31:46 +03:00
meson.build tests: thread-based client harness 2020-01-30 10:10:34 +00:00
plugin-registry-test.c tests: thread-based client harness 2020-01-30 10:10:34 +00:00
pointer-test.c libweston: Implement pointer timestamps for input_timestamps_unstable_v1 2018-02-20 15:09:53 +02:00
presentation-test.c tests: replace fprintf() with testlog() 2019-11-22 12:54:10 +02:00
roles-test.c tests: thread-based client harness 2020-01-30 10:10:34 +00:00
setbacklight.c tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
string-test.c tests: add missing include 2017-01-23 14:12:06 +02:00
subsurface-shot-test.c tests: thread-based client harness 2020-01-30 10:10:34 +00:00
subsurface-test.c tests: replace fprintf() with testlog() 2019-11-22 12:54:10 +02:00
surface-global-test.c libweston: Migrate functions that operate on 'weston_view' 2019-07-18 06:43:38 +00:00
surface-screenshot-test.c Unify the include style of shared/ headers 2019-10-04 16:04:48 +03:00
surface-test.c Rename compositor.h to libweston/libweston.h 2019-04-18 12:31:46 +03:00
text-test.c tests: replace fprintf() with testlog() 2019-11-22 12:54:10 +02:00
timespec-test.c Unify the include style of shared/ headers 2019-10-04 16:04:48 +03:00
touch-test.c libweston: Implement touch timestamps for input_timestamps_unstable_v1 2018-02-20 15:09:53 +02:00
vertex-clip-test.c Rename src/ to libweston/ 2016-06-23 17:44:54 +03:00
viewporter-test.c tests: replace fprintf() with testlog() 2019-11-22 12:54:10 +02:00
weston-test-client-helper.c tests: replace fprintf() with testlog() 2019-11-22 12:54:10 +02:00
weston-test-client-helper.h tests: Introduce input timestamps helper 2018-02-20 10:20:29 +02:00
weston-test-desktop-shell.c Use weston_compositor_add_destroy_listener_once() in plugins 2019-11-21 16:32:55 +00:00
weston-test-fixture-compositor.c tests: thread-based client harness 2020-01-30 10:10:34 +00:00
weston-test-fixture-compositor.h tests: thread-based client harness 2020-01-30 10:10:34 +00:00
weston-test-runner.c tests: thread-based client harness 2020-01-30 10:10:34 +00:00
weston-test-runner.h tests: thread-based client harness 2020-01-30 10:10:34 +00:00
weston-test.c tests: thread-based client harness 2020-01-30 10:10:34 +00:00
weston-testsuite-data.h tests: thread-based client harness 2020-01-30 10:10:34 +00:00
xwayland-test.c tests/xwayland: do not call exit(SUCCESS) 2019-11-22 12:54:32 +02:00