Commit graph

7 commits

Author SHA1 Message Date
Daniel Stone c129bda562 tests: Use test-desktop-shell more widely
There's no need to spin up the full desktop-shell for the vast majority
of our tests. Rework them to use weston-test-desktop-shell, which is
more lightweight and sensible.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-11-04 10:24:42 +00:00
Simon Ser b46d0e3304 tests/roles: switch to xdg-shell
Stop using wl_shell for the roles tests, since it'll get disabled
and removed eventually.

Signed-off-by: Simon Ser <contact@emersion.fr>
2021-07-23 17:26:02 +01:00
Pekka Paalanen fc26bdb2fb tests: clean up in roles-test
This fixes all ASan reported leaks in this test.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-06-23 15:20:25 +03:00
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
Bryce Harrington 2cc9297aca tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
Pekka Paalanen 4ac06ff97e tests: rename client_create to create_client_and_test_surface
A more descriptive name to not be confused with create_client().

v2: Rebased: fix also devices-test.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
2015-04-02 12:54:27 +03:00
Pekka Paalanen 3c5f1c76b2 tests: add role conflict sub-surface vs. wl_shell_surface
Add tests for triggering the role conflict when a wl_surface is already
a wl_shell_surface and then attempted to be made into a sub-surface, and
vice versa.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2014-10-08 13:16:40 +03:00