3 if [ ! -z "$srcdir" ]; then
4 compare_ir
=`pwd`/tests
/compare_ir.py
6 compare_ir
=.
/compare_ir.py
9 if [ -z "$PYTHON2" ]; then
13 which $PYTHON2 >/dev
/null
15 echo "Could not find python2. Make sure that PYTHON2 variable is correctly set."
19 if [ -z "$srcdir" -o -z "$abs_builddir" ]; then
21 echo "Warning: you're invoking the script manually and things may fail."
22 echo "Attempting to determine/set srcdir and abs_builddir variables."
25 # Variable should point to the Makefile.glsl.am
28 # Variable should point to the folder two levels above glsl_test
29 abs_builddir
=`pwd`/..
/..
/
35 echo "====== Generating tests ======"
36 for dir
in tests
/*/; do
37 if [ -e "${dir}create_test_cases.py" ]; then
38 cd $dir; $PYTHON2 create_test_cases.py
; cd ..
43 echo "====== Testing optimization passes ======"
44 for test in `find . -iname '*.opt_test'`; do
45 echo -n "Testing $test..."
46 (cd `dirname "$test"`; .
/`basename "$test"`) > "$test.out" 2>&1
48 if $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out" >/dev
/null
2>&1; then
53 $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out"
58 echo "$pass/$total tests returned correct results"
61 if [ $pass = $total ]; then