summaryrefslogtreecommitdiff
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
parent821399a9c920323e4934a2fd6375b86a151fa83c (diff)
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>
-rw-r--r--.gitlab-ci/debian-install.sh33
-rw-r--r--hw/xwayland/meson.build2
-rw-r--r--test/Makefile.am6
-rw-r--r--test/meson.build13
-rwxr-xr-xtest/scripts/xwayland-piglit.sh43
5 files changed, 95 insertions, 2 deletions
diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh
index 01db613e5..07f09388a 100644
--- a/.gitlab-ci/debian-install.sh
+++ b/.gitlab-ci/debian-install.sh
@@ -6,6 +6,11 @@ set -o xtrace
# Packages which are needed by this script, but not for the xserver build
EPHEMERAL="
git
+ libcairo2-dev
+ libevdev-dev
+ libexpat-dev
+ libgles2-mesa-dev
+ libinput-dev
libxkbcommon-dev
x11-utils
x11-xserver-utils
@@ -24,15 +29,21 @@ apt-get install -y \
flex \
libaudit-dev \
libbsd-dev \
+ libcairo2 \
libdbus-1-dev \
libdmx-dev \
libdrm-dev \
libegl1-mesa-dev \
libepoxy-dev \
+ libevdev2 \
+ libexpat1 \
+ libffi-dev \
libgbm-dev \
libgcrypt-dev \
libgl1-mesa-dev \
+ libgles2 \
libglx-mesa0 \
+ libinput10 \
libnvidia-egl-wayland-dev \
libpciaccess-dev \
libpixman-1-dev \
@@ -41,7 +52,6 @@ apt-get install -y \
libtool \
libudev-dev \
libunwind-dev \
- libwayland-dev \
libx11-dev \
libx11-xcb-dev \
libxau-dev \
@@ -66,6 +76,7 @@ apt-get install -y \
libxfont-dev \
libxi-dev \
libxinerama-dev \
+ libxkbcommon0 \
libxkbfile-dev \
libxmu-dev \
libxmuu-dev \
@@ -92,6 +103,14 @@ apt-get install -y \
cd /root
+# weston 9.0 requires libwayland >= 1.18
+git clone https://gitlab.freedesktop.org/wayland/wayland.git --depth 1 --branch=1.18.0
+cd wayland
+meson _build -D{documentation,dtd_validation}=false
+ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
+cd ..
+rm -rf wayland
+
# Xwayland requires wayland-protocols >= 1.18, but Debian buster has 1.17 only
git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git --depth 1 --branch=1.18
cd wayland-protocols
@@ -100,6 +119,18 @@ make -j${FDO_CI_CONCURRENT:-4} install
cd ..
rm -rf wayland-protocols
+# Xwayland requires weston > 5.0, but Debian buster has 5.0 only
+git clone https://gitlab.freedesktop.org/wayland/weston.git --depth 1 --branch=9.0
+cd weston
+meson _build -Dbackend-{drm,drm-screencast-vaapi,fbdev,rdp,wayland,x11}=false \
+ -Dbackend-default=headless -Dcolor-management-{colord,lcms}=false \
+ -Ddemo-clients=false -Dimage-{jpeg,webp}=false \
+ -D{pipewire,remoting,screenshare,test-junit-xml,wcap-decode,weston-launch,xwayland}=false \
+ -Dshell-{fullscreen,ivi,kiosk}=false -Dsimple-clients=
+ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
+cd ..
+rm -rf weston
+
git clone https://gitlab.freedesktop.org/mesa/piglit.git --depth 1
git clone https://gitlab.freedesktop.org/xorg/test/xts --depth 1
diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build
index d6772957b..74895bbec 100644
--- a/hw/xwayland/meson.build
+++ b/hw/xwayland/meson.build
@@ -112,7 +112,7 @@ if build_glx
wayland_inc += glx_inc
endif
-executable(
+xwayland_server = executable(
'Xwayland',
srcs,
include_directories: wayland_inc,
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