2011-07-05 11:52:06 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
total=0
|
|
|
|
|
pass=0
|
|
|
|
|
|
|
|
|
|
echo "====== Testing optimization passes ======"
|
|
|
|
|
for test in `find . -iname '*.opt_test'`; do
|
|
|
|
|
echo -n "Testing $test..."
|
|
|
|
|
(cd `dirname "$test"`; ./`basename "$test"`) > "$test.out" 2>&1
|
|
|
|
|
total=$((total+1))
|
2012-05-29 11:16:34 -07:00
|
|
|
if $PYTHON2 $PYTHON_FLAGS ./compare_ir "$test.expected" "$test.out" >/dev/null 2>&1; then
|
2011-07-05 11:52:06 -07:00
|
|
|
echo "PASS"
|
|
|
|
|
pass=$((pass+1))
|
|
|
|
|
else
|
|
|
|
|
echo "FAIL"
|
2012-05-29 11:16:34 -07:00
|
|
|
$PYTHON2 $PYTHON_FLAGS ./compare_ir "$test.expected" "$test.out"
|
2011-07-05 11:52:06 -07:00
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "$pass/$total tests returned correct results"
|
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
|
|
if [[ $pass == $total ]]; then
|
|
|
|
|
exit 0
|
|
|
|
|
else
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|