blob: c1d42c5387670398cb7692636947c88a20c03c68 (
plain) (
blame)
1
2
3
4
5
6
7
8
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"
|