summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-06-07 05:31:32 +0000
committerjmallett <jmallett@FreeBSD.org>2002-06-07 05:31:32 +0000
commita3f088af5b2bf20f7786139dc6804a7463589958 (patch)
treef77894d9927d86648e4a30b61cd8d8dc6c61d965 /tools
parent355983613bbc6fd202bee72ca1fda7bc3c0a714f (diff)
downloadFreeBSD-src-a3f088af5b2bf20f7786139dc6804a7463589958.zip
FreeBSD-src-a3f088af5b2bf20f7786139dc6804a7463589958.tar.gz
Add a regression test for m4(1).
This checks the behaviour of changecom() in both GNU and BSD modes of our m4.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/usr.bin/m4/Makefile4
-rw-r--r--tools/regression/usr.bin/m4/regress.changecom.in3
-rw-r--r--tools/regression/usr.bin/m4/regress.changecom.out3
-rw-r--r--tools/regression/usr.bin/m4/regress.gchangecom.out2
-rw-r--r--tools/regression/usr.bin/m4/regress.sh38
5 files changed, 50 insertions, 0 deletions
diff --git a/tools/regression/usr.bin/m4/Makefile b/tools/regression/usr.bin/m4/Makefile
new file mode 100644
index 0000000..9903670
--- /dev/null
+++ b/tools/regression/usr.bin/m4/Makefile
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+all:
+ @sh ${.CURDIR}/regress.sh ${.CURDIR}
diff --git a/tools/regression/usr.bin/m4/regress.changecom.in b/tools/regression/usr.bin/m4/regress.changecom.in
new file mode 100644
index 0000000..843fa11
--- /dev/null
+++ b/tools/regression/usr.bin/m4/regress.changecom.in
@@ -0,0 +1,3 @@
+changecom
+# dnl BSD will show this in output.
+# dnl SYSV + GNU will not show this.
diff --git a/tools/regression/usr.bin/m4/regress.changecom.out b/tools/regression/usr.bin/m4/regress.changecom.out
new file mode 100644
index 0000000..128a18b
--- /dev/null
+++ b/tools/regression/usr.bin/m4/regress.changecom.out
@@ -0,0 +1,3 @@
+
+# dnl BSD will show this in output.
+# dnl SYSV + GNU will not show this.
diff --git a/tools/regression/usr.bin/m4/regress.gchangecom.out b/tools/regression/usr.bin/m4/regress.gchangecom.out
new file mode 100644
index 0000000..00aae57
--- /dev/null
+++ b/tools/regression/usr.bin/m4/regress.gchangecom.out
@@ -0,0 +1,2 @@
+
+# # \ No newline at end of file
diff --git a/tools/regression/usr.bin/m4/regress.sh b/tools/regression/usr.bin/m4/regress.sh
new file mode 100644
index 0000000..fdc7de0
--- /dev/null
+++ b/tools/regression/usr.bin/m4/regress.sh
@@ -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
OpenPOWER on IntegriCloud