diff --git a/src/glsl/glcpp/tests/glcpp-test b/src/glsl/glcpp/tests/glcpp-test index 5dc08ea6acb..e8f3b546387 100755 --- a/src/glsl/glcpp/tests/glcpp-test +++ b/src/glsl/glcpp/tests/glcpp-test @@ -2,6 +2,34 @@ trap 'rm $test.valgrind-errors; exit 1' INT QUIT +usage () +{ + cat <&2 + echo >&2 + usage + exit 1 + fi +done + total=0 pass=0 clean=0 @@ -24,23 +52,25 @@ echo "" echo "$pass/$total tests returned correct results" echo "" -echo "====== Testing for valgrind cleanliness ======" -for test in *.c; do - echo -n "Testing $test with valgrind..." - valgrind --error-exitcode=31 --log-file=$test.valgrind-errors ../glcpp < $test >/dev/null 2>&1 - if [ "$?" = "31" ]; then - echo "ERRORS" - cat $test.valgrind-errors - else - echo "CLEAN" - clean=$((clean+1)) - rm $test.valgrind-errors - fi -done +if [ "$do_valgrind" = "yes" ]; then + echo "====== Testing for valgrind cleanliness ======" + for test in *.c; do + echo -n "Testing $test with valgrind..." + valgrind --error-exitcode=31 --log-file=$test.valgrind-errors ../glcpp < $test >/dev/null 2>&1 + if [ "$?" = "31" ]; then + echo "ERRORS" + cat $test.valgrind-errors + else + echo "CLEAN" + clean=$((clean+1)) + rm $test.valgrind-errors + fi + done -echo "" -echo "$pass/$total tests returned correct results" -echo "$clean/$total tests are valgrind-clean" + echo "" + echo "$pass/$total tests returned correct results" + echo "$clean/$total tests are valgrind-clean" +fi if [ "$pass" = "$total" ] && [ "$clean" = "$total" ]; then exit 0