summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2020-09-15 11:49:20 +0200
committerMichel Dänzer <michel@daenzer.net>2020-11-17 18:21:37 +0100
commit250db8708ac7ab11356b42faa493b6f1ba753013 (patch)
tree1b3ff261dc351a9d5ac404d24d1142181747cc07 /test
parent821399a9c920323e4934a2fd6375b86a151fa83c (diff)
downloadxserver-250db8708ac7ab11356b42faa493b6f1ba753013.tar.gz
xwayland: Add and hook up test script
It runs XTS via piglit on (non-rootless) Xwayland on weston using the headless backend. Xwayland might use glamor if enabled in the build, but we're making sure it uses software rendering. v2: * Use weston-info to wait for weston to be ready, instead of just a fixed sleep. (Martin Peres) v3: * Build wayland 1.18 & weston 9.0 locally, since the packages in Debian buster are too old for current Xwayland. Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am6
-rw-r--r--test/meson.build13
-rwxr-xr-xtest/scripts/xwayland-piglit.sh43
3 files changed, 62 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index ce07c3551..1f797530c 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -25,9 +25,14 @@ endif
endif
endif
+if XWAYLAND
+XWAYLAND_TESTS = scripts/xwayland-piglit.sh
+endif
+
SCRIPT_TESTS = \
$(XVFB_TESTS) \
$(XEPHYR_GLAMOR_TESTS) \
+ $(XWAYLAND_TESTS) \
$(NULL)
TESTS = tests \
@@ -188,6 +193,7 @@ EXTRA_DIST = \
scripts/xvfb-piglit.sh \
scripts/xephyr-glamor-piglit.sh \
scripts/xinit-piglit-session.sh \
+ scripts/xwayland-piglit.sh \
scripts/run-piglit.sh \
$(NULL)
diff --git a/test/meson.build b/test/meson.build
index 784100cca..d709dcf22 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -100,6 +100,19 @@ if get_option('xvfb')
endif
endif
+if build_xwayland
+ xwayland_args = [
+ xwayland_server.full_path(),
+ ]
+
+ test('XTS',
+ find_program('scripts/xwayland-piglit.sh'),
+ env: piglit_env,
+ timeout: 1200,
+ suite: 'xwayland'
+ )
+endif
+
subdir('bigreq')
subdir('damage')
subdir('sync')
diff --git a/test/scripts/xwayland-piglit.sh b/test/scripts/xwayland-piglit.sh
new file mode 100755
index 000000000..f0bb9727b
--- /dev/null
+++ b/test/scripts/xwayland-piglit.sh
@@ -0,0 +1,43 @@
+#!/bin/sh -e
+
+# this times out on Travis, because the tests take too long.
+if test "x$TRAVIS_BUILD_DIR" != "x"; then
+ exit 77
+fi
+
+# Weston requires XDG_RUNTIME_DIR
+if test "x$XDG_RUNTIME_DIR" = "x"; then
+ export XDG_RUNTIME_DIR=$(mktemp -d)
+fi
+
+# Skip if weston isn't available
+weston --version >/dev/null || exit 77
+
+weston --no-config --backend=headless-backend.so --socket=wayland-$$ &
+WESTON_PID=$!
+export WAYLAND_DISPLAY=wayland-$$
+
+# Wait for weston to initialize before starting Xwayland
+timeout --preserve-status 60s bash -c 'while ! weston-info &>/dev/null; do sleep 1; done'
+
+# Start an Xwayland server
+export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xwayland
+export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/xwayland/Xwayland -noreset"
+
+# Make sure glamor doesn't use HW acceleration
+export GBM_ALWAYS_SOFTWARE=1
+
+# Tests that currently fail on llvmpipe on CI
+PIGLIT_ARGS="$PIGLIT_ARGS -x xcleararea@6"
+PIGLIT_ARGS="$PIGLIT_ARGS -x xcleararea@7"
+PIGLIT_ARGS="$PIGLIT_ARGS -x xclearwindow@4"
+PIGLIT_ARGS="$PIGLIT_ARGS -x xclearwindow@5"
+PIGLIT_ARGS="$PIGLIT_ARGS -x xcopyarea@1"
+
+export PIGLIT_ARGS
+
+$XSERVER_DIR/test/scripts/run-piglit.sh
+PIGLIT_STATUS=$?
+
+kill $WESTON_PID
+exit $PIGLIT_STATUS