diff options
author | Matt Turner <[email protected]> | 2014-12-07 23:43:00 -0800 |
---|---|---|
committer | Matt Turner <[email protected]> | 2014-12-12 12:11:50 -0800 |
commit | a29ae0b3ddce0f4cda633d3be3f7380178522bbf (patch) | |
tree | 7b519265d3f0606657c13153ccbcc36ed9551c09 /src/glsl/glcpp/tests/glcpp-test | |
parent | 75c7a7114fc94b17aaadb6d737d2b5fc92bf6240 (diff) |
glcpp: Make tests write .out files to builddir.
Diffstat (limited to 'src/glsl/glcpp/tests/glcpp-test')
-rwxr-xr-x | src/glsl/glcpp/tests/glcpp-test | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/glsl/glcpp/tests/glcpp-test b/src/glsl/glcpp/tests/glcpp-test index ea69edfd8b0..825c22e71fb 100755 --- a/src/glsl/glcpp/tests/glcpp-test +++ b/src/glsl/glcpp/tests/glcpp-test @@ -2,9 +2,11 @@ if [ ! -z "$srcdir" ]; then testdir=$srcdir/glcpp/tests + outdir=`pwd`/glcpp/tests glcpp=`pwd`/glcpp/glcpp else testdir=. + outdir=. glcpp=../glcpp fi @@ -43,6 +45,7 @@ for option; do ;; "--testdir="*) testdir="${option#--testdir=}" + outdir="${outdir}/${option#--testdir=}" ;; *) echo "Unrecognized option: $option" >&2 @@ -57,17 +60,21 @@ total=0 pass=0 clean=0 +mkdir -p $outdir + echo "====== Testing for correctness ======" for test in $testdir/*.c; do - printf "Testing $test..." - $glcpp $(test_specific_args $test) < $test > $test.out 2>&1 + out=$outdir/${test##*/}.out + + printf "Testing $test... > $out ($test.expected) " + $glcpp $(test_specific_args $test) < $test > $out 2>&1 total=$((total+1)) - if cmp $test.expected $test.out >/dev/null 2>&1; then + if cmp $test.expected $out >/dev/null 2>&1; then echo "PASS" pass=$((pass+1)) else echo "FAIL" - diff -u $test.expected $test.out + diff -u $test.expected $out fi done |