1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#! /bin/sh -e
suite=${1:-"test"}
bugs=0
testdir=`cd "$srcdir/$suite" && pwd`
cd $suite
RUNTEST=${RUNTEST:-"@PARI_RUNTEST@"}
GP2C_FUNC_DSC=../desc/func.dsc
export GP2C_FUNC_DSC
if test -f "$testdir/gp/affect.gp"; then
cp "$testdir/gp/affect.gp" affect
fi
for i in `ls "$testdir/input"`; do
if test -f "$testdir/gp/$i.gp"; then
echo @ECHON@ "Testing script $i...@ECHOC@"
rm -f $i.gp.c $i.gp.o $i.gp.so $i.res $i.gp.run
if ../src/gp2c -p gp2c_ -g -o $i.gp.c "$testdir/gp/$i.gp" 2>$i.res; then
command=`echo "@PARI_MODULE_BUILD@" | sed -e s/%s/$i.gp/g`
eval $command
grep "^GP;" $i.gp.c | sed 's/^GP;//' >$i.gp.run
cat "$testdir/input/$i" >> $i.gp.run
$RUNTEST '@GP_PATH@' -f -q --test < $i.gp.run >$i.res 2>&1
if test -f "$testdir/res/$i.res"; then
if diff "$testdir/res/$i.res" $i.res >/dev/null; then
echo "@ECHOT@OK."
else
echo "@ECHOT@BUG."
bugs=1;
fi
else
test "$srcdir" = "." && cp $i.res "$testdir/res/$i.res"
echo
cat $i.res
fi
else
echo "@ECHOT@BUG."
bugs=1;
fi
fi
done
if test -f "$testdir/gp/affect.gp"; then
rm -f affect
fi;
exit $bugs
|