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
32 # Store our location before we start diving into subdirectories.
34 echo "====== Generating tests ======"
35 for dir
in $srcdir/glsl
/tests
/*/; do
36 if [ -e "${dir}create_test_cases.py" ]; then
37 # construct the correct builddir
38 completedir
="$abs_builddir/glsl/tests/`echo ${dir} | sed 's|.*/glsl/tests/||g'`"
41 $PYTHON2 create_test_cases.py
--runner $abs_builddir/glsl
/glsl_test
--outdir $completedir;
51 if [ $has_tests -eq 0 ]; then
52 echo "Could not generate any tests."
56 if [ ! -f "$compare_ir" ]; then
57 echo "Could not find compare_ir. Make sure that srcdir variable is correctly set."
61 echo "====== Testing optimization passes ======"
62 for test in `find . -iname '*.opt_test'`; do
63 echo -n "Testing $test..."
64 .
/$test > "$test.out" 2>&1
66 if $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out" >/dev
/null
2>&1; then
71 $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out"
75 if [ $total -eq 0 ]; then
76 echo "Could not find any tests."
81 echo "$pass/$total tests returned correct results"
84 if [ $pass = $total ]; then