summaryrefslogtreecommitdiff
path: root/src/glsl/glcpp/tests
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-07-19 17:49:23 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-07-20 17:01:11 -0700
commitd1500f8a195b7afe871cd768a5d33ecfecad5f31 (patch)
treeebb9d988b9be7468257b8bf2f0eda45c2528384b /src/glsl/glcpp/tests
parent3a530b8ef68a40526b33de2af8de85f71ebdb30d (diff)
glcpp: Make test suite test for valgrind cleanliness.
As it turns out, 4 of our current tests are not valgrind clean, (use after free errors or so), so this will be helpful for investigating and fixing those.
Diffstat (limited to 'src/glsl/glcpp/tests')
-rwxr-xr-xsrc/glsl/glcpp/tests/glcpp-test22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/glsl/glcpp/tests/glcpp-test b/src/glsl/glcpp/tests/glcpp-test
index 8277719715..cfe7e97878 100755
--- a/src/glsl/glcpp/tests/glcpp-test
+++ b/src/glsl/glcpp/tests/glcpp-test
@@ -2,7 +2,9 @@
total=0
pass=0
+clean=0
+echo "====== Testing for correctness ======"
for test in *.c; do
echo -n "Testing $test..."
../glcpp < $test > $test.out
@@ -16,10 +18,28 @@ for test in *.c; do
fi
done
+echo ""
echo "$pass/$total tests returned correct results"
echo ""
-if [ "$pass" = "$total" ] ; then
+echo "====== Testing for valgrind cleanliness ======"
+for test in *.c; do
+ echo -n "Testing $test with valgrind..."
+ if valgrind --error-exitcode=1 --log-file=$test.valgrind-errors ../glcpp < $test >/dev/null; then
+ echo "CLEAN"
+ clean=$((clean+1))
+ rm $test.valgrind-errors
+ else
+ echo "ERRORS"
+ cat $test.valgrind-errors
+ fi
+done
+
+echo ""
+echo "$pass/$total tests returned correct results"
+echo "$clean/$total tests are valgrind-clean"
+
+if [ "$pass" = "$total" ] && [ "$clean" = "$total" ]; then
exit 0
else
exit 1