Gives Claude eyes: `make screenshot` captures a rendered frame, `make test-visual` compares against golden PNGs, `make visual-update` regenerates goldens. Built to debug the Sprint 22 fog regression and prevent future visual regressions across fog, HUD, dialogue, and UI. Config-driven via tests/visual.json (11 scenarios, 2 flows). Capture engine boots main.tscn with real GPU rendering (not --headless), waits for NoiseTexture2D async gen, uses deterministic shader time. Components: - visual_capture.gd: SceneTree capture engine (scenario + movie modes) - visual_scenarios.gd: per-scenario setup hooks - tooling/visual-diff: pixel comparator (PIL primary, struct fallback) - tooling/visual-thumbnail: contact sheet + crop tool - tests/run-visual: suite script (xvfb wrapping, golden workflow) - fog_state.gd: override_time for deterministic captures - fog_shader.gd: fog_noise_ready signal for settle sequencing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
79 lines
2.2 KiB
Bash
Executable File
79 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# tests/run-all: Run all test suites in order (D-030)
|
|
# Invokes run-rust, run-godot, run-ipc-fixtures, run-ipc-protocol, run-ipc-integration.
|
|
# Exit: 0 = all suites pass, non-zero = any suite failed
|
|
# Stdout: {"suite":"all","total":N,"passed":N,"failed":N,"duration_ms":N,"suites":[...]}
|
|
set -euo pipefail
|
|
|
|
FILTER=""
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
--filter) FILTER="${2:-}"; shift 2 ;;
|
|
--filter=*) FILTER="${1#--filter=}"; shift ;;
|
|
*) echo "Unknown argument: $1" >&2; exit 2 ;;
|
|
esac
|
|
done
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
PASS_ARGS=()
|
|
[[ -n "$FILTER" ]] && PASS_ARGS+=(--filter "$FILTER")
|
|
|
|
SUITES=(
|
|
run-rust
|
|
run-godot
|
|
run-ipc-fixtures
|
|
run-ipc-protocol
|
|
run-ipc-integration
|
|
run-visual
|
|
)
|
|
|
|
START_MS=$(date +%s%3N)
|
|
|
|
OVERALL_TOTAL=0
|
|
OVERALL_PASSED=0
|
|
OVERALL_FAILED=0
|
|
OVERALL_EXIT=0
|
|
SUITE_RESULTS=""
|
|
|
|
for suite in "${SUITES[@]}"; do
|
|
script="$SCRIPT_DIR/$suite"
|
|
if [[ ! -x "$script" ]]; then
|
|
echo "Warning: $script not found or not executable — skipping" >&2
|
|
continue
|
|
fi
|
|
|
|
SUITE_OUT=$(mktemp)
|
|
set +e
|
|
"$script" "${PASS_ARGS[@]}" >"$SUITE_OUT"
|
|
SUITE_EXIT=$?
|
|
set -e
|
|
|
|
SUITE_JSON=$(cat "$SUITE_OUT")
|
|
rm -f "$SUITE_OUT"
|
|
|
|
# Accumulate totals from the suite's JSON output
|
|
S_TOTAL=$(echo "$SUITE_JSON" | grep -oE '"total":[0-9]+' | grep -oE '[0-9]+' || echo 0)
|
|
S_PASSED=$(echo "$SUITE_JSON" | grep -oE '"passed":[0-9]+' | grep -oE '[0-9]+' || echo 0)
|
|
S_FAILED=$(echo "$SUITE_JSON" | grep -oE '"failed":[0-9]+' | grep -oE '[0-9]+' || echo 0)
|
|
|
|
OVERALL_TOTAL=$(( OVERALL_TOTAL + ${S_TOTAL:-0} ))
|
|
OVERALL_PASSED=$(( OVERALL_PASSED + ${S_PASSED:-0} ))
|
|
OVERALL_FAILED=$(( OVERALL_FAILED + ${S_FAILED:-0} ))
|
|
[[ $SUITE_EXIT -ne 0 ]] && OVERALL_EXIT=1
|
|
|
|
# Build suites array for JSON
|
|
if [[ -n "$SUITE_RESULTS" ]]; then
|
|
SUITE_RESULTS="$SUITE_RESULTS,$SUITE_JSON"
|
|
else
|
|
SUITE_RESULTS="$SUITE_JSON"
|
|
fi
|
|
done
|
|
|
|
END_MS=$(date +%s%3N)
|
|
DURATION_MS=$((END_MS - START_MS))
|
|
|
|
printf '{"suite":"all","total":%d,"passed":%d,"failed":%d,"duration_ms":%d,"suites":[%s]}\n' \
|
|
"$OVERALL_TOTAL" "$OVERALL_PASSED" "$OVERALL_FAILED" "$DURATION_MS" "$SUITE_RESULTS"
|
|
exit $OVERALL_EXIT
|