summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-05-02 12:08:28 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-05-02 12:08:28 +0000
commit3bf8ad7de29ce68201557fe012f2787927943eda (patch)
tree51d05dd29a4899fec25be22b397a58df63addfaf
parent62e2f1e2f4a96ceb91fc08e07fb0c70f3d51546b (diff)
downloadsrc-test2-3bf8ad7de29ce68201557fe012f2787927943eda.tar.gz
src-test2-3bf8ad7de29ce68201557fe012f2787927943eda.zip
Notes
-rw-r--r--etc/mtree/BSD.tests.dist2
-rw-r--r--usr.bin/col/Makefile6
-rw-r--r--usr.bin/col/tests/Makefile11
-rwxr-xr-xusr.bin/col/tests/col.sh39
-rw-r--r--usr.bin/col/tests/rlf.in2
-rw-r--r--usr.bin/col/tests/rlf2.in2
6 files changed, 62 insertions, 0 deletions
diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist
index b46d0a0a4293..a8634362286b 100644
--- a/etc/mtree/BSD.tests.dist
+++ b/etc/mtree/BSD.tests.dist
@@ -514,6 +514,8 @@
..
cmp
..
+ col
+ ..
comm
..
cut
diff --git a/usr.bin/col/Makefile b/usr.bin/col/Makefile
index 8e3a95948f3f..a16286611902 100644
--- a/usr.bin/col/Makefile
+++ b/usr.bin/col/Makefile
@@ -1,6 +1,12 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
+.include <src.opts.mk>
+
PROG= col
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
diff --git a/usr.bin/col/tests/Makefile b/usr.bin/col/tests/Makefile
new file mode 100644
index 000000000000..43838e9c5eab
--- /dev/null
+++ b/usr.bin/col/tests/Makefile
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+TESTSDIR= ${TESTSBASE}/usr.bin/col
+
+ATF_TESTS_SH= col
+
+FILES= rlf.in \
+ rlf2.in
+FILESDIR= ${TESTSDIR}
+
+.include <bsd.test.mk>
diff --git a/usr.bin/col/tests/col.sh b/usr.bin/col/tests/col.sh
new file mode 100755
index 000000000000..1730c90297d7
--- /dev/null
+++ b/usr.bin/col/tests/col.sh
@@ -0,0 +1,39 @@
+# $FreeBSD$
+
+atf_test_case rlf
+
+rlf_head()
+{
+ atf_set "descr" "testing reverse line feed"
+}
+rlf_body()
+{
+ atf_check \
+ -o inline:"a b\n" \
+ -e empty \
+ -s exit:0 \
+ col < $(atf_get_srcdir)/rlf.in
+
+ atf_check \
+ -o inline:"a b3\n" \
+ -e empty \
+ -s exit:0 \
+ col < $(atf_get_srcdir)/rlf2.in
+
+ atf_check \
+ -o inline:"a b3\n" \
+ -e empty \
+ -s exit:0 \
+ col -x < $(atf_get_srcdir)/rlf2.in
+
+ atf_check \
+ -o inline:"a b3\n" \
+ -e empty \
+ -s exit:0 \
+ col -p < $(atf_get_srcdir)/rlf2.in
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case rlf
+}
diff --git a/usr.bin/col/tests/rlf.in b/usr.bin/col/tests/rlf.in
new file mode 100644
index 000000000000..57a14e5771b7
--- /dev/null
+++ b/usr.bin/col/tests/rlf.in
@@ -0,0 +1,2 @@
+a
+ 7b
diff --git a/usr.bin/col/tests/rlf2.in b/usr.bin/col/tests/rlf2.in
new file mode 100644
index 000000000000..dd4685174dd7
--- /dev/null
+++ b/usr.bin/col/tests/rlf2.in
@@ -0,0 +1,2 @@
+a
+ 7b