Results for builtin-trap.test.sh

statusdashbashmkshoshosh_ALT
pass 1222141717
ok 10111
N-I 90600
BUG 11200
FAIL 00055
total2323232323
casedashbashmkshoshosh_ALTdescription
0N-I pass N-I pass pass trap -l
detailsdetails
1pass pass pass pass pass trap accepts/ignores --
2pass pass pass ok ok trap 'echo hi' KILL (regression test, caught by smoosh suite)
detailsdetails
3N-I pass N-I pass pass trap -p
detailsdetails
4pass pass pass pass pass Register invalid trap
5pass pass pass pass pass Remove invalid trap
6N-I pass pass pass pass SIGINT and INT are aliases
details
7ok pass BUG pass pass Invalid trap invocation
detailsdetails
8BUG BUG BUG pass pass exit 1 when trap code string is invalid
detailsdetailsdetails
9pass pass pass pass pass trap EXIT calling exit
10pass pass pass pass pass trap EXIT return status ignored
11pass pass ok pass pass trap EXIT with PARSE error
details
12pass pass pass pass pass trap EXIT with PARSE error and explicit exit
13pass pass pass pass pass trap EXIT with explicit exit
14N-I pass N-I FAIL FAIL trap DEBUG
detailsdetailsdetailsdetails
15N-I pass N-I FAIL FAIL trap DEBUG and pipeline
detailsdetailsdetailsdetails
16N-I pass N-I FAIL FAIL trap DEBUG with compound commands
detailsdetailsdetailsdetails
17N-I pass N-I FAIL FAIL trap RETURN
detailsdetailsdetailsdetails
18N-I pass pass FAIL FAIL trap ERR and disable it
detailsdetailsdetails
19pass pass pass pass pass trap 0 is equivalent to EXIT
20N-I pass pass pass pass trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP
details
21pass pass pass pass pass eval in the exit trap (regression for issue #293)
22pass pass pass pass pass exit codes for traps are isolated
82 passed, 4 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
osh_ALT2 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
osh_ALT14 trap DEBUG

[osh_ALT 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 ' [8]\na\n [8]\nb\n [10]\n2\n [12]\n [12]\n1\n [14]\n [15]\n1\n', got 'a\nb\n2\n1\n1\n'

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

[osh_ALT stdout] Expected ' [8]\na\n [8]\nb\n [10]\n2\n [12]\n [12]\n1\n [14]\n [15]\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 ' [16]\n-- assign --\n [17]\n [19]\n-- function call --\n [20]\n [23]\n-- for --\n [24]\n [25]\nfor1 1\n [26]\nfor2 1\n [24]\n [25]\nfor1 2\n [26]\nfor2 2\n [29]\n-- while --\n [30]\n [31]\n [32]\nwhile1\n [33]\nwhile2\n [34]\n [31]\n [32]\nwhile1\n [33]\nwhile2\n [34]\n [31]\n [37]\n-- if --\n [38]\n [39]\nIF\n [42]\n-- case --\n [43]\n [45]\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
osh_ALT16 trap DEBUG with compound commands

[osh_ALT stdout] Expected ' [16]\n-- assign --\n [17]\n [19]\n-- function call --\n [20]\n [23]\n-- for --\n [24]\n [25]\nfor1 1\n [26]\nfor2 1\n [24]\n [25]\nfor1 2\n [26]\nfor2 2\n [29]\n-- while --\n [30]\n [31]\n [32]\nwhile1\n [33]\nwhile2\n [34]\n [31]\n [32]\nwhile1\n [33]\nwhile2\n [34]\n [31]\n [37]\n-- if --\n [38]\n [39]\nIF\n [42]\n-- case --\n [43]\n [45]\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
osh_ALT17 trap RETURN

[osh_ALT 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
osh_ALT18 trap ERR and disable it

[osh_ALT 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