summary refs log tree commit diff
path: root/bin/1sh/tests/set-e
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-03-09 04:00:31 -0400
committerJune McEnroe <june@causal.agency>2020-03-09 04:00:31 -0400
commitbb6d30656efa59e16d9abc20146accb24de17090 (patch)
treee6e0a2f16e0900f29260d4198b5e530be87372f5 /bin/1sh/tests/set-e
parentRemove 1sh sources (diff)
downloadsrc-bb6d30656efa59e16d9abc20146accb24de17090.tar.gz
src-bb6d30656efa59e16d9abc20146accb24de17090.zip
Import /usr/src/bin/sh from FreeBSD 12.1-RELEASE
Diffstat (limited to '')
-rw-r--r--bin/1sh/tests/set-e/Makefile46
-rw-r--r--bin/1sh/tests/set-e/Makefile.depend11
-rw-r--r--bin/1sh/tests/set-e/and1.03
-rw-r--r--bin/1sh/tests/set-e/and2.14
-rw-r--r--bin/1sh/tests/set-e/and3.04
-rw-r--r--bin/1sh/tests/set-e/and4.04
-rw-r--r--bin/1sh/tests/set-e/background1.03
-rw-r--r--bin/1sh/tests/set-e/cmd1.03
-rw-r--r--bin/1sh/tests/set-e/cmd2.14
-rw-r--r--bin/1sh/tests/set-e/elif1.07
-rw-r--r--bin/1sh/tests/set-e/elif2.07
-rw-r--r--bin/1sh/tests/set-e/eval1.03
-rw-r--r--bin/1sh/tests/set-e/eval2.14
-rw-r--r--bin/1sh/tests/set-e/for1.09
-rw-r--r--bin/1sh/tests/set-e/func1.07
-rw-r--r--bin/1sh/tests/set-e/func2.17
-rw-r--r--bin/1sh/tests/set-e/if1.05
-rw-r--r--bin/1sh/tests/set-e/if2.07
-rw-r--r--bin/1sh/tests/set-e/if3.05
-rw-r--r--bin/1sh/tests/set-e/not1.04
-rw-r--r--bin/1sh/tests/set-e/not2.04
-rw-r--r--bin/1sh/tests/set-e/or1.03
-rw-r--r--bin/1sh/tests/set-e/or2.03
-rw-r--r--bin/1sh/tests/set-e/or3.14
-rw-r--r--bin/1sh/tests/set-e/pipe1.14
-rw-r--r--bin/1sh/tests/set-e/pipe2.03
-rw-r--r--bin/1sh/tests/set-e/return1.011
-rw-r--r--bin/1sh/tests/set-e/semi1.14
-rw-r--r--bin/1sh/tests/set-e/semi2.14
-rw-r--r--bin/1sh/tests/set-e/subshell1.03
-rw-r--r--bin/1sh/tests/set-e/subshell2.14
-rw-r--r--bin/1sh/tests/set-e/until1.05
-rw-r--r--bin/1sh/tests/set-e/until2.05
-rw-r--r--bin/1sh/tests/set-e/until3.09
-rw-r--r--bin/1sh/tests/set-e/while1.05
-rw-r--r--bin/1sh/tests/set-e/while2.05
-rw-r--r--bin/1sh/tests/set-e/while3.09
37 files changed, 232 insertions, 0 deletions
diff --git a/bin/1sh/tests/set-e/Makefile b/bin/1sh/tests/set-e/Makefile
new file mode 100644
index 00000000..d938300e
--- /dev/null
+++ b/bin/1sh/tests/set-e/Makefile
@@ -0,0 +1,46 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/Makefile 299094 2016-05-04 23:20:53Z ngie $
+
+PACKAGE=	tests
+
+TESTSDIR=	${TESTSBASE}/bin/sh/${.CURDIR:T}
+
+.PATH: ${.CURDIR:H}
+ATF_TESTS_SH=	functional_test
+
+${PACKAGE}FILES+=	and1.0
+${PACKAGE}FILES+=	and2.1
+${PACKAGE}FILES+=	and3.0
+${PACKAGE}FILES+=	and4.0
+${PACKAGE}FILES+=	background1.0
+${PACKAGE}FILES+=	cmd1.0
+${PACKAGE}FILES+=	cmd2.1
+${PACKAGE}FILES+=	elif1.0
+${PACKAGE}FILES+=	elif2.0
+${PACKAGE}FILES+=	eval1.0
+${PACKAGE}FILES+=	eval2.1
+${PACKAGE}FILES+=	for1.0
+${PACKAGE}FILES+=	func1.0
+${PACKAGE}FILES+=	func2.1
+${PACKAGE}FILES+=	if1.0
+${PACKAGE}FILES+=	if2.0
+${PACKAGE}FILES+=	if3.0
+${PACKAGE}FILES+=	not1.0
+${PACKAGE}FILES+=	not2.0
+${PACKAGE}FILES+=	or1.0
+${PACKAGE}FILES+=	or2.0
+${PACKAGE}FILES+=	or3.1
+${PACKAGE}FILES+=	pipe1.1
+${PACKAGE}FILES+=	pipe2.0
+${PACKAGE}FILES+=	return1.0
+${PACKAGE}FILES+=	semi1.1
+${PACKAGE}FILES+=	semi2.1
+${PACKAGE}FILES+=	subshell1.0
+${PACKAGE}FILES+=	subshell2.1
+${PACKAGE}FILES+=	until1.0
+${PACKAGE}FILES+=	until2.0
+${PACKAGE}FILES+=	until3.0
+${PACKAGE}FILES+=	while1.0
+${PACKAGE}FILES+=	while2.0
+${PACKAGE}FILES+=	while3.0
+
+.include <bsd.test.mk>
diff --git a/bin/1sh/tests/set-e/Makefile.depend b/bin/1sh/tests/set-e/Makefile.depend
new file mode 100644
index 00000000..110a72e1
--- /dev/null
+++ b/bin/1sh/tests/set-e/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/Makefile.depend 296587 2016-03-09 22:46:01Z bdrewery $
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/bin/1sh/tests/set-e/and1.0 b/bin/1sh/tests/set-e/and1.0
new file mode 100644
index 00000000..dc5a0108
--- /dev/null
+++ b/bin/1sh/tests/set-e/and1.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/and1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+true && true
diff --git a/bin/1sh/tests/set-e/and2.1 b/bin/1sh/tests/set-e/and2.1
new file mode 100644
index 00000000..c964f3df
--- /dev/null
+++ b/bin/1sh/tests/set-e/and2.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/and2.1 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+true && false
+exit 0
diff --git a/bin/1sh/tests/set-e/and3.0 b/bin/1sh/tests/set-e/and3.0
new file mode 100644
index 00000000..b3ef8b3d
--- /dev/null
+++ b/bin/1sh/tests/set-e/and3.0
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/and3.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+false && true
+exit 0
diff --git a/bin/1sh/tests/set-e/and4.0 b/bin/1sh/tests/set-e/and4.0
new file mode 100644
index 00000000..356804dd
--- /dev/null
+++ b/bin/1sh/tests/set-e/and4.0
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/and4.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+false && false
+exit 0
diff --git a/bin/1sh/tests/set-e/background1.0 b/bin/1sh/tests/set-e/background1.0
new file mode 100644
index 00000000..b7d70c7e
--- /dev/null
+++ b/bin/1sh/tests/set-e/background1.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/background1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+false &
diff --git a/bin/1sh/tests/set-e/cmd1.0 b/bin/1sh/tests/set-e/cmd1.0
new file mode 100644
index 00000000..f88034f7
--- /dev/null
+++ b/bin/1sh/tests/set-e/cmd1.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/cmd1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+true
diff --git a/bin/1sh/tests/set-e/cmd2.1 b/bin/1sh/tests/set-e/cmd2.1
new file mode 100644
index 00000000..a8dbf64f
--- /dev/null
+++ b/bin/1sh/tests/set-e/cmd2.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/cmd2.1 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+false
+exit 0
diff --git a/bin/1sh/tests/set-e/elif1.0 b/bin/1sh/tests/set-e/elif1.0
new file mode 100644
index 00000000..aa8ee945
--- /dev/null
+++ b/bin/1sh/tests/set-e/elif1.0
@@ -0,0 +1,7 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/elif1.0 211399 2010-08-16 17:18:08Z jilles $
+set -e
+if false; then
+	:
+elif false; then
+	:
+fi
diff --git a/bin/1sh/tests/set-e/elif2.0 b/bin/1sh/tests/set-e/elif2.0
new file mode 100644
index 00000000..f742f81b
--- /dev/null
+++ b/bin/1sh/tests/set-e/elif2.0
@@ -0,0 +1,7 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/elif2.0 211399 2010-08-16 17:18:08Z jilles $
+set -e
+if false; then
+	:
+elif false; false; then
+	:
+fi
diff --git a/bin/1sh/tests/set-e/eval1.0 b/bin/1sh/tests/set-e/eval1.0
new file mode 100644
index 00000000..257ccd06
--- /dev/null
+++ b/bin/1sh/tests/set-e/eval1.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/eval1.0 193178 2009-05-31 17:23:27Z stefanf $
+set -e
+eval false || true
diff --git a/bin/1sh/tests/set-e/eval2.1 b/bin/1sh/tests/set-e/eval2.1
new file mode 100644
index 00000000..c6f161b9
--- /dev/null
+++ b/bin/1sh/tests/set-e/eval2.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/eval2.1 193178 2009-05-31 17:23:27Z stefanf $
+set -e
+eval false
+exit 0
diff --git a/bin/1sh/tests/set-e/for1.0 b/bin/1sh/tests/set-e/for1.0
new file mode 100644
index 00000000..344d851c
--- /dev/null
+++ b/bin/1sh/tests/set-e/for1.0
@@ -0,0 +1,9 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/for1.0 149791 2005-09-05 09:42:10Z stefanf $
+set -e
+f() {
+	for i in a b c; do
+		false
+		true
+	done
+}
+f || true
diff --git a/bin/1sh/tests/set-e/func1.0 b/bin/1sh/tests/set-e/func1.0
new file mode 100644
index 00000000..a3435785
--- /dev/null
+++ b/bin/1sh/tests/set-e/func1.0
@@ -0,0 +1,7 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/func1.0 149791 2005-09-05 09:42:10Z stefanf $
+set -e
+f() {
+	false
+	true
+}
+f || true
diff --git a/bin/1sh/tests/set-e/func2.1 b/bin/1sh/tests/set-e/func2.1
new file mode 100644
index 00000000..1ac1b46f
--- /dev/null
+++ b/bin/1sh/tests/set-e/func2.1
@@ -0,0 +1,7 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/func2.1 149791 2005-09-05 09:42:10Z stefanf $
+set -e
+f() {
+	false
+	exit 0
+}
+f
diff --git a/bin/1sh/tests/set-e/if1.0 b/bin/1sh/tests/set-e/if1.0
new file mode 100644
index 00000000..19cf155f
--- /dev/null
+++ b/bin/1sh/tests/set-e/if1.0
@@ -0,0 +1,5 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/if1.0 211399 2010-08-16 17:18:08Z jilles $
+set -e
+if false; then
+	:
+fi
diff --git a/bin/1sh/tests/set-e/if2.0 b/bin/1sh/tests/set-e/if2.0
new file mode 100644
index 00000000..52e6e596
--- /dev/null
+++ b/bin/1sh/tests/set-e/if2.0
@@ -0,0 +1,7 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/if2.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+# PR 28852
+if true; then
+	false && true
+fi
+exit 0
diff --git a/bin/1sh/tests/set-e/if3.0 b/bin/1sh/tests/set-e/if3.0
new file mode 100644
index 00000000..61598039
--- /dev/null
+++ b/bin/1sh/tests/set-e/if3.0
@@ -0,0 +1,5 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/if3.0 211399 2010-08-16 17:18:08Z jilles $
+set -e
+if false; false; then
+	:
+fi
diff --git a/bin/1sh/tests/set-e/not1.0 b/bin/1sh/tests/set-e/not1.0
new file mode 100644
index 00000000..5421ab4a
--- /dev/null
+++ b/bin/1sh/tests/set-e/not1.0
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/not1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+! true
+exit 0
diff --git a/bin/1sh/tests/set-e/not2.0 b/bin/1sh/tests/set-e/not2.0
new file mode 100644
index 00000000..146f4949
--- /dev/null
+++ b/bin/1sh/tests/set-e/not2.0
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/not2.0 193178 2009-05-31 17:23:27Z stefanf $
+set -e
+! false
+! eval false
diff --git a/bin/1sh/tests/set-e/or1.0 b/bin/1sh/tests/set-e/or1.0
new file mode 100644
index 00000000..bdf99f7a
--- /dev/null
+++ b/bin/1sh/tests/set-e/or1.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/or1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+true || false
diff --git a/bin/1sh/tests/set-e/or2.0 b/bin/1sh/tests/set-e/or2.0
new file mode 100644
index 00000000..d96ae4a7
--- /dev/null
+++ b/bin/1sh/tests/set-e/or2.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/or2.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+false || true
diff --git a/bin/1sh/tests/set-e/or3.1 b/bin/1sh/tests/set-e/or3.1
new file mode 100644
index 00000000..3cde1bff
--- /dev/null
+++ b/bin/1sh/tests/set-e/or3.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/or3.1 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+false || false
+exit 0
diff --git a/bin/1sh/tests/set-e/pipe1.1 b/bin/1sh/tests/set-e/pipe1.1
new file mode 100644
index 00000000..b3937ad4
--- /dev/null
+++ b/bin/1sh/tests/set-e/pipe1.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/pipe1.1 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+true | false
+exit 0
diff --git a/bin/1sh/tests/set-e/pipe2.0 b/bin/1sh/tests/set-e/pipe2.0
new file mode 100644
index 00000000..50d90306
--- /dev/null
+++ b/bin/1sh/tests/set-e/pipe2.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/pipe2.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+false | true
diff --git a/bin/1sh/tests/set-e/return1.0 b/bin/1sh/tests/set-e/return1.0
new file mode 100644
index 00000000..39439b51
--- /dev/null
+++ b/bin/1sh/tests/set-e/return1.0
@@ -0,0 +1,11 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/return1.0 149788 2005-09-04 21:29:09Z stefanf $
+set -e
+
+# PR 77067, 85267
+f() {
+	return 1
+	true
+}
+
+f || true
+exit 0
diff --git a/bin/1sh/tests/set-e/semi1.1 b/bin/1sh/tests/set-e/semi1.1
new file mode 100644
index 00000000..624d4915
--- /dev/null
+++ b/bin/1sh/tests/set-e/semi1.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/semi1.1 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+false; true
+exit 0
diff --git a/bin/1sh/tests/set-e/semi2.1 b/bin/1sh/tests/set-e/semi2.1
new file mode 100644
index 00000000..f6c8d468
--- /dev/null
+++ b/bin/1sh/tests/set-e/semi2.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/semi2.1 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+true; false
+exit 0
diff --git a/bin/1sh/tests/set-e/subshell1.0 b/bin/1sh/tests/set-e/subshell1.0
new file mode 100644
index 00000000..7975eac9
--- /dev/null
+++ b/bin/1sh/tests/set-e/subshell1.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/subshell1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+(true)
diff --git a/bin/1sh/tests/set-e/subshell2.1 b/bin/1sh/tests/set-e/subshell2.1
new file mode 100644
index 00000000..6b441cd5
--- /dev/null
+++ b/bin/1sh/tests/set-e/subshell2.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/subshell2.1 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+(false)
+exit 0
diff --git a/bin/1sh/tests/set-e/until1.0 b/bin/1sh/tests/set-e/until1.0
new file mode 100644
index 00000000..281b4617
--- /dev/null
+++ b/bin/1sh/tests/set-e/until1.0
@@ -0,0 +1,5 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/until1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+until false; do
+	break
+done
diff --git a/bin/1sh/tests/set-e/until2.0 b/bin/1sh/tests/set-e/until2.0
new file mode 100644
index 00000000..8b571d31
--- /dev/null
+++ b/bin/1sh/tests/set-e/until2.0
@@ -0,0 +1,5 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/until2.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+until false; false; do
+	break
+done
diff --git a/bin/1sh/tests/set-e/until3.0 b/bin/1sh/tests/set-e/until3.0
new file mode 100644
index 00000000..cc39584c
--- /dev/null
+++ b/bin/1sh/tests/set-e/until3.0
@@ -0,0 +1,9 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/until3.0 149791 2005-09-05 09:42:10Z stefanf $
+set -e
+f() {
+	until false; do
+		false
+		break
+	done
+}
+f || true
diff --git a/bin/1sh/tests/set-e/while1.0 b/bin/1sh/tests/set-e/while1.0
new file mode 100644
index 00000000..a60532c8
--- /dev/null
+++ b/bin/1sh/tests/set-e/while1.0
@@ -0,0 +1,5 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/while1.0 211399 2010-08-16 17:18:08Z jilles $
+set -e
+while false; do
+	:
+done
diff --git a/bin/1sh/tests/set-e/while2.0 b/bin/1sh/tests/set-e/while2.0
new file mode 100644
index 00000000..d0e4f71a
--- /dev/null
+++ b/bin/1sh/tests/set-e/while2.0
@@ -0,0 +1,5 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/while2.0 211399 2010-08-16 17:18:08Z jilles $
+set -e
+while false; false; do
+	:
+done
diff --git a/bin/1sh/tests/set-e/while3.0 b/bin/1sh/tests/set-e/while3.0
new file mode 100644
index 00000000..5a1b2695
--- /dev/null
+++ b/bin/1sh/tests/set-e/while3.0
@@ -0,0 +1,9 @@
+# $FreeBSD: releng/12.1/bin/sh/tests/set-e/while3.0 149791 2005-09-05 09:42:10Z stefanf $
+set -e
+f() {
+	while true; do
+		false
+		break
+	done
+}
+f || true