Results for builtin-trap.test.sh

statusdashbashmkshosh
pass 12221417
ok 1011
N-I 9060
BUG 1120
FAIL 0005
total23232323
casedashbashmkshoshdescription
0N-I pass N-I pass trap -l
detailsdetails
1pass pass pass pass trap accepts/ignores --
2pass pass pass ok trap 'echo hi' KILL (regression test, caught by smoosh suite)
details
3N-I pass N-I pass trap -p
detailsdetails
4pass pass pass pass Register invalid trap
5pass pass pass pass Remove invalid trap
6N-I pass pass pass SIGINT and INT are aliases
details
7ok pass BUG pass Invalid trap invocation
detailsdetails
8BUG BUG BUG pass exit 1 when trap code string is invalid
detailsdetailsdetails
9pass pass pass pass trap EXIT calling exit
10pass pass pass pass trap EXIT return status ignored
11pass pass ok pass trap EXIT with PARSE error
details
12pass pass pass pass trap EXIT with PARSE error and explicit exit
13pass pass pass pass trap EXIT with explicit exit
14N-I pass N-I FAIL trap DEBUG
detailsdetailsdetails
15N-I pass N-I FAIL trap DEBUG and pipeline
detailsdetailsdetails
16N-I pass N-I FAIL trap DEBUG with compound commands
detailsdetailsdetails
17N-I pass N-I FAIL trap RETURN
detailsdetailsdetails
18N-I pass pass FAIL trap ERR and disable it
detailsdetails
19pass pass pass pass trap 0 is equivalent to EXIT
20N-I pass pass pass trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP
details
21pass pass pass pass eval in the exit trap (regression for issue #293)
22pass pass pass pass exit codes for traps are isolated
65 passed, 3 OK, 15 not implemented, 4 BUG, 5 failed, 0 timeouts, 0 cases skipped
5 failed under osh

Details on runs that didn't PASS

dash0 trap -l

stdout:
stderr: 
dash: 1: trap: Illegal option -l
mksh0 trap -l

stdout:
stderr: 
mksh: <stdin>[1]: trap: -l: unknown option
osh2 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: Signal 'KILL' can't be handled
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:5: Signal 'STOP' can't be handled
dash3 trap -p

stdout:
exit
stderr:
dash: 2: trap: Illegal option -p
mksh3 trap -p

stdout:
exit
stderr:
mksh: <stdin>[2]: trap: -p: unknown option
dash6 SIGINT and INT are aliases

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

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

stdout:
status=0
stderr:
dash8 exit 1 when trap code string is invalid

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

stdout:
status=0
stderr:
mksh: syntax error: unexpected EOF
mksh11 trap EXIT with PARSE error

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

stdout:
1
2
stderr:
trap: DEBUG: bad trap
mksh14 trap DEBUG

stdout:
1
2
stderr:
mksh: <stdin>[4]: trap: bad signal 'DEBUG'
osh14 trap DEBUG

[osh stdout] Expected 'debuglog [x y]\n1\ndebuglog [x y]\n2\n', got '1\n2\n'

stdout:
1
2
stderr:
osh warning: The 'DEBUG' hook isn't implemented
dash15 trap DEBUG and pipeline

stdout:
stderr: 
mksh15 trap DEBUG and pipeline

stdout:
stderr: 
osh15 trap DEBUG and pipeline

[osh stdout] Expected ' [6]\na\n [6]\nb\n [7]\n2\n [8]\n [8]\n1\n [9]\n [10]\n1\n', got 'a\nb\n2\n1\n1\n'

stdout:
a
b
2
1
1
stderr:
osh warning: The 'DEBUG' hook isn't implemented
dash16 trap DEBUG with compound commands

stdout:
stderr: 
mksh16 trap DEBUG with compound commands

stdout:
stderr: 
osh16 trap DEBUG with compound commands

[osh stdout] Expected ' [12]\n-- assign --\n [13]\n [14]\n-- function call --\n [15]\n [16]\n-- for --\n [17]\n [18]\nfor1 1\n [19]\nfor2 1\n [17]\n [18]\nfor1 2\n [19]\nfor2 2\n [21]\n-- while --\n [22]\n [23]\n [24]\nwhile1\n [25]\nwhile2\n [26]\n [23]\n [24]\nwhile1\n [25]\nwhile2\n [26]\n [23]\n [28]\n-- if --\n [29]\n [30]\nIF\n [32]\n-- case --\n [33]\n [35]\nCASE\n', got '-- assign --\n-- function call --\n-- for --\nfor1 1\nfor2 1\nfor1 2\nfor2 2\n-- while --\nwhile1\nwhile2\nwhile1\nwhile2\n-- if --\nIF\n-- case --\nCASE\n'

stdout:
-- assign --
-- function call --
-- for --
for1 1
for2 1
for1 2
for2 2
-- while --
while1
while2
while1
while2
-- if --
IF
-- case --
CASE
stderr:
osh warning: The 'DEBUG' hook isn't implemented
dash17 trap RETURN

stdout:
--
f
--
--
g
--
return-helper.sh
stderr:
trap: RETURN: bad trap
mksh17 trap RETURN

stdout:
--
f
--
--
g
--
return-helper.sh
stderr:
mksh: <stdin>[16]: trap: bad signal 'RETURN'
osh17 trap RETURN

[osh stdout] Expected '--\nf\n--\n--\ng\n--\nreturn-helper.sh\nprofile [x y]\n', got '--\nf\n--\n--\ng\n--\nreturn-helper.sh\n'

stdout:
--
f
--
--
g
--
return-helper.sh
stderr:
osh warning: The 'RETURN' hook isn't implemented
dash18 trap ERR and disable it

stdout:
1
2
3
stderr:
trap: ERR: bad trap
trap: ERR: bad trap
osh18 trap ERR and disable it

[osh stdout] Expected '1\nerr [x y] 1\n2\n3\n', got '1\n2\n3\n'

stdout:
1
2
3
stderr:
osh warning: The 'ERR' hook isn't implemented
dash20 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