3 if [ -z "$PYTHON2" ]; then
7 which $PYTHON2 >/dev
/null
9 echo "Could not find python2. Make sure that PYTHON2 variable is correctly set."
13 if [ -z "$srcdir" -o -z "$abs_builddir" ]; then
15 echo "Warning: you're invoking the script manually and things may fail."
16 echo "Attempting to determine/set srcdir and abs_builddir variables."
19 # Variable should point to the Makefile.glsl.am
22 # Variable should point to the folder two levels above glsl_test
23 abs_builddir
=`pwd`/..
/..
/
26 compare_ir
=$srcdir/glsl
/tests
/compare_ir.py
31 echo "====== Generating tests ======"
32 for dir
in tests
/*/; do
33 if [ -e "${dir}create_test_cases.py" ]; then
34 cd $dir; $PYTHON2 create_test_cases.py
; cd ..
39 echo "====== Testing optimization passes ======"
40 for test in `find . -iname '*.opt_test'`; do
41 echo -n "Testing $test..."
42 (cd `dirname "$test"`; .
/`basename "$test"`) > "$test.out" 2>&1
44 if $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out" >/dev
/null
2>&1; then
49 $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out"
54 echo "$pass/$total tests returned correct results"
57 if [ $pass = $total ]; then