summary refs log tree commit diff
path: root/bin/cash/tests/set-e
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-01-10 18:48:02 -0500
committerJune McEnroe <june@causal.agency>2019-01-10 18:48:02 -0500
commit935c68573f8e63468723dc2691957637e4e6bcb7 (patch)
tree420e76ad90ffc30fa498ee2cc37009c3b4db794f /bin/cash/tests/set-e
parentRemove character NETHACKOPTIONS (diff)
downloadsrc-935c68573f8e63468723dc2691957637e4e6bcb7.tar.gz
src-935c68573f8e63468723dc2691957637e4e6bcb7.zip
Import /usr/src/bin/sh from FreeBSD 12.0-RELEASE
Diffstat (limited to '')
-rw-r--r--bin/cash/tests/set-e/Makefile46
-rw-r--r--bin/cash/tests/set-e/and1.03
-rw-r--r--bin/cash/tests/set-e/and2.14
-rw-r--r--bin/cash/tests/set-e/and3.04
-rw-r--r--bin/cash/tests/set-e/and4.04
-rw-r--r--bin/cash/tests/set-e/background1.03
-rw-r--r--bin/cash/tests/set-e/cmd1.03
-rw-r--r--bin/cash/tests/set-e/cmd2.14
-rw-r--r--bin/cash/tests/set-e/elif1.07
-rw-r--r--bin/cash/tests/set-e/elif2.07
-rw-r--r--bin/cash/tests/set-e/eval1.03
-rw-r--r--bin/cash/tests/set-e/eval2.14
-rw-r--r--bin/cash/tests/set-e/for1.09
-rw-r--r--bin/cash/tests/set-e/func1.07
-rw-r--r--bin/cash/tests/set-e/func2.17
-rw-r--r--bin/cash/tests/set-e/if1.05
-rw-r--r--bin/cash/tests/set-e/if2.07
-rw-r--r--bin/cash/tests/set-e/if3.05
-rw-r--r--bin/cash/tests/set-e/not1.04
-rw-r--r--bin/cash/tests/set-e/not2.04
-rw-r--r--bin/cash/tests/set-e/or1.03
-rw-r--r--bin/cash/tests/set-e/or2.03
-rw-r--r--bin/cash/tests/set-e/or3.14
-rw-r--r--bin/cash/tests/set-e/pipe1.14
-rw-r--r--bin/cash/tests/set-e/pipe2.03
-rw-r--r--bin/cash/tests/set-e/return1.011
-rw-r--r--bin/cash/tests/set-e/semi1.14
-rw-r--r--bin/cash/tests/set-e/semi2.14
-rw-r--r--bin/cash/tests/set-e/subshell1.03
-rw-r--r--bin/cash/tests/set-e/subshell2.14
-rw-r--r--bin/cash/tests/set-e/until1.05
-rw-r--r--bin/cash/tests/set-e/until2.05
-rw-r--r--bin/cash/tests/set-e/until3.09
-rw-r--r--bin/cash/tests/set-e/while1.05
-rw-r--r--bin/cash/tests/set-e/while2.05
-rw-r--r--bin/cash/tests/set-e/while3.09
36 files changed, 221 insertions, 0 deletions
diff --git a/bin/cash/tests/set-e/Makefile b/bin/cash/tests/set-e/Makefile
new file mode 100644
index 00000000..c684777e
--- /dev/null
+++ b/bin/cash/tests/set-e/Makefile
@@ -0,0 +1,46 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/and1.0 b/bin/cash/tests/set-e/and1.0
new file mode 100644
index 00000000..084f86c1
--- /dev/null
+++ b/bin/cash/tests/set-e/and1.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/set-e/and1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+true && true
diff --git a/bin/cash/tests/set-e/and2.1 b/bin/cash/tests/set-e/and2.1
new file mode 100644
index 00000000..2687642e
--- /dev/null
+++ b/bin/cash/tests/set-e/and2.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/and3.0 b/bin/cash/tests/set-e/and3.0
new file mode 100644
index 00000000..5640de6e
--- /dev/null
+++ b/bin/cash/tests/set-e/and3.0
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/and4.0 b/bin/cash/tests/set-e/and4.0
new file mode 100644
index 00000000..b043af16
--- /dev/null
+++ b/bin/cash/tests/set-e/and4.0
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/background1.0 b/bin/cash/tests/set-e/background1.0
new file mode 100644
index 00000000..c547bfb4
--- /dev/null
+++ b/bin/cash/tests/set-e/background1.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/set-e/background1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+false &
diff --git a/bin/cash/tests/set-e/cmd1.0 b/bin/cash/tests/set-e/cmd1.0
new file mode 100644
index 00000000..e49d7568
--- /dev/null
+++ b/bin/cash/tests/set-e/cmd1.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/set-e/cmd1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+true
diff --git a/bin/cash/tests/set-e/cmd2.1 b/bin/cash/tests/set-e/cmd2.1
new file mode 100644
index 00000000..a0f9ec7e
--- /dev/null
+++ b/bin/cash/tests/set-e/cmd2.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/set-e/cmd2.1 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+false
+exit 0
diff --git a/bin/cash/tests/set-e/elif1.0 b/bin/cash/tests/set-e/elif1.0
new file mode 100644
index 00000000..2f2200d5
--- /dev/null
+++ b/bin/cash/tests/set-e/elif1.0
@@ -0,0 +1,7 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/elif2.0 b/bin/cash/tests/set-e/elif2.0
new file mode 100644
index 00000000..d53486d3
--- /dev/null
+++ b/bin/cash/tests/set-e/elif2.0
@@ -0,0 +1,7 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/eval1.0 b/bin/cash/tests/set-e/eval1.0
new file mode 100644
index 00000000..19585858
--- /dev/null
+++ b/bin/cash/tests/set-e/eval1.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/set-e/eval1.0 193178 2009-05-31 17:23:27Z stefanf $
+set -e
+eval false || true
diff --git a/bin/cash/tests/set-e/eval2.1 b/bin/cash/tests/set-e/eval2.1
new file mode 100644
index 00000000..207f1476
--- /dev/null
+++ b/bin/cash/tests/set-e/eval2.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/for1.0 b/bin/cash/tests/set-e/for1.0
new file mode 100644
index 00000000..c76d03cc
--- /dev/null
+++ b/bin/cash/tests/set-e/for1.0
@@ -0,0 +1,9 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/func1.0 b/bin/cash/tests/set-e/func1.0
new file mode 100644
index 00000000..70ec9ce6
--- /dev/null
+++ b/bin/cash/tests/set-e/func1.0
@@ -0,0 +1,7 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/func2.1 b/bin/cash/tests/set-e/func2.1
new file mode 100644
index 00000000..f69dd197
--- /dev/null
+++ b/bin/cash/tests/set-e/func2.1
@@ -0,0 +1,7 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/if1.0 b/bin/cash/tests/set-e/if1.0
new file mode 100644
index 00000000..c4627037
--- /dev/null
+++ b/bin/cash/tests/set-e/if1.0
@@ -0,0 +1,5 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/if2.0 b/bin/cash/tests/set-e/if2.0
new file mode 100644
index 00000000..43df2e9b
--- /dev/null
+++ b/bin/cash/tests/set-e/if2.0
@@ -0,0 +1,7 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/if3.0 b/bin/cash/tests/set-e/if3.0
new file mode 100644
index 00000000..ccac10c3
--- /dev/null
+++ b/bin/cash/tests/set-e/if3.0
@@ -0,0 +1,5 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/not1.0 b/bin/cash/tests/set-e/not1.0
new file mode 100644
index 00000000..4d62e373
--- /dev/null
+++ b/bin/cash/tests/set-e/not1.0
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/set-e/not1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+! true
+exit 0
diff --git a/bin/cash/tests/set-e/not2.0 b/bin/cash/tests/set-e/not2.0
new file mode 100644
index 00000000..bf49130a
--- /dev/null
+++ b/bin/cash/tests/set-e/not2.0
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/set-e/not2.0 193178 2009-05-31 17:23:27Z stefanf $
+set -e
+! false
+! eval false
diff --git a/bin/cash/tests/set-e/or1.0 b/bin/cash/tests/set-e/or1.0
new file mode 100644
index 00000000..e22f304f
--- /dev/null
+++ b/bin/cash/tests/set-e/or1.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/set-e/or1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+true || false
diff --git a/bin/cash/tests/set-e/or2.0 b/bin/cash/tests/set-e/or2.0
new file mode 100644
index 00000000..ed4351d1
--- /dev/null
+++ b/bin/cash/tests/set-e/or2.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/set-e/or2.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+false || true
diff --git a/bin/cash/tests/set-e/or3.1 b/bin/cash/tests/set-e/or3.1
new file mode 100644
index 00000000..e23ae956
--- /dev/null
+++ b/bin/cash/tests/set-e/or3.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/pipe1.1 b/bin/cash/tests/set-e/pipe1.1
new file mode 100644
index 00000000..304befef
--- /dev/null
+++ b/bin/cash/tests/set-e/pipe1.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/pipe2.0 b/bin/cash/tests/set-e/pipe2.0
new file mode 100644
index 00000000..f9e6f62b
--- /dev/null
+++ b/bin/cash/tests/set-e/pipe2.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/set-e/pipe2.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+false | true
diff --git a/bin/cash/tests/set-e/return1.0 b/bin/cash/tests/set-e/return1.0
new file mode 100644
index 00000000..60e28147
--- /dev/null
+++ b/bin/cash/tests/set-e/return1.0
@@ -0,0 +1,11 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/semi1.1 b/bin/cash/tests/set-e/semi1.1
new file mode 100644
index 00000000..582f6562
--- /dev/null
+++ b/bin/cash/tests/set-e/semi1.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/semi2.1 b/bin/cash/tests/set-e/semi2.1
new file mode 100644
index 00000000..1fbad3b1
--- /dev/null
+++ b/bin/cash/tests/set-e/semi2.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/subshell1.0 b/bin/cash/tests/set-e/subshell1.0
new file mode 100644
index 00000000..6282da91
--- /dev/null
+++ b/bin/cash/tests/set-e/subshell1.0
@@ -0,0 +1,3 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/set-e/subshell1.0 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+(true)
diff --git a/bin/cash/tests/set-e/subshell2.1 b/bin/cash/tests/set-e/subshell2.1
new file mode 100644
index 00000000..a58d68e6
--- /dev/null
+++ b/bin/cash/tests/set-e/subshell2.1
@@ -0,0 +1,4 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/set-e/subshell2.1 149781 2005-09-04 11:59:59Z stefanf $
+set -e
+(false)
+exit 0
diff --git a/bin/cash/tests/set-e/until1.0 b/bin/cash/tests/set-e/until1.0
new file mode 100644
index 00000000..a3423d97
--- /dev/null
+++ b/bin/cash/tests/set-e/until1.0
@@ -0,0 +1,5 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/until2.0 b/bin/cash/tests/set-e/until2.0
new file mode 100644
index 00000000..e4e2682f
--- /dev/null
+++ b/bin/cash/tests/set-e/until2.0
@@ -0,0 +1,5 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/until3.0 b/bin/cash/tests/set-e/until3.0
new file mode 100644
index 00000000..28990ad5
--- /dev/null
+++ b/bin/cash/tests/set-e/until3.0
@@ -0,0 +1,9 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/while1.0 b/bin/cash/tests/set-e/while1.0
new file mode 100644
index 00000000..81874529
--- /dev/null
+++ b/bin/cash/tests/set-e/while1.0
@@ -0,0 +1,5 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/while2.0 b/bin/cash/tests/set-e/while2.0
new file mode 100644
index 00000000..66281fe6
--- /dev/null
+++ b/bin/cash/tests/set-e/while2.0
@@ -0,0 +1,5 @@
+# $FreeBSD: releng/12.0/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/cash/tests/set-e/while3.0 b/bin/cash/tests/set-e/while3.0
new file mode 100644
index 00000000..b165ef56
--- /dev/null
+++ b/bin/cash/tests/set-e/while3.0
@@ -0,0 +1,9 @@
+# $FreeBSD: releng/12.0/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