Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

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