Add a regression test for m4(1).

This checks the behaviour of changecom() in both GNU and BSD modes of our m4.
This commit is contained in:
Juli Mallett 2002-06-07 05:31:32 +00:00
parent 7224076dfe
commit ca982dadd5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97991
5 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,4 @@
# $FreeBSD$
all:
@sh ${.CURDIR}/regress.sh ${.CURDIR}

View File

@ -0,0 +1,3 @@
changecom
# dnl BSD will show this in output.
# dnl SYSV + GNU will not show this.

View File

@ -0,0 +1,3 @@
# dnl BSD will show this in output.
# dnl SYSV + GNU will not show this.

View File

@ -0,0 +1,2 @@
# #

View File

@ -0,0 +1,38 @@
# $FreeBSD$
# Go into the regression test directory, handed to us by make(1)
TESTDIR=$1
if [ -z "$TESTDIR" ]; then
TESTDIR=.
fi
cd $TESTDIR
STATUS=0
for test in GNU/changecom changecom; do
echo "Running test $test"
case "$test" in
GNU/*)
M4="m4 -g"
GNU="g"
test=`basename $test`
;;
*)
M4="m4"
GNU=""
;;
esac
case "$test" in
changecom)
$M4 < regress.$test.in | diff -u regress.$GNU$test.out -
;;
esac
if [ $? -eq 0 ]; then
echo "PASS: Test $test detected no regression, output matches."
else
STATUS=$?
echo "FAIL: Test $test failed: regression detected. See above."
fi
done
exit $STATUS