diff options
Diffstat (limited to 'shell_cmds/sh/tests/set-e')
37 files changed, 232 insertions, 0 deletions
diff --git a/shell_cmds/sh/tests/set-e/Makefile b/shell_cmds/sh/tests/set-e/Makefile new file mode 100644 index 0000000..2f13991 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/Makefile @@ -0,0 +1,46 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/Makefile.depend b/shell_cmds/sh/tests/set-e/Makefile.depend new file mode 100644 index 0000000..ea8dbbe --- /dev/null +++ b/shell_cmds/sh/tests/set-e/Makefile.depend @@ -0,0 +1,11 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/and1.0 b/shell_cmds/sh/tests/set-e/and1.0 new file mode 100644 index 0000000..4518124 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/and1.0 @@ -0,0 +1,3 @@ +# $FreeBSD: head/bin/sh/tests/set-e/and1.0 149781 2005-09-04 11:59:59Z stefanf $ +set -e +true && true diff --git a/shell_cmds/sh/tests/set-e/and2.1 b/shell_cmds/sh/tests/set-e/and2.1 new file mode 100644 index 0000000..2067f10 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/and2.1 @@ -0,0 +1,4 @@ +# $FreeBSD: head/bin/sh/tests/set-e/and2.1 149781 2005-09-04 11:59:59Z stefanf $ +set -e +true && false +exit 0 diff --git a/shell_cmds/sh/tests/set-e/and3.0 b/shell_cmds/sh/tests/set-e/and3.0 new file mode 100644 index 0000000..59dccce --- /dev/null +++ b/shell_cmds/sh/tests/set-e/and3.0 @@ -0,0 +1,4 @@ +# $FreeBSD: head/bin/sh/tests/set-e/and3.0 149781 2005-09-04 11:59:59Z stefanf $ +set -e +false && true +exit 0 diff --git a/shell_cmds/sh/tests/set-e/and4.0 b/shell_cmds/sh/tests/set-e/and4.0 new file mode 100644 index 0000000..fd1cc72 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/and4.0 @@ -0,0 +1,4 @@ +# $FreeBSD: head/bin/sh/tests/set-e/and4.0 149781 2005-09-04 11:59:59Z stefanf $ +set -e +false && false +exit 0 diff --git a/shell_cmds/sh/tests/set-e/background1.0 b/shell_cmds/sh/tests/set-e/background1.0 new file mode 100644 index 0000000..e31b7a3 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/background1.0 @@ -0,0 +1,3 @@ +# $FreeBSD: head/bin/sh/tests/set-e/background1.0 149781 2005-09-04 11:59:59Z stefanf $ +set -e +false & diff --git a/shell_cmds/sh/tests/set-e/cmd1.0 b/shell_cmds/sh/tests/set-e/cmd1.0 new file mode 100644 index 0000000..7c6c843 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/cmd1.0 @@ -0,0 +1,3 @@ +# $FreeBSD: head/bin/sh/tests/set-e/cmd1.0 149781 2005-09-04 11:59:59Z stefanf $ +set -e +true diff --git a/shell_cmds/sh/tests/set-e/cmd2.1 b/shell_cmds/sh/tests/set-e/cmd2.1 new file mode 100644 index 0000000..05a4243 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/cmd2.1 @@ -0,0 +1,4 @@ +# $FreeBSD: head/bin/sh/tests/set-e/cmd2.1 149781 2005-09-04 11:59:59Z stefanf $ +set -e +false +exit 0 diff --git a/shell_cmds/sh/tests/set-e/elif1.0 b/shell_cmds/sh/tests/set-e/elif1.0 new file mode 100644 index 0000000..38ccaec --- /dev/null +++ b/shell_cmds/sh/tests/set-e/elif1.0 @@ -0,0 +1,7 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/elif2.0 b/shell_cmds/sh/tests/set-e/elif2.0 new file mode 100644 index 0000000..694b3f0 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/elif2.0 @@ -0,0 +1,7 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/eval1.0 b/shell_cmds/sh/tests/set-e/eval1.0 new file mode 100644 index 0000000..cefaf91 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/eval1.0 @@ -0,0 +1,3 @@ +# $FreeBSD: head/bin/sh/tests/set-e/eval1.0 193178 2009-05-31 17:23:27Z stefanf $ +set -e +eval false || true diff --git a/shell_cmds/sh/tests/set-e/eval2.1 b/shell_cmds/sh/tests/set-e/eval2.1 new file mode 100644 index 0000000..e396e1c --- /dev/null +++ b/shell_cmds/sh/tests/set-e/eval2.1 @@ -0,0 +1,4 @@ +# $FreeBSD: head/bin/sh/tests/set-e/eval2.1 193178 2009-05-31 17:23:27Z stefanf $ +set -e +eval false +exit 0 diff --git a/shell_cmds/sh/tests/set-e/for1.0 b/shell_cmds/sh/tests/set-e/for1.0 new file mode 100644 index 0000000..d0f7d8f --- /dev/null +++ b/shell_cmds/sh/tests/set-e/for1.0 @@ -0,0 +1,9 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/func1.0 b/shell_cmds/sh/tests/set-e/func1.0 new file mode 100644 index 0000000..c76d689 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/func1.0 @@ -0,0 +1,7 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/func2.1 b/shell_cmds/sh/tests/set-e/func2.1 new file mode 100644 index 0000000..267966d --- /dev/null +++ b/shell_cmds/sh/tests/set-e/func2.1 @@ -0,0 +1,7 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/if1.0 b/shell_cmds/sh/tests/set-e/if1.0 new file mode 100644 index 0000000..5697e2f --- /dev/null +++ b/shell_cmds/sh/tests/set-e/if1.0 @@ -0,0 +1,5 @@ +# $FreeBSD: head/bin/sh/tests/set-e/if1.0 211399 2010-08-16 17:18:08Z jilles $ +set -e +if false; then + : +fi diff --git a/shell_cmds/sh/tests/set-e/if2.0 b/shell_cmds/sh/tests/set-e/if2.0 new file mode 100644 index 0000000..188361b --- /dev/null +++ b/shell_cmds/sh/tests/set-e/if2.0 @@ -0,0 +1,7 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/if3.0 b/shell_cmds/sh/tests/set-e/if3.0 new file mode 100644 index 0000000..e3d8d6e --- /dev/null +++ b/shell_cmds/sh/tests/set-e/if3.0 @@ -0,0 +1,5 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/not1.0 b/shell_cmds/sh/tests/set-e/not1.0 new file mode 100644 index 0000000..b694be8 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/not1.0 @@ -0,0 +1,4 @@ +# $FreeBSD: head/bin/sh/tests/set-e/not1.0 149781 2005-09-04 11:59:59Z stefanf $ +set -e +! true +exit 0 diff --git a/shell_cmds/sh/tests/set-e/not2.0 b/shell_cmds/sh/tests/set-e/not2.0 new file mode 100644 index 0000000..d9ea5e9 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/not2.0 @@ -0,0 +1,4 @@ +# $FreeBSD: head/bin/sh/tests/set-e/not2.0 193178 2009-05-31 17:23:27Z stefanf $ +set -e +! false +! eval false diff --git a/shell_cmds/sh/tests/set-e/or1.0 b/shell_cmds/sh/tests/set-e/or1.0 new file mode 100644 index 0000000..5000f0b --- /dev/null +++ b/shell_cmds/sh/tests/set-e/or1.0 @@ -0,0 +1,3 @@ +# $FreeBSD: head/bin/sh/tests/set-e/or1.0 149781 2005-09-04 11:59:59Z stefanf $ +set -e +true || false diff --git a/shell_cmds/sh/tests/set-e/or2.0 b/shell_cmds/sh/tests/set-e/or2.0 new file mode 100644 index 0000000..6964220 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/or2.0 @@ -0,0 +1,3 @@ +# $FreeBSD: head/bin/sh/tests/set-e/or2.0 149781 2005-09-04 11:59:59Z stefanf $ +set -e +false || true diff --git a/shell_cmds/sh/tests/set-e/or3.1 b/shell_cmds/sh/tests/set-e/or3.1 new file mode 100644 index 0000000..29af2c2 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/or3.1 @@ -0,0 +1,4 @@ +# $FreeBSD: head/bin/sh/tests/set-e/or3.1 149781 2005-09-04 11:59:59Z stefanf $ +set -e +false || false +exit 0 diff --git a/shell_cmds/sh/tests/set-e/pipe1.1 b/shell_cmds/sh/tests/set-e/pipe1.1 new file mode 100644 index 0000000..122af07 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/pipe1.1 @@ -0,0 +1,4 @@ +# $FreeBSD: head/bin/sh/tests/set-e/pipe1.1 149781 2005-09-04 11:59:59Z stefanf $ +set -e +true | false +exit 0 diff --git a/shell_cmds/sh/tests/set-e/pipe2.0 b/shell_cmds/sh/tests/set-e/pipe2.0 new file mode 100644 index 0000000..d80fd93 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/pipe2.0 @@ -0,0 +1,3 @@ +# $FreeBSD: head/bin/sh/tests/set-e/pipe2.0 149781 2005-09-04 11:59:59Z stefanf $ +set -e +false | true diff --git a/shell_cmds/sh/tests/set-e/return1.0 b/shell_cmds/sh/tests/set-e/return1.0 new file mode 100644 index 0000000..d157059 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/return1.0 @@ -0,0 +1,11 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/semi1.1 b/shell_cmds/sh/tests/set-e/semi1.1 new file mode 100644 index 0000000..5991f8d --- /dev/null +++ b/shell_cmds/sh/tests/set-e/semi1.1 @@ -0,0 +1,4 @@ +# $FreeBSD: head/bin/sh/tests/set-e/semi1.1 149781 2005-09-04 11:59:59Z stefanf $ +set -e +false; true +exit 0 diff --git a/shell_cmds/sh/tests/set-e/semi2.1 b/shell_cmds/sh/tests/set-e/semi2.1 new file mode 100644 index 0000000..6851700 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/semi2.1 @@ -0,0 +1,4 @@ +# $FreeBSD: head/bin/sh/tests/set-e/semi2.1 149781 2005-09-04 11:59:59Z stefanf $ +set -e +true; false +exit 0 diff --git a/shell_cmds/sh/tests/set-e/subshell1.0 b/shell_cmds/sh/tests/set-e/subshell1.0 new file mode 100644 index 0000000..fa2ec82 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/subshell1.0 @@ -0,0 +1,3 @@ +# $FreeBSD: head/bin/sh/tests/set-e/subshell1.0 149781 2005-09-04 11:59:59Z stefanf $ +set -e +(true) diff --git a/shell_cmds/sh/tests/set-e/subshell2.1 b/shell_cmds/sh/tests/set-e/subshell2.1 new file mode 100644 index 0000000..03b09dc --- /dev/null +++ b/shell_cmds/sh/tests/set-e/subshell2.1 @@ -0,0 +1,4 @@ +# $FreeBSD: head/bin/sh/tests/set-e/subshell2.1 149781 2005-09-04 11:59:59Z stefanf $ +set -e +(false) +exit 0 diff --git a/shell_cmds/sh/tests/set-e/until1.0 b/shell_cmds/sh/tests/set-e/until1.0 new file mode 100644 index 0000000..c4d2edd --- /dev/null +++ b/shell_cmds/sh/tests/set-e/until1.0 @@ -0,0 +1,5 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/until2.0 b/shell_cmds/sh/tests/set-e/until2.0 new file mode 100644 index 0000000..d19a740 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/until2.0 @@ -0,0 +1,5 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/until3.0 b/shell_cmds/sh/tests/set-e/until3.0 new file mode 100644 index 0000000..2f77903 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/until3.0 @@ -0,0 +1,9 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/while1.0 b/shell_cmds/sh/tests/set-e/while1.0 new file mode 100644 index 0000000..6d7fe0a --- /dev/null +++ b/shell_cmds/sh/tests/set-e/while1.0 @@ -0,0 +1,5 @@ +# $FreeBSD: head/bin/sh/tests/set-e/while1.0 211399 2010-08-16 17:18:08Z jilles $ +set -e +while false; do + : +done diff --git a/shell_cmds/sh/tests/set-e/while2.0 b/shell_cmds/sh/tests/set-e/while2.0 new file mode 100644 index 0000000..fe2f2ba --- /dev/null +++ b/shell_cmds/sh/tests/set-e/while2.0 @@ -0,0 +1,5 @@ +# $FreeBSD: head/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/shell_cmds/sh/tests/set-e/while3.0 b/shell_cmds/sh/tests/set-e/while3.0 new file mode 100644 index 0000000..bf87175 --- /dev/null +++ b/shell_cmds/sh/tests/set-e/while3.0 @@ -0,0 +1,9 @@ +# $FreeBSD: head/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 |