2014-01-02 11:14:19 -05:00
|
|
|
#!/usr/bin/env bash
|
2013-12-29 17:34:42 -05:00
|
|
|
|
|
|
|
RM="/bin/rm -f"
|
2014-01-04 12:06:34 -05:00
|
|
|
CPYTHON3=python3.3
|
2013-12-29 17:34:42 -05:00
|
|
|
MP_PY=../../unix/py
|
|
|
|
|
|
|
|
numtests=0
|
|
|
|
numpassed=0
|
|
|
|
numfailed=0
|
|
|
|
namefailed=
|
|
|
|
|
|
|
|
for infile in tests/*.py
|
|
|
|
do
|
2014-01-03 09:03:48 -05:00
|
|
|
basename=`basename $infile .py`
|
2013-12-29 17:34:42 -05:00
|
|
|
outfile=${basename}.out
|
|
|
|
expfile=${basename}.exp
|
|
|
|
|
|
|
|
$CPYTHON3 -B $infile > $expfile
|
|
|
|
$MP_PY $infile > $outfile
|
|
|
|
|
|
|
|
diff --brief $expfile $outfile > /dev/null
|
|
|
|
|
|
|
|
if [ $? -eq 0 ]
|
|
|
|
then
|
|
|
|
echo "pass $infile"
|
|
|
|
$RM $outfile
|
|
|
|
$RM $expfile
|
2013-12-29 17:38:03 -05:00
|
|
|
((numpassed=numpassed + 1))
|
2013-12-29 17:34:42 -05:00
|
|
|
else
|
|
|
|
echo "FAIL $infile"
|
2013-12-29 17:38:03 -05:00
|
|
|
((numfailed=numfailed + 1))
|
2013-12-29 17:34:42 -05:00
|
|
|
namefailed="$namefailed $basename"
|
|
|
|
fi
|
|
|
|
|
2013-12-29 17:38:03 -05:00
|
|
|
((numtests=numtests + 1))
|
2013-12-29 17:34:42 -05:00
|
|
|
done
|
|
|
|
|
|
|
|
echo "$numtests tests performed"
|
|
|
|
echo "$numpassed tests passed"
|
2013-12-29 17:38:03 -05:00
|
|
|
if [[ $numfailed != 0 ]]
|
2013-12-29 17:34:42 -05:00
|
|
|
then
|
|
|
|
echo "$numfailed tests failed -$namefailed"
|
|
|
|
fi
|