Results for builtin-trap.test.sh

statusdashbashmkshoshosh_ALT
pass 1420181919
ok 10122
N-I 50000
BUG 11200
total2121212121
casedashbashmkshoshosh_ALTdescription
0pass pass pass pass pass trap accepts/ignores --
1pass pass pass ok ok trap 'echo hi' KILL (regression test, caught by smoosh suite)
detailsdetails
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 pass pass Invalid trap invocation
detailsdetails
6BUG BUG BUG pass pass exit 1 when trap code string is invalid
detailsdetailsdetails
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
13N-I pass pass pass pass trap ERR
details
14N-I pass pass ok ok trap ERR and pipelines (lastpipe and PIPESTATUS difference)
detailsdetailsdetails
15N-I pass pass pass pass error in trap ERR (recursive)
details
16pass pass pass pass pass trap 0 is equivalent to EXIT
17N-I pass pass pass pass trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP
details
18pass pass pass pass pass eval in the exit trap (regression for issue #293)
19pass pass pass pass pass exit codes for traps are isolated
20pass pass pass pass pass traps are cleared in subshell (started with &)
90 passed, 6 OK, 5 not implemented, 4 BUG, 0 failed, 0 timeouts, 0 cases skipped

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 ]:3: Invalid signal or hook 'KILL'
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:5: Signal 'STOP' can't be handled
osh_ALT1 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 ]:3: Invalid signal or hook 'KILL'
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:5: 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:
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
mksh9 trap EXIT with PARSE error

stdout:
FAILED
stderr:
mksh: <stdin>[2]: syntax error: 'newline' unexpected
dash13 trap ERR

stdout:
A
B
C
D
stderr:
trap: ERR: bad trap
trap: ERR: bad trap
trap: ERR: bad trap
dash14 trap ERR and pipelines (lastpipe and PIPESTATUS difference)

stdout:
stderr: 
osh14 trap ERR and pipelines (lastpipe and PIPESTATUS difference)

stdout:
A
err [] status=1 []
B
err [] status=1 [0 0]
err [] status=1 [0 1]
err [] status=1 [0 1 0]
ok
stderr:
osh_ALT14 trap ERR and pipelines (lastpipe and PIPESTATUS difference)

stdout:
A
err [] status=1 []
B
err [] status=1 [0 0]
err [] status=1 [0 1]
err [] status=1 [0 1 0]
ok
stderr:
dash15 error in trap ERR (recursive)

stdout:
stderr: 
dash17 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