Commit Graph

16 Commits

Author SHA1 Message Date
Daniel Stone f360818960 tests/xwayland: Ensure $DISPLAY is correctly set
We rely on the Xwayland launcher setting $DISPLAY to connect to our own
X server. Make very sure in the tests that we're actually getting that
set properly.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone d0301c9a82 tests/xwayland: Don't leak XCB reply
Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-04-19 10:17:19 +01:00
Marius Vlad 06b57e1dda tests/xwayland-test: Also print out Weston log messages
We don't accumulate log scopes with was previous set internally so
enable the "log" scope (explicitly) for the xwayland-test to see what
Weston prints out.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-03-31 09:06:24 +03:00
Marius Vlad 14ca04609a tests/xwayland: Enable xwayland XWM debug log scope and more debug
We're still timing out with our basic xwayland test in CI, so this
enables the XWM logging scope, and enables some further print debugs we
have available in our helper library, in an attempt to further
investigate and determine why we're still timing out.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-03-28 12:45:13 +03:00
Marius Vlad 640a3c7165 xcb-client-helper: Add a XCB client helper for tests
This patch introduces a small library wrapper around XCB to be used in
Xwayland tests.

It's being designed such that we do not advance without accounting for
all X11 events when changing the window state.  It adds a fence that
waits for all events to be processed, and only after all the events have
been accounted for, to proceed further, resuming execution of the
tests.

This works by keeping a tentative_state list for the client and a
window state that gets applied when the event we waited for has been
received.

This is useful in test clients, which could verify at the end after
receiving all events that the correct state has been applied. Acts as a
way to verify that the we never get or have a different state than the
one we expect.

With it, this converts test-xwayland to using libxcb (together with
xcb-cursor-dev) rather than using Xlib, and with it it removes any Xlib
dependency we might have in the tests.

This only adds support for map/unmap/create/destroy/property notify.
A follow-up would be to expand this library to track window movement
and resizing.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-03-03 08:30:46 +00:00
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
Daniel Stone 23f7e26978 tests/xwayland: Remove manual timeout implementation
One of the best things about a real test framework is that they handle
timeouts for you.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Simon Ser <contact@emersion.fr>
2021-12-14 14:57:40 +00:00
Pekka Paalanen 56b94b5894 tests: migrate xwayland
Move xwayland test to the new harness.

This is the only test that can actually skip. It does it by exit(77) and that
is fine, because there is only one test case in the file so far. To get rid of
the exit() calls we need to return a value from the TEST() function but that is
a big surgery for another time.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:35 +00:00
Pekka Paalanen 54c03dfe51 tests/xwayland: do not call exit(SUCCESS)
Successful tests should just return, not call exit() which breaks the new test
harness when it uses TAP.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-22 12:54:32 +02:00
Daniel Stone 2295a62788 tests: Skip Xwayland test if binary isn't available
We know we're not going to succeed if the binary isn't installed, so
skip the test in that case.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-11-30 10:28:04 +00:00
Bryce Harrington 2cc9297aca tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
Bryce Harrington a20db38437 tests: Fix Samsung copyright assignment on xwayland test 2015-05-05 11:16:51 -07:00
Derek Foreman 8771a14ff3 xwayland-test: Replace the xwayland-test
The old xwayland-test hasn't worked in a while...

This new test checks that the wayland specific WL_SURFACE_ID atom exists,
checks that the window manager name is "Weston WM" and then maps a window
and waits for an exposure event.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
2015-01-30 12:21:39 -08:00
Bryce Harrington a76802685a tests: Cleanup superfluous headers
Mostly remove headers that aren't actually needed for anything.
Add stdint.h to permit dropping xf86drm.h, which is otherwise unneeded.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: Marek Chalupa <mchqwerty@gmail.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-28 15:54:31 +02:00
Bryce Harrington 12cc4055ff tests: Include "config.h" as first header
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-11-28 15:52:56 +02:00
Tiago Vignatti 19dadf2617 tests: Add XWayland test
By default enabled but one can disable it by passing --disable-xwayland-test
to the configure script. Also, the weston-tests-env script is trying to load
xwayland.so in either case, but it behaves resilient in the absence of that
meaning all the other tests are still going to be kicked for running.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-02-08 12:18:05 -05:00