summaryrefslogtreecommitdiffstats
path: root/tools/regression
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-04-20 19:33:23 +0000
committerjmallett <jmallett@FreeBSD.org>2002-04-20 19:33:23 +0000
commit7c76f6f023484c83771900e40dd1ffe882ade61c (patch)
tree8683aa93834d846e6a56a24d57ec7757adbf2686 /tools/regression
parentca4e8950a40bd8c7cdac9f899fea8812c9081faa (diff)
downloadFreeBSD-src-7c76f6f023484c83771900e40dd1ffe882ade61c.zip
FreeBSD-src-7c76f6f023484c83771900e40dd1ffe882ade61c.tar.gz
A simple test for join(1) based on tjr's test case for -o 0.
Partially based on: PR standards/36072
Diffstat (limited to 'tools/regression')
-rw-r--r--tools/regression/usr.bin/Makefile2
-rw-r--r--tools/regression/usr.bin/join/Makefile4
-rw-r--r--tools/regression/usr.bin/join/regress.1.in4
-rw-r--r--tools/regression/usr.bin/join/regress.2.in4
-rw-r--r--tools/regression/usr.bin/join/regress.out5
-rw-r--r--tools/regression/usr.bin/join/regress.sh17
6 files changed, 35 insertions, 1 deletions
diff --git a/tools/regression/usr.bin/Makefile b/tools/regression/usr.bin/Makefile
index dc23b26..64d6d45 100644
--- a/tools/regression/usr.bin/Makefile
+++ b/tools/regression/usr.bin/Makefile
@@ -1,5 +1,5 @@
# $FreeBSD$
-SUBDIR= file2c uudecode uuencode xargs
+SUBDIR= file2c join uudecode uuencode xargs
.include <bsd.subdir.mk>
diff --git a/tools/regression/usr.bin/join/Makefile b/tools/regression/usr.bin/join/Makefile
new file mode 100644
index 0000000..9903670
--- /dev/null
+++ b/tools/regression/usr.bin/join/Makefile
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+all:
+ @sh ${.CURDIR}/regress.sh ${.CURDIR}
diff --git a/tools/regression/usr.bin/join/regress.1.in b/tools/regression/usr.bin/join/regress.1.in
new file mode 100644
index 0000000..975bbaf
--- /dev/null
+++ b/tools/regression/usr.bin/join/regress.1.in
@@ -0,0 +1,4 @@
+!Name,Data1
+Foo,1
+Bar,2
+Baz,3
diff --git a/tools/regression/usr.bin/join/regress.2.in b/tools/regression/usr.bin/join/regress.2.in
new file mode 100644
index 0000000..0206b49
--- /dev/null
+++ b/tools/regression/usr.bin/join/regress.2.in
@@ -0,0 +1,4 @@
+!Name,Data2
+Foo,Bar
+Baz,2
+Foobar,1
diff --git a/tools/regression/usr.bin/join/regress.out b/tools/regression/usr.bin/join/regress.out
new file mode 100644
index 0000000..fa75c88
--- /dev/null
+++ b/tools/regression/usr.bin/join/regress.out
@@ -0,0 +1,5 @@
+!Name,Data1,Data2
+Foo,1,Bar
+Bar,2,(unknown)
+Baz,3,2
+Foobar,(unknown),1
diff --git a/tools/regression/usr.bin/join/regress.sh b/tools/regression/usr.bin/join/regress.sh
new file mode 100644
index 0000000..5e9eea4
--- /dev/null
+++ b/tools/regression/usr.bin/join/regress.sh
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+# Go into the regression test directory, handed to us by make(1)
+TESTDIR=$1
+if [ -z "$TESTDIR" ]; then
+ TESTDIR=.
+fi
+cd $TESTDIR
+
+join -t , -a1 -a2 -e '(unknown)' -o 0,1.2,2.2 regress.1.in regress.2.in | \
+ diff -u regress.out -
+if [ $? -eq 0 ]; then
+ echo "Test detected no regression, output matches."
+else
+ echo "Test failed: regression detected. See above."
+ exit 1
+fi
OpenPOWER on IntegriCloud