1#!/bin/bash 2 3total=0 4pass=0 5 6echo "====== Testing optimization passes ======" 7for test in `find . -iname '*.opt_test'`; do 8 echo -n "Testing $test..." 9 (cd `dirname "$test"`; ./`basename "$test"`) > "$test.out" 2>&1 10 total=$((total+1)) 11 if $PYTHON2 $PYTHON_FLAGS ./compare_ir "$test.expected" "$test.out" >/dev/null 2>&1; then 12 echo "PASS" 13 pass=$((pass+1)) 14 else 15 echo "FAIL" 16 $PYTHON2 $PYTHON_FLAGS ./compare_ir "$test.expected" "$test.out" 17 fi 18done 19 20echo "" 21echo "$pass/$total tests returned correct results" 22echo "" 23 24if [[ $pass == $total ]]; then 25 exit 0 26else 27 exit 1 28fi 29