test: selfhost multi-error recovery regression fixture

This commit is contained in:
2026-07-28 20:59:30 +03:00
parent b8a920b235
commit c5b6ba3494
2 changed files with 30 additions and 0 deletions
+5
View File
@@ -140,6 +140,11 @@ test-errors: ensure-buxc
@chmod +x tests/error_golden/run.sh @chmod +x tests/error_golden/run.sh
@tests/error_golden/run.sh ./$(OUT) @tests/error_golden/run.sh ./$(OUT)
test-error-recovery: ensure-buxc selfhost
@echo "=== Selfhost multi-error recovery test ==="
@chmod +x _test_error_recovery/run.sh
@_test_error_recovery/run.sh
test-stdlib: ensure-buxc test-stdlib: ensure-buxc
@echo "=== Stdlib golden tests ===" @echo "=== Stdlib golden tests ==="
@chmod +x tests/stdlib_golden/run.sh @chmod +x tests/stdlib_golden/run.sh
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Regression: buxc2 must report ALL independent semantic errors in one run.
set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
ROOT="$(cd "$HERE/.." && pwd)"
BUXC2="$ROOT/build/selfhost/build/buxc2"
export BUX_STDLIB="$ROOT/lib"
if [[ ! -x "$BUXC2" ]]; then
echo "=== building selfhost (buxc2) ==="
(cd "$ROOT" && make selfhost)
fi
if [[ ! -x "$BUXC2" ]]; then
echo "error: buxc2 not found at $BUXC2" >&2
exit 1
fi
out="$(cd "$HERE" && "$BUXC2" check src/Main.bux 2>&1 || true)"
echo "$out"
grep -q "cannot assign String to int" <<<"$out"
grep -q "cannot assign int to bool" <<<"$out"
grep -q "undeclared identifier 'undefined_variable'" <<<"$out"
echo "PASS: all independent semantic errors reported in one run"