Results for builtin-trap.test.sh

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

Details on runs that didn't PASS

dash3 SIGINT and INT are aliases

stdout:
1
0
stderr:
trap: SIGINT: bad trap
dash4 trap without args prints traps, like trap -p

stdout:
stderr: 
mksh4 trap without args prints traps, like trap -p

stdout:
status=0
status=1
stderr:
ash4 trap without args prints traps, like trap -p

stdout:
status=0
status=1
stderr:
osh4 trap without args prints traps, like trap -p

[osh stdout] Expected "status=0\ntrap -- 'true' EXIT\nstatus=0\n", got 'status=0\nstatus=1\n'

stdout:
status=0
status=1
stderr:
  trap | grep EXIT
  ^~~~
[ -c flag ]:6: 'trap' requires a code string
osh5 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
dash6 Invalid trap invocation

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

stdout:
status=0
stderr:
ash6 Invalid trap invocation

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

stdout:
status=0
stderr:
dash: 1: Syntax error: end of file unexpected
bash7 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 <'
mksh7 exit 1 when trap code string is invalid

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

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

stdout:
FAILED
stderr:
mksh: <stdin>[2]: syntax error: 'newline' unexpected
dash15 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
mksh20 trap INT, sleep, SIGINT: non-interactively

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

stdout:
int
status=0
stderr: