diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2022-10-16 10:19:03 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2022-10-16 10:19:03 +0000 |
commit | 2b9e3b69a51861b2de0cd201a11e6c16f072d03a (patch) | |
tree | 345d2efeb7325989ed4a8de31b980986cea35c36 /regress/bin/ksh/trap.t | |
parent | 25d437c54184a2569af6ad592656227ff507a943 (diff) |
move/rename usr1 test to new signal block, tweak other name
Diffstat (limited to 'regress/bin/ksh/trap.t')
-rw-r--r-- | regress/bin/ksh/trap.t | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/regress/bin/ksh/trap.t b/regress/bin/ksh/trap.t index 8cead8bcd64..35c982da657 100644 --- a/regress/bin/ksh/trap.t +++ b/regress/bin/ksh/trap.t @@ -1,4 +1,4 @@ -# $OpenBSD: trap.t,v 1.4 2022/10/15 15:29:45 kn Exp $ +# $OpenBSD: trap.t,v 1.5 2022/10/16 10:19:02 kn Exp $ # # Check that I/O redirection failure triggers the ERR trap. @@ -55,7 +55,7 @@ expected-exit: e != 0 # Check that traps are run in the same order in which they were triggered. # -name: EXIT-always-runs +name: failed-ERR-runs-EXIT # XXX remove once bin/ksh/main.c r1.52 is backed out *AND* a new fix is in # XXX enable once bin/ksh/main.c r1.52 is backed out #expected-fail: yes @@ -73,22 +73,6 @@ expected-exit: e != 0 --- -name: signal-handling-is-no-error -description: - Check that gracefully handling a signal is not treated as error. -arguments: !-e! -stdin: - trap 'echo ERR' ERR - trap 'echo EXIT' EXIT - trap 'echo USR1' USR1 - kill -USR1 $$ -expected-stdout: - USR1 - EXIT -expected-exit: e == 0 ---- - - name: errexit-aborts-EXIT # XXX remove once bin/ksh/main.c r1.52 is backed out expected-fail: yes @@ -118,4 +102,23 @@ expected-stdout: EXIT ERR expected-exit: e != 0 - --- +--- + +# +# Check that the errexit option does not interfere with signal handler traps. +# + +name: handled-signal-is-no-error +description: + Check that gracefully handling a signal is not treated as error. +arguments: !-e! +stdin: + trap 'echo ERR' ERR + trap 'echo EXIT' EXIT + trap 'echo USR1' USR1 + kill -USR1 $$ +expected-stdout: + USR1 + EXIT +expected-exit: e == 0 +--- |