Mesa (glsl2): glcpp: Make test suite report final count of passed/ total tests.

Ian Romanick idr at kemper.freedesktop.org
Wed Jul 21 00:07:46 UTC 2010


Module: Mesa
Branch: glsl2
Commit: 3a530b8ef68a40526b33de2af8de85f71ebdb30d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3a530b8ef68a40526b33de2af8de85f71ebdb30d

Author: Carl Worth <cworth at cworth.org>
Date:   Mon Jul 19 17:48:17 2010 -0700

glcpp: Make test suite report final count of passed/total tests.

And report PASS or FAIL for each test along the way as well.

---

 src/glsl/glcpp/tests/glcpp-test |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/glsl/glcpp/tests/glcpp-test b/src/glsl/glcpp/tests/glcpp-test
index 396f6e1..8277719 100755
--- a/src/glsl/glcpp/tests/glcpp-test
+++ b/src/glsl/glcpp/tests/glcpp-test
@@ -1,7 +1,27 @@
 #!/bin/sh
 
+total=0
+pass=0
+
 for test in *.c; do
-    echo "Testing $test"
+    echo -n "Testing $test..."
     ../glcpp < $test > $test.out
-    diff -u $test.expected $test.out
+    total=$((total+1))
+    if cmp $test.expected $test.out; then
+	echo "PASS"
+	pass=$((pass+1))
+    else
+	echo "FAIL"
+	diff -u $test.expected $test.out
+    fi
 done
+
+echo "$pass/$total tests returned correct results"
+echo ""
+
+if [ "$pass" = "$total" ] ; then
+    exit 0
+else
+    exit 1
+fi
+




More information about the mesa-commit mailing list