1 |
#!/bin/sh |
#!/bin/ksh |
2 |
# |
# |
3 |
# A script for running the Diderot regression tests. |
# A script for running the Diderot regression tests. |
4 |
# |
# |
5 |
# @configure_input@ |
# @configure_input@ |
6 |
# |
# |
7 |
|
# TODO: |
8 |
|
# pick version of diderotc compiler to test |
9 |
|
# pass command-line arguments to the compiler |
10 |
|
# |
11 |
|
|
12 |
# set up the path so that we can find diderotc and unu |
# set up the path so that we can find diderotc and unu |
13 |
# |
# |
26 |
TESTS=$(cd tests; ls) |
TESTS=$(cd tests; ls) |
27 |
|
|
28 |
DATE=$( date +"%F-%H-%M-%S" ) |
DATE=$( date +"%F-%H-%M-%S" ) |
29 |
|
LOG=$HERE/log.$DATE |
30 |
|
REPORT=$HERE/report.$DATE |
31 |
|
|
32 |
for t in $TESTS ; do |
for t in $TESTS ; do |
33 |
( cd $t; |
( cd tests/$t; |
34 |
echo -n "checking $t ..." >> $LOG |
echo "********** $t **********" >> $LOG |
35 |
diderotc $t.diderot |
echo -n "checking $t ..." >> $REPORT |
36 |
|
echo "diderotc $t.diderot" >> $LOG |
37 |
|
diderotc $t.diderot 2>> $LOG 1>> $LOG |
38 |
if [ "$?" -eq "0" ] ; then |
if [ "$?" -eq "0" ] ; then |
39 |
echo -n " compile succeeded ..." >> $LOG |
echo -n " compile succeeded ..." >> $REPORT |
40 |
./$t |
echo "./$t" >> $LOG |
41 |
|
./$t 2>> $LOG 1>> $LOG |
42 |
if [ "$?" -eq "0" ] ; then |
if [ "$?" -eq "0" ] ; then |
43 |
echo -n " execution succeeded ..." >> $LOG |
echo -n " execution succeeded ..." >> $REPORT |
44 |
./assess.sh |
result=$(./assess.sh) |
45 |
|
if (($result < 1.0)) ; then |
46 |
|
echo "result is good ($result)" >> $REPORT |
47 |
|
echo "ok" >> $LOG |
48 |
|
echo "$t is okay" |
49 |
|
rm -f $t.c $t.o $t $t.log mip.txt |
50 |
|
else |
51 |
|
echo "result if bad ($result)" >> $REPORT |
52 |
|
echo "$t failed" |
53 |
|
fi |
54 |
else |
else |
55 |
echo " execution failed" >> $LOG |
echo " execution failed" >> $REPORT |
56 |
|
echo "$t failed" |
57 |
fi |
fi |
58 |
else |
else |
59 |
echo " compile failed" >> $LOG |
echo " compile failed" >> $REPORT |
60 |
|
echo "$t failed" |
61 |
fi |
fi |
62 |
|
echo "**********" >> $LOG |
63 |
|
) |
64 |
done |
done |
65 |
|
echo "complete report at $REPORT" |