test: selfhost multi-error recovery regression fixture
This commit is contained in:
@@ -140,6 +140,11 @@ test-errors: ensure-buxc
|
||||
@chmod +x tests/error_golden/run.sh
|
||||
@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
|
||||
@echo "=== Stdlib golden tests ==="
|
||||
@chmod +x tests/stdlib_golden/run.sh
|
||||
|
||||
Executable
+25
@@ -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"
|
||||
Reference in New Issue
Block a user