Results for builtin-trap.test.sh

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

Details on runs that didn't PASS

dash0 trap -l

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 1: trap: Illegal option -l
mksh0 trap -l

stdout:
stderr: 
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[1]: trap: -l: unknown option
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: Signal 'KILL' can't be handled
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:5: Signal 'STOP' can't be handled
dash2 trap -p

stdout:
exit
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 2: trap: Illegal option -p
mksh2 trap -p

stdout:
exit
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: trap: -p: unknown option
dash5 SIGINT and INT are aliases

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

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

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

stdout:
status=0
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/dash: 1: Syntax error: end of file unexpected
bash7 exit 1 when trap code string is invalid

stdout:
status=0
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: exit trap: line 1: syntax error near unexpected token `newline'
/home/andy/git/oilshell/oil/_tmp/spec-bin/bash: exit trap: line 1: `echo <'
mksh7 exit 1 when trap code string is invalid

stdout:
status=0
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: syntax error: unexpected EOF
mksh10 trap EXIT with PARSE error

stdout:
FAILED
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[2]: syntax error: 'newline' unexpected
dash12 trap DEBUG

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

stdout:
1
2
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[4]: trap: bad signal 'DEBUG'
osh12 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 yet implemented 
dash13 trap RETURN

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

stdout:
--
f
--
--
g
--
return-helper.sh
stderr:
/home/andy/git/oilshell/oil/_tmp/spec-bin/mksh: <stdin>[16]: trap: bad signal 'RETURN'
osh13 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 yet implemented 
dash14 trap ERR and disable it

stdout:
1
2
3
stderr:
trap: ERR: bad trap
trap: ERR: bad trap
osh14 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 yet implemented 
dash16 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