From aeb91fd31b06f24d7541cf6534c0f39f3d812d3c Mon Sep 17 00:00:00 2001 From: anton Date: Mon, 18 Dec 2017 19:19:08 +0000 Subject: [PATCH] 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. --- regress/bin/csh/Makefile | 16 +++++++++++++--- regress/bin/csh/env.in | 9 +++++++++ regress/bin/csh/env.ok | 4 ++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 regress/bin/csh/env.in create mode 100644 regress/bin/csh/env.ok 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 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 -- 2.20.1