Results for builtin-trap.test.sh

statusdashbashmkshashosh
pass 1518151717
ok 10211
N-I 20000
BUG 11210
FAIL 00001
total1919191919
casedashbashmkshashoshdescription
0pass pass pass pass pass trap accepts/ignores --
1pass pass pass pass ok trap 'echo hi' KILL (regression test, caught by smoosh suite)
details
2pass pass pass pass pass Register invalid trap
3pass pass pass pass pass Remove invalid trap
4N-I pass pass pass pass SIGINT and INT are aliases
details
5ok pass BUG ok pass Invalid trap invocation
detailsdetailsdetails
6BUG BUG BUG BUG pass exit 1 when trap code string is invalid
detailsdetailsdetailsdetails
7pass pass pass pass pass trap EXIT calling exit
8pass pass pass pass pass trap EXIT return status ignored
9pass pass ok pass pass trap EXIT with PARSE error
details
10pass pass pass pass pass trap EXIT with PARSE error and explicit exit
11pass pass pass pass pass trap EXIT with explicit exit
12pass pass pass pass pass trap EXIT with command sub / subshell / pipeline
13pass pass pass pass pass trap 0 is equivalent to EXIT
14N-I pass pass pass pass trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP
details
15pass pass pass pass pass eval in the exit trap (regression for issue #293)
16pass pass pass pass pass exit codes for traps are isolated
17pass pass pass pass pass traps are cleared in subshell (started with &)
18pass pass ok pass FAIL trap INT, sleep, SIGINT: non-interactively
detailsdetails
82 passed, 5 OK, 2 not implemented, 5 BUG, 1 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

osh1 trap 'echo hi' KILL (regression test, caught by smoosh suite)

stdout:
status=1
status=1
status=1
status=0
stderr:
  trap 'echo hi' 9
                 ^
[ stdin ]:1: Signal '9' can't be handled
  trap 'echo hi' KILL
                 ^~~~
[ stdin ]:4: Invalid signal or hook 'KILL'
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:7: Signal 'STOP' can't be handled
dash4 SIGINT and INT are aliases

stdout:
1
0
stderr:
trap: SIGINT: bad trap
dash5 Invalid trap invocation

stdout:
status=1
stderr:
trap: foo: bad trap
mksh5 Invalid trap invocation

stdout:
status=0
stderr:
ash5 Invalid trap invocation

stdout:
status=1
stderr:
ash: trap: line 1: foo: invalid signal specification
dash6 exit 1 when trap code string is invalid

stdout:
status=0
stderr:
dash: 1: Syntax error: end of file unexpected
bash6 exit 1 when trap code string is invalid

stdout:
status=0
stderr:
bash: exit trap: line 1: syntax error near unexpected token `newline'
bash: exit trap: line 1: `echo <'
mksh6 exit 1 when trap code string is invalid

stdout:
status=0
stderr:
mksh: syntax error: unexpected EOF
ash6 exit 1 when trap code string is invalid

stdout:
status=0
stderr:
ash: syntax error: unexpected end of file
mksh9 trap EXIT with PARSE error

stdout:
FAILED
stderr:
mksh: <stdin>[2]: syntax error: 'newline' unexpected
dash14 trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP

stdout:
status=1
status=0
status=0
status=0
stderr:
trap: SIGHUP: bad trap
mksh18 trap INT, sleep, SIGINT: non-interactively

stdout:
mksh
stderr:
osh18 trap INT, sleep, SIGINT: non-interactively

[osh stdout] Expected '', got 'osh\n'

stdout:
osh
stderr: