41 lines
802 B
Bash
41 lines
802 B
Bash
#!/bin/sh
|
|
#
|
|
# $NetBSD: dotest,v 1.4 2006/04/04 16:17:19 martti Exp $
|
|
#
|
|
TESTDIR=$1
|
|
shift
|
|
|
|
thistest=$1
|
|
format=$2
|
|
output=$3
|
|
tuning=$4
|
|
if [ -f /usr/ucb/touch ] ; then
|
|
TOUCH=/usr/ucb/touch
|
|
else
|
|
if [ -f /usr/bin/touch ] ; then
|
|
TOUCH=/usr/bin/touch
|
|
else
|
|
if [ -f /bin/touch ] ; then
|
|
TOUCH=/bin/touch
|
|
fi
|
|
fi
|
|
fi
|
|
if [ "$tuning" != "" ] ; then
|
|
tuning="-T $tuning"
|
|
fi
|
|
echo "${thistest}...";
|
|
/bin/cp /dev/null results/${thistest}
|
|
( while read rule; do
|
|
echo "$rule" | ipftest -F $format -Rbr - -i ${TESTDIR}/input/${thistest} $tuning>> results/${thistest};
|
|
if [ $? -ne 0 ] ; then
|
|
exit 1;
|
|
fi
|
|
echo "--------" >> results/${thistest}
|
|
done ) < ${TESTDIR}/regress/${thistest}
|
|
cmp ${TESTDIR}/expected/${thistest} results/${thistest}
|
|
status=$?
|
|
if [ $status = 0 ] ; then
|
|
$TOUCH ${thistest}
|
|
fi
|
|
exit $status
|