2010-05-10 16:21:10 -07:00
|
|
|
#!/bin/sh
|
2010-05-25 13:09:03 -07:00
|
|
|
|
2010-07-19 17:48:17 -07:00
|
|
|
total=0
|
|
|
|
|
pass=0
|
|
|
|
|
|
2010-05-10 16:21:10 -07:00
|
|
|
for test in *.c; do
|
2010-07-19 17:48:17 -07:00
|
|
|
echo -n "Testing $test..."
|
2010-06-02 15:59:45 -07:00
|
|
|
../glcpp < $test > $test.out
|
2010-07-19 17:48:17 -07:00
|
|
|
total=$((total+1))
|
|
|
|
|
if cmp $test.expected $test.out; then
|
|
|
|
|
echo "PASS"
|
|
|
|
|
pass=$((pass+1))
|
|
|
|
|
else
|
|
|
|
|
echo "FAIL"
|
|
|
|
|
diff -u $test.expected $test.out
|
|
|
|
|
fi
|
2010-05-10 16:21:10 -07:00
|
|
|
done
|
2010-07-19 17:48:17 -07:00
|
|
|
|
|
|
|
|
echo "$pass/$total tests returned correct results"
|
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
|
|
if [ "$pass" = "$total" ] ; then
|
|
|
|
|
exit 0
|
|
|
|
|
else
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|