mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 17:18:38 +00:00
The session script ran wineboot and wineserver from PATH while run_wine_tests.py runs the tests with $WINE. With WINE set to Proton's or UMU-Proton's files/bin/wine, the prefix was initialized by another Wine, or the script stopped at 'wineboot: command not found' on a host without a system Wine, and the exit trap stopped the wrong wineserver. Run "$WINE" wineboot --init and stop $WINESERVER, else the wineserver next to $WINE, else wineserver on PATH; report a missing $WINE with status 127.
24 lines
943 B
Bash
Executable File
24 lines
943 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Run CI tests on the display that initialized their dedicated Wine prefix.
|
|
#
|
|
# The prefix is initialized and stopped with the Wine the tests use: $WINE (default: wine), as
|
|
# run_wine_tests.py does, so Proton's or UMU-Proton's files/bin/wine also works on a host without a
|
|
# system Wine. The wineserver is $WINESERVER, else the one next to $WINE, else wineserver on PATH.
|
|
set -e
|
|
: "${WINEPREFIX:?Set WINEPREFIX to a dedicated test prefix}"
|
|
|
|
wine=${WINE:-wine}
|
|
if ! wine_path=$(command -v -- "$wine"); then
|
|
echo "run_wine_session.sh: Wine not found: $wine (set WINE to the wine executable)" >&2
|
|
exit 127
|
|
fi
|
|
if [[ -z ${WINESERVER:-} ]]; then
|
|
WINESERVER=$(dirname -- "$wine_path")/wineserver
|
|
[[ -x $WINESERVER ]] || WINESERVER=wineserver
|
|
fi
|
|
|
|
# Stop this prefix's Wine processes before Xvfb tears down the display.
|
|
trap '"$WINESERVER" -k || true' EXIT
|
|
timeout 5m "$wine_path" wineboot --init </dev/null
|
|
"$@" </dev/null
|