diff options
author | Paul Berry <stereotype441@gmail.com> | 2011-07-05 11:52:06 -0700 |
---|---|---|
committer | Paul Berry <stereotype441@gmail.com> | 2011-07-22 09:45:11 -0700 |
commit | 659cdedb532e675da5676d40ee39278aadd8f0a1 (patch) | |
tree | 75e5affe4434d782ab50ed5fb2591d65ff868925 /src/glsl/tests/optimization-test | |
parent | f1f76e157ed1ba554fc3a0172113997344049e07 (diff) | |
download | external_mesa3d-659cdedb532e675da5676d40ee39278aadd8f0a1.zip external_mesa3d-659cdedb532e675da5676d40ee39278aadd8f0a1.tar.gz external_mesa3d-659cdedb532e675da5676d40ee39278aadd8f0a1.tar.bz2 |
glsl: Add unit tests for lower_jumps.cpp
These tests invoke do_lower_jumps() in isolation (using the glsl_test
executable) and verify that it transforms the IR in the expected way.
The unit tests may be run from the top level directory using "make
check".
For reference, I've also checked in the Python script
create_test_cases.py, which was used to generate these tests. It is
not necessary to run this script in order to run the tests.
Acked-by: Chad Versace <chad@chad-versace.us>
Diffstat (limited to 'src/glsl/tests/optimization-test')
-rwxr-xr-x | src/glsl/tests/optimization-test | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/glsl/tests/optimization-test b/src/glsl/tests/optimization-test new file mode 100755 index 0000000..0c130be --- /dev/null +++ b/src/glsl/tests/optimization-test @@ -0,0 +1,28 @@ +#!/bin/bash + +total=0 +pass=0 + +echo "====== Testing optimization passes ======" +for test in `find . -iname '*.opt_test'`; do + echo -n "Testing $test..." + (cd `dirname "$test"`; ./`basename "$test"`) > "$test.out" 2>&1 + total=$((total+1)) + if ./compare_ir "$test.expected" "$test.out" >/dev/null 2>&1; then + echo "PASS" + pass=$((pass+1)) + else + echo "FAIL" + ./compare_ir "$test.expected" "$test.out" + fi +done + +echo "" +echo "$pass/$total tests returned correct results" +echo "" + +if [[ $pass == $total ]]; then + exit 0 +else + exit 1 +fi |