summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-07-19 17:48:17 -0700
committerCarl Worth <cworth@cworth.org>2010-07-20 14:30:47 -0700
commitfa742569cbec185a50130d00a46eac5372f52441 (patch)
tree31550e1198bac776fb8b2ada0997646beee032e5
parentf6d91d32b24a064da256bd2f2118a1f2722e98d0 (diff)
glcpp: Make test suite report final count of passed/total tests.
And report PASS or FAIL for each test along the way as well.
-rwxr-xr-xsrc/glsl/glcpp/tests/glcpp-test24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/glsl/glcpp/tests/glcpp-test b/src/glsl/glcpp/tests/glcpp-test
index 396f6e175e..8277719715 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
+