switches=`basename $x|sed -e 's/^.*\.\([^.]*\)\..*$/-\1/g' -e 's/^[^-].*//'g`
# don't use the -o flag, since it makes it harder to diff.
outname=@builddir@/test/`basename ${x%.re}.temp`
+ difname=@builddir@/test/`basename ${x%.re}.diff`
@builddir@/re2c $switches $x 2>&1 | sed -e "s,$x,`basename $x`,g" -e "s,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g" > $outname
- if cmp -s ${x%.re}.c $outname; then
+ if diff -u ${x%.re}.c $outname > $difname; then
echo "Passed."
rm $outname
else
result=1
errcnt=$(($errcnt+1))
fi
+ test -f ${x%.re}.diff -a ! -s $difname && rm -f $difname
done
if test $result = 0; then
echo "All tests passed successfully."