#!/usr/bin/env bash # H6: renders every capture scenario in test/capture/ to captures/qa/.png, one # container at a time, plus the HUD at 3840x2160, and writes contact sheets of four to # captures/qa/sheets/. Waits while the host has under 1.5 GB of memory available. # Plays `make match` first, since the match_* scenarios replay its log. Needs Docker. # About 40 minutes. Open every image and judge it against docs/VISUAL_QA.md. set -uo pipefail cd "$(dirname "${BASH_SOURCE[0]}")/.." mkdir -p captures/qa nice -n 15 make match >/dev/null 2>&1 || { echo "qa-captures FAIL: make match"; exit 1; } status=0 for path in test/capture/*.tscn; do scene="$(basename "$path" .tscn)" [[ "$scene" == blank || "$scene" == smoke ]] && continue while (( $(awk '/MemAvailable/ {print int($2 / 1024)}' /proc/meminfo) < 1500 )); do echo "qa-captures: waiting for memory" sleep 30 done if tools/capture.sh "$scene" "captures/qa/$scene.png" >"captures/qa/$scene.log" 2>&1; then echo "ok $scene" else echo "FAIL $scene (captures/qa/$scene.log)" status=1 fi done CAPTURE_SIZE=3840x2160 tools/capture.sh client_hud captures/qa/hud_2160.png >/dev/null 2>&1 || { echo "FAIL hud_2160"; status=1; } tools/godot.sh --script res://tools/contact_sheet.gd -- --dir=res://captures/qa --out=res://captures/qa/sheets || status=1 [[ "$status" -eq 0 ]] && echo "qa-captures: ok (captures/qa, sheets in captures/qa/sheets)" exit "$status"