diff options
Diffstat (limited to 'docs/history/10-zc/code/tests/runerr.sh')
| -rwxr-xr-x | docs/history/10-zc/code/tests/runerr.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/history/10-zc/code/tests/runerr.sh b/docs/history/10-zc/code/tests/runerr.sh new file mode 100755 index 0000000..c1d42c5 --- /dev/null +++ b/docs/history/10-zc/code/tests/runerr.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# runs every tests/errors/*.zc and checks the compiler rejects it with the expected message +vm=${1:-zy}; pass=0; fail=0 +for f in "$(dirname "$0")"/errors/*.zc; do + want=$(head -1 "$f" | sed 's#^// expect: ##') + got=$($vm < "$f" 2>&1 | head -1) + if [[ "$got" == *"$want"* ]]; then pass=$((pass+1)); else fail=$((fail+1)); echo "FAIL $(basename $f): got [$got]"; fi +done +echo "analyzer rejects: $pass passed, $fail failed" |
