From f066acf6450fcca60251eef6821cebd8f1ca9af3 Mon Sep 17 00:00:00 2001
From: Florian Hahn <flo@fhahn.com>
Date: Tue, 30 Dec 2014 16:46:07 +0100
Subject: [PATCH] src/grammar/check.sh now prints test summary

---
 src/grammar/check.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/grammar/check.sh b/src/grammar/check.sh
index f2836312437..cb269bbdb0a 100755
--- a/src/grammar/check.sh
+++ b/src/grammar/check.sh
@@ -11,6 +11,10 @@ if [ "${VERBOSE}" == "1" ]; then
     set -x
 fi
 
+passed=0
+failed=0
+skipped=0
+
 check() {
     grep --silent "// ignore-lexer-test" $1;
 
@@ -21,14 +25,27 @@ check() {
         # seem to have anny effect.
         if $3 RustLexer tokens -tokens < $1 | $4 $1 $5; then
             echo "pass: $1"
+            passed=`expr $passed + 1`
         else
             echo "fail: $1"
+            failed=`expr $failed + 1`
         fi
     else
         echo "skip: $1"
+        skipped=`expr $skipped + 1`
     fi
 }
 
 for file in $(find $1 -iname '*.rs' ! -path '*/test/compile-fail*'); do
     check $file $2 $3 $4 $5
 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
+