diff options
author | Carl Worth <[email protected]> | 2012-12-05 13:32:32 -0800 |
---|---|---|
committer | Carl Worth <[email protected]> | 2013-01-11 13:55:41 -0800 |
commit | 409dee5eac492817551bbcde104e137233a5ed54 (patch) | |
tree | 16512254017fbbb3cdd8fb0e5f10128463906f40 | |
parent | 0206ea3751a81d8bb6db9d0a7f4a3a1eb98b36d0 (diff) |
glcpp: Allow test-specific arguments for standalone glcpp tests
This will allow the test exercising disabled line continuations to arrange
for the --disable-line-continuations argument to be passed to the standalone
glcpp.
Reviewed-by: Kenneth Graunke <[email protected]>
-rwxr-xr-x | src/glsl/glcpp/tests/glcpp-test | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/glsl/glcpp/tests/glcpp-test b/src/glsl/glcpp/tests/glcpp-test index ac891914786..d12db6f37d6 100755 --- a/src/glsl/glcpp/tests/glcpp-test +++ b/src/glsl/glcpp/tests/glcpp-test @@ -23,6 +23,13 @@ Valid options include: EOF } +test_specific_args () +{ + test="$1" + + grep 'glcpp-args:' "$test" | sed -e 's,^.*glcpp-args: *,,' +} + # Parse command-line options for option; do if [ "${option}" = '--help' ] ; then @@ -45,7 +52,7 @@ clean=0 echo "====== Testing for correctness ======" for test in $testdir/*.c; do echo -n "Testing $test..." - $glcpp < $test > $test.out 2>&1 + $glcpp $(test_specific_args $test) < $test > $test.out 2>&1 total=$((total+1)) if cmp $test.expected $test.out >/dev/null 2>&1; then echo "PASS" @@ -64,7 +71,7 @@ if [ "$do_valgrind" = "yes" ]; then echo "====== Testing for valgrind cleanliness ======" for test in $testdir/*.c; do echo -n "Testing $test with valgrind..." - valgrind --error-exitcode=31 --log-file=$test.valgrind-errors $glcpp < $test >/dev/null 2>&1 + valgrind --error-exitcode=31 --log-file=$test.valgrind-errors $glcpp $(test_specific_args $test) < $test >/dev/null 2>&1 if [ "$?" = "31" ]; then echo "ERRORS" cat $test.valgrind-errors |