diff options
author | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2010-09-02 18:31:49 +0200 |
---|---|---|
committer | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2010-09-02 18:31:49 +0200 |
commit | 222d2f2ac2c7d93cbc0643082c78278ad2c8cfce (patch) | |
tree | b79152c238022b2a901201c22e5809ac520732bf /src/glsl/glcpp/tests/glcpp-test | |
parent | 443abc80db9e1a288ce770e76cccd43664348098 (diff) | |
parent | e73c5501b2fe20290d1b691c85a5d82ac3a0431c (diff) |
Merge remote branch 'origin/master' into nv50-compiler
Conflicts:
src/gallium/drivers/nv50/nv50_program.c
Diffstat (limited to 'src/glsl/glcpp/tests/glcpp-test')
-rwxr-xr-x | src/glsl/glcpp/tests/glcpp-test | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/glsl/glcpp/tests/glcpp-test b/src/glsl/glcpp/tests/glcpp-test new file mode 100755 index 0000000000..5dc08ea6ac --- /dev/null +++ b/src/glsl/glcpp/tests/glcpp-test @@ -0,0 +1,50 @@ +#!/bin/sh + +trap 'rm $test.valgrind-errors; exit 1' INT QUIT + +total=0 +pass=0 +clean=0 + +echo "====== Testing for correctness ======" +for test in *.c; do + echo -n "Testing $test..." + ../glcpp < $test > $test.out 2>&1 + total=$((total+1)) + if cmp $test.expected $test.out >/dev/null 2>&1; then + echo "PASS" + pass=$((pass+1)) + else + echo "FAIL" + diff -u $test.expected $test.out + fi +done + +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 + +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 +fi + |