src/grammar/check.sh now prints test summary
This commit is contained in:
parent
b41a24f314
commit
f066acf645
1 changed files with 17 additions and 0 deletions
|
@ -11,6 +11,10 @@ if [ "${VERBOSE}" == "1" ]; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
passed=0
|
||||||
|
failed=0
|
||||||
|
skipped=0
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
grep --silent "// ignore-lexer-test" $1;
|
grep --silent "// ignore-lexer-test" $1;
|
||||||
|
|
||||||
|
@ -21,14 +25,27 @@ check() {
|
||||||
# seem to have anny effect.
|
# seem to have anny effect.
|
||||||
if $3 RustLexer tokens -tokens < $1 | $4 $1 $5; then
|
if $3 RustLexer tokens -tokens < $1 | $4 $1 $5; then
|
||||||
echo "pass: $1"
|
echo "pass: $1"
|
||||||
|
passed=`expr $passed + 1`
|
||||||
else
|
else
|
||||||
echo "fail: $1"
|
echo "fail: $1"
|
||||||
|
failed=`expr $failed + 1`
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "skip: $1"
|
echo "skip: $1"
|
||||||
|
skipped=`expr $skipped + 1`
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
for file in $(find $1 -iname '*.rs' ! -path '*/test/compile-fail*'); do
|
for file in $(find $1 -iname '*.rs' ! -path '*/test/compile-fail*'); do
|
||||||
check $file $2 $3 $4 $5
|
check $file $2 $3 $4 $5
|
||||||
done
|
done
|
||||||
|
|
||||||
|
printf "\ntest result: "
|
||||||
|
|
||||||
|
if [ $failed -eq 0 ]; then
|
||||||
|
printf "ok. $passed passed; $failed failed; $skipped skipped\n\n"
|
||||||
|
else
|
||||||
|
printf "failed. $passed passed; $failed failed; $skipped skipped\n\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue