#!/bin/bash set -e if [ -z "$PSPDEV" ]; then echo "PSPDEV environment variable is not set. Please set it to the path of your PSP development environment." exit 1 fi # PPSSPP doesn't ship a standard Linux package -- build its "PPSSPPHeadless" # target from source (https://github.com/hrydgard/ppsspp) and either put it # on PATH or point PPSSPP_HEADLESS_BIN at it. See docker/psp-test/Dockerfile # for a from-scratch build. PPSSPP_HEADLESS_BIN="${PPSSPP_HEADLESS_BIN:-PPSSPPHeadless}" if ! command -v "$PPSSPP_HEADLESS_BIN" >/dev/null 2>&1; then echo "$PPSSPP_HEADLESS_BIN not found. Build PPSSPP's 'PPSSPPHeadless' target" echo "from source or set PPSSPP_HEADLESS_BIN to its path." exit 1 fi ./scripts/build-psp.sh DUSK_TEST_PPSSPP_SECONDS="${DUSK_TEST_PPSSPP_SECONDS:-20}" EBOOT="build-psp/EBOOT.PBP" echo "Booting $EBOOT in PPSSPPHeadless (timeout ${DUSK_TEST_PPSSPP_SECONDS}s)..." # PPSSPPHeadless is purpose-built for automated/CI runs -- it renders # without a window and is expected to exit on its own once --timeout # elapses, unlike Dolphin's batch mode which has to be killed externally. # Check `"$PPSSPP_HEADLESS_BIN" --help` if these flags don't match your # PPSSPP checkout -- the headless CLI has changed across versions. set +e "$PPSSPP_HEADLESS_BIN" --timeout="${DUSK_TEST_PPSSPP_SECONDS}" "$EBOOT" status=$? set -e if [ "$status" -ne 0 ]; then echo "PPSSPPHeadless exited with status $status" exit "$status" fi echo "PSP smoke test passed (PPSSPPHeadless ran EBOOT.PBP for ${DUSK_TEST_PPSSPP_SECONDS}s without crashing)."