Skip to content

Commit f066acf

Browse files
committed
src/grammar/check.sh now prints test summary
1 parent b41a24f commit f066acf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/grammar/check.sh

+17
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ if [ "${VERBOSE}" == "1" ]; then
1111
set -x
1212
fi
1313

14+
passed=0
15+
failed=0
16+
skipped=0
17+
1418
check() {
1519
grep --silent "// ignore-lexer-test" $1;
1620

@@ -21,14 +25,27 @@ check() {
2125
# seem to have anny effect.
2226
if $3 RustLexer tokens -tokens < $1 | $4 $1 $5; then
2327
echo "pass: $1"
28+
passed=`expr $passed + 1`
2429
else
2530
echo "fail: $1"
31+
failed=`expr $failed + 1`
2632
fi
2733
else
2834
echo "skip: $1"
35+
skipped=`expr $skipped + 1`
2936
fi
3037
}
3138

3239
for file in $(find $1 -iname '*.rs' ! -path '*/test/compile-fail*'); do
3340
check $file $2 $3 $4 $5
3441
done
42+
43+
printf "\ntest result: "
44+
45+
if [ $failed -eq 0 ]; then
46+
printf "ok. $passed passed; $failed failed; $skipped skipped\n\n"
47+
else
48+
printf "failed. $passed passed; $failed failed; $skipped skipped\n\n"
49+
exit 1
50+
fi
51+

0 commit comments

Comments
 (0)