#!/bin/bash # Headless UI workflow self-test of the WINDOWS build, under Wine on a private # Xvfb display: the same ALKANE_SELFTEST check as scripts/ui-selftest.sh (bench # fixtures rendered through the real wxMSW widgets, read back, and compared), # run against alkane-toolkit.exe. CI runs this on every build; the native # Windows smoke job (.gitea/workflows/windows-native.yml) repeats it on real # Windows. # # Usage: scripts/ui-selftest-windows.sh [alkane-toolkit.exe] # defaults to the cross-built release binary in the cargo target dir. set -u REPO=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) EXE="${1:-}" if [ -z "$EXE" ]; then sh "$REPO/scripts/build-gui-windows.sh" || exit 3 TDIR=$(cd "$REPO" && cargo metadata --no-deps --format-version 1 --offline 2>/dev/null \ | tr ',' '\n' | grep -o '"target_directory":"[^"]*"' | head -1 | cut -d'"' -f4) EXE="${TDIR:-$REPO/target}/x86_64-pc-windows-gnu/release/alkane-toolkit.exe" fi [ -f "$EXE" ] || { echo "executable not found: $EXE" >&2; exit 3; } # xvfb-run picks a free display and cleans it up; Wine needs an X server for # the window even though the self-test never shows it to anyone. xvfb-run -a -s '-screen 0 1280x850x24' \ env ALKANE_SELFTEST=1 sh "$REPO/scripts/wine-run.sh" "$EXE" RC=$? echo "== ui-selftest-windows exit=$RC ==" exit "$RC"