Files

18 lines
667 B
Bash
Executable File

#!/usr/bin/env bash
# Regenerates every transcript in output/. Needs JDK 21+ and Maven 3.9+.
set -euo pipefail
cd "$(dirname "$0")/.."
mkdir -p output
./scripts/run.sh > output/01-walkthrough.txt 2>&1
mvn -B -q test > /dev/null
python3 - <<'PY' > output/02-test-results.txt
import glob, xml.etree.ElementTree as ET
total = fail = 0
for f in sorted(glob.glob("target/surefire-reports/TEST-*.xml")):
for tc in ET.parse(f).getroot().iter("testcase"):
bad = tc.find("failure") is not None or tc.find("error") is not None
total += 1; fail += bad
print(("FAIL " if bad else "PASS ") + tc.get("name"))
print(f"{total} tests, {fail} failures")
PY