Files
mandy/scripts/run_wine_session.sh
aznohonza 6da607c096 scripts: --help on the Python and shell entry points
check_no_game_data.py read `--help` as a path and answered "cannot read --help", exit 2, in the tool every
contributor is told to run; it now prints the usage text it already carries and exits 0. play-linux.sh and
run_wine_session.sh print their usage before any environment check, where they used to answer with an error
(and play-linux.sh's no-argument case still prints the same usage, on stderr, exit 2).

run_game_wine.sh's one-line Usage line names the required --shaders, which its Inputs section already listed.

A test per script fails on main's copies and passes here.
2026-12-01 10:29:39 +01:00

31 lines
1.3 KiB
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
if [[ ${1:-} == -h || ${1:-} == --help ]]; then
echo "usage: run_wine_session.sh COMMAND [ARG...]"
echo
echo "Runs COMMAND on the display that initialized the dedicated Wine prefix in WINEPREFIX, then stops that"
echo "prefix's Wine processes. WINE (default wine) and WINESERVER (default: the one next to WINE) choose the Wine."
exit 0
fi
: "${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