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."
22 echo "====== Generating tests ======"
23 for dir
in tests
/*/; do
24 if [ -e "${dir}create_test_cases.py" ]; then
25 cd $dir; $PYTHON2 create_test_cases.py
; cd ..
30 echo "====== Testing optimization passes ======"
31 for test in `find . -iname '*.opt_test'`; do
32 echo -n "Testing $test..."
33 (cd `dirname "$test"`; .
/`basename "$test"`) > "$test.out" 2>&1
35 if $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out" >/dev
/null
2>&1; then
40 $PYTHON2 $PYTHON_FLAGS $compare_ir "$test.expected" "$test.out"
45 echo "$pass/$total tests returned correct results"
48 if [ $pass = $total ]; then