ci: dedupe weston setup
We're doing almost the same thing 3 times; let's put that in a script. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36485>
This commit is contained in:
committed by
Marge Bot
parent
812fad7065
commit
8e71665468
@@ -187,22 +187,14 @@ if [ -n "$HWCI_START_XORG" ]; then
|
||||
fi
|
||||
|
||||
if [ -n "$HWCI_START_WESTON" ]; then
|
||||
WESTON_X11_SOCK="/tmp/.X11-unix/X0"
|
||||
if [ -n "$HWCI_START_XORG" ]; then
|
||||
echo "Please consider dropping HWCI_START_XORG and instead using Weston XWayland for testing."
|
||||
# shellcheck disable=2034
|
||||
WESTON_X11_SOCK="/tmp/.X11-unix/X1"
|
||||
fi
|
||||
WAYLAND_DISPLAY=wayland-0
|
||||
|
||||
# Display server is Weston Xwayland when HWCI_START_XORG is not set or Xorg when it's
|
||||
export DISPLAY=:0
|
||||
mkdir -p /tmp/.X11-unix
|
||||
|
||||
weston --config="/install/common/weston.ini" --socket="$WAYLAND_DISPLAY" --renderer=gl &
|
||||
. /install/common/weston.sh --renderer=gl
|
||||
BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
|
||||
export WAYLAND_DISPLAY
|
||||
|
||||
while [ ! -S "$WESTON_X11_SOCK" ]; do sleep 1; done
|
||||
fi
|
||||
|
||||
set +x
|
||||
|
||||
14
.gitlab-ci/common/weston.sh
Executable file
14
.gitlab-ci/common/weston.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CI_COMMON_DIR=$(dirname -- "${BASH_SOURCE[0]}")
|
||||
|
||||
# init-stage2.sh overwrites this when xorg is already started
|
||||
WESTON_X11_SOCK=${WESTON_X11_SOCK:-/tmp/.X11-unix/X0}
|
||||
mkdir -p /tmp/.X11-unix
|
||||
export DISPLAY=:0
|
||||
|
||||
WAYLAND_DISPLAY=wayland-0
|
||||
weston --config="$CI_COMMON_DIR/weston.ini" --socket="$WAYLAND_DISPLAY" "$@" &
|
||||
export WAYLAND_DISPLAY
|
||||
|
||||
while [ ! -S "$WESTON_X11_SOCK" ]; do sleep 1; done
|
||||
@@ -90,18 +90,7 @@ elif [ "$PIGLIT_PLATFORM" = "mixed_glx_egl" ]; then
|
||||
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl"
|
||||
else
|
||||
SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl --profile core"
|
||||
# copy-paste from init-stage2.sh, please update accordingly
|
||||
{
|
||||
WESTON_X11_SOCK="/tmp/.X11-unix/X0"
|
||||
WAYLAND_DISPLAY=wayland-0
|
||||
export DISPLAY=:0
|
||||
mkdir -p /tmp/.X11-unix
|
||||
|
||||
weston --config="/install/common/weston.ini" --socket="$WAYLAND_DISPLAY" --renderer=gl &
|
||||
export WAYLAND_DISPLAY
|
||||
|
||||
while [ ! -S "$WESTON_X11_SOCK" ]; do sleep 1; done
|
||||
}
|
||||
. /install/common/weston.sh --renderer=gl
|
||||
fi
|
||||
|
||||
# If the job is parallel at the gitlab job level, will take the corresponding
|
||||
|
||||
Reference in New Issue
Block a user