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:
parent
7224076dfe
commit
ca982dadd5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97991
4
tools/regression/usr.bin/m4/Makefile
Normal file
4
tools/regression/usr.bin/m4/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
all:
|
||||
@sh ${.CURDIR}/regress.sh ${.CURDIR}
|
3
tools/regression/usr.bin/m4/regress.changecom.in
Normal file
3
tools/regression/usr.bin/m4/regress.changecom.in
Normal file
@ -0,0 +1,3 @@
|
||||
changecom
|
||||
# dnl BSD will show this in output.
|
||||
# dnl SYSV + GNU will not show this.
|
3
tools/regression/usr.bin/m4/regress.changecom.out
Normal file
3
tools/regression/usr.bin/m4/regress.changecom.out
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
# dnl BSD will show this in output.
|
||||
# dnl SYSV + GNU will not show this.
|
2
tools/regression/usr.bin/m4/regress.gchangecom.out
Normal file
2
tools/regression/usr.bin/m4/regress.gchangecom.out
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
# #
|
38
tools/regression/usr.bin/m4/regress.sh
Normal file
38
tools/regression/usr.bin/m4/regress.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user