| 1 |
#!/bin/bash -e |
| 2 |
|
| 3 |
if test "x$XTEST_DIR" = "x"; then |
| 4 |
echo "XTEST_DIR must be set to the directory of the xtest repository." |
| 5 |
# Exit as a "skip" so make check works even without xtest. |
| 6 |
exit 77 |
| 7 |
fi |
| 8 |
|
| 9 |
if test "x$PIGLIT_DIR" = "x"; then |
| 10 |
echo "PIGLIT_DIR must be set to the directory of the piglit repository." |
| 11 |
# Exit as a "skip" so make check works even without piglit. |
| 12 |
exit 77 |
| 13 |
fi |
| 14 |
|
| 15 |
# this times out on Travis, because the tests take too long. |
| 16 |
if test "x$TRAVIS_BUILD_DIR" != "x"; then |
| 17 |
exit 77 |
| 18 |
fi |
| 19 |
|
| 20 |
# Weston requires XDG_RUNTIME_DIR |
| 21 |
if test "x$XDG_RUNTIME_DIR" = "x"; then |
| 22 |
export XDG_RUNTIME_DIR=$(mktemp -d) |
| 23 |
fi |
| 24 |
|
| 25 |
# Skip if weston isn't available |
| 26 |
weston --version >/dev/null || exit 77 |
| 27 |
|
| 28 |
weston --no-config --backend=headless-backend.so --socket=wayland-$$ & |
| 29 |
WESTON_PID=$! |
| 30 |
export WAYLAND_DISPLAY=wayland-$$ |
| 31 |
|
| 32 |
# Need to kill weston before exiting, or meson will time out waiting for it to terminate |
| 33 |
# We rely on bash's behaviour, which executes the EXIT trap handler even if the shell is |
| 34 |
# terminated due to receiving a signal |
| 35 |
trap 'kill $WESTON_PID' EXIT |
| 36 |
|
| 37 |
# Wait for weston to initialize before starting Xwayland |
| 38 |
if ! timeout 5s bash -c "while ! $XSERVER_BUILDDIR/hw/xwayland/Xwayland -pogo -displayfd 1 &>/dev/null; do sleep 1; done"; then |
| 39 |
# Try running Xwayland one more time, so we can propagate its stdout/stderr |
| 40 |
# output and exit status |
| 41 |
$XSERVER_BUILDDIR/hw/xwayland/Xwayland -pogo -displayfd 1 |
| 42 |
fi |
| 43 |
|
| 44 |
# Start an Xwayland server |
| 45 |
export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xwayland |
| 46 |
export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/xwayland/Xwayland -noreset" |
| 47 |
|
| 48 |
# Make sure glamor doesn't use HW acceleration |
| 49 |
export GBM_ALWAYS_SOFTWARE=1 |
| 50 |
|
| 51 |
# Tests that currently fail on llvmpipe on CI |
| 52 |
PIGLIT_ARGS="$PIGLIT_ARGS -x xcleararea@6" |
| 53 |
PIGLIT_ARGS="$PIGLIT_ARGS -x xcleararea@7" |
| 54 |
PIGLIT_ARGS="$PIGLIT_ARGS -x xclearwindow@4" |
| 55 |
PIGLIT_ARGS="$PIGLIT_ARGS -x xclearwindow@5" |
| 56 |
PIGLIT_ARGS="$PIGLIT_ARGS -x xcopyarea@1" |
| 57 |
PIGLIT_ARGS="$PIGLIT_ARGS -x xsetfontpath@1" |
| 58 |
PIGLIT_ARGS="$PIGLIT_ARGS -x xsetfontpath@2" |
| 59 |
|
| 60 |
export PIGLIT_ARGS |
| 61 |
|
| 62 |
$XSERVER_DIR/test/scripts/run-piglit.sh |