summaryrefslogtreecommitdiff
path: root/regress/bin
diff options
context:
space:
mode:
authoranton <anton@cvs.openbsd.org>2017-12-18 19:19:09 +0000
committeranton <anton@cvs.openbsd.org>2017-12-18 19:19:09 +0000
commit1760fbc97dd5fdd8c5d74ee14ee06ea34376fd1e (patch)
tree71cc3ab2e7ce5ffe7661547fc3a967e0829dc66e /regress/bin
parentd82f3473b3d833b72b4d917d1ff4ed4df2511e65 (diff)
Add tests for the environment related commands in csh. While here, print a
descriptive header before each test, inspired by the many others in regress.
Diffstat (limited to 'regress/bin')
-rw-r--r--regress/bin/csh/Makefile16
-rw-r--r--regress/bin/csh/env.in9
-rw-r--r--regress/bin/csh/env.ok4
3 files changed, 26 insertions, 3 deletions
diff --git a/regress/bin/csh/Makefile b/regress/bin/csh/Makefile
index 16bd73c9e75..b604773d7c7 100644
--- a/regress/bin/csh/Makefile
+++ b/regress/bin/csh/Makefile
@@ -1,9 +1,9 @@
-# $OpenBSD: Makefile,v 1.4 2017/11/16 19:05:44 anton Exp $
-
-REGRESS_TARGETS= filec
+# $OpenBSD: Makefile,v 1.5 2017/12/18 19:19:08 anton Exp $
CSH= /bin/csh
+REGRESS_TARGETS= filec
+
PROG= edit
CFLAGS+= -Wall
LDADD+= -lutil
@@ -13,6 +13,16 @@ edit.c: ${.CURDIR}/../ksh/edit/edit.c
@cp ${.CURDIR}/../ksh/edit/edit.c .
filec: edit
+ @echo '\n======== filec ========'
sh ${.CURDIR}/filec.sh ${CSH}
+REGRESS_TARGETS+= env
+
+.SUFFIXES: .in
+
+.in:
+ @echo '\n======== ${@} ========'
+ env -i MALLOC_OPTIONS=S ${CSH} <${.CURDIR}/${@}.in 2>&1 | \
+ diff -u ${.CURDIR}/${@}.ok -
+
.include <bsd.regress.mk>
diff --git a/regress/bin/csh/env.in b/regress/bin/csh/env.in
new file mode 100644
index 00000000000..e76d8149c60
--- /dev/null
+++ b/regress/bin/csh/env.in
@@ -0,0 +1,9 @@
+setenv FOO 1
+echo $FOO
+unsetenv FOO
+setenv | grep FOO || echo ok
+setenv FOO 1
+setenv FOOFOO 2
+echo $FOO $FOOFOO
+unsetenv FOO*
+setenv | grep FOO || echo ok
diff --git a/regress/bin/csh/env.ok b/regress/bin/csh/env.ok
new file mode 100644
index 00000000000..15859e8edc5
--- /dev/null
+++ b/regress/bin/csh/env.ok
@@ -0,0 +1,4 @@
+1
+ok
+1 2
+ok