Results for builtin-trap-err.test.sh

statusbashmkshashosh
pass 16121414
ok 0001
N-I 1320
BUG 2430
FAIL 0004
total19191919
casebashmkshashoshdescription
0pass pass pass pass trap can use original $LINENO
1pass pass pass pass trap ERR and set -o errexit
2pass pass pass pass trap ERR and errexit disabled context
3pass pass pass pass trap ERR and if statement
4pass pass pass pass trap ERR and || conditional
5pass BUG BUG FAIL trap ERR and pipeline
detailsdetailsdetails
6BUG pass pass FAIL trap ERR pipelines without simple commands
detailsdetails
7pass pass pass pass trap ERR does not run in errexit situations
8pass pass pass pass trap ERR doesn't run in subprograms - subshell, command sub, async
9pass N-I BUG FAIL set -o errtrace: trap ERR runs in subprograms
detailsdetailsdetails
10pass N-I pass pass trap ERR not active in shell functions in (bash behavior)
details
11pass BUG pass FAIL set -o errtrace - trap ERR runs in shell functions
detailsdetails
12pass BUG pass pass trap ERR with "atoms": assignment (( [[
details
13pass pass pass pass trap ERR with for, case, { }
14BUG BUG BUG pass trap ERR with redirect
detailsdetailsdetails
15N-I N-I N-I pass trap ERR with YSH proc
detailsdetailsdetails
16pass pass pass pass trap ERR
17pass pass N-I ok trap ERR and pipelines (lastpipe and PIPESTATUS difference)
detailsdetails
18pass pass pass pass error in trap ERR (recursive)
56 passed, 1 OK, 6 not implemented, 9 BUG, 4 failed, 0 timeouts, 0 cases skipped
4 failed under osh

Details on runs that didn't PASS

mksh5 trap ERR and pipeline

stdout:
line=1
line=1
stderr:
ash5 trap ERR and pipeline

stdout:
line=1
line=1
stderr:
osh5 trap ERR and pipeline

[osh stdout] Expected 'line=3\nline=5\n', got 'line=3\nline=3\nline=5\nline=5\n'

stdout:
line=3
line=3
line=5
line=5
stderr:
bash6 trap ERR pipelines without simple commands

stdout:
assign
subshell
subshell
dparen
dbracket
ok
stderr:
osh6 trap ERR pipelines without simple commands

[osh stdout] Expected 'assign\nsubshell\ndparen\ndbracket\nok\n', got 'assign\nassign\nsubshell\nsubshell\ndparen\ndparen\ndbracket\ndbracket\nok\n'

stdout:
assign
assign
subshell
subshell
dparen
dparen
dbracket
dbracket
ok
stderr:
mksh9 set -o errtrace: trap ERR runs in subprograms

stdout:
stderr: 
ash9 set -o errtrace: trap ERR runs in subprograms

stdout:
subshell
async
line=14
ok
stderr:
osh9 set -o errtrace: trap ERR runs in subprograms

[osh stdout] Expected 'line=6\nsubshell\nline=12\nasync\nline=14\nok\n' Got 'subshell\nasync\nline=14\nok\n'

stdout:
subshell
async
line=14
ok
stderr:
  set -o errtrace
  ^~~
[ stdin ]:3: 'set' got invalid option 'errtrace'
[1] Done PID 11998
[1] Done PID 11999
mksh10 trap ERR not active in shell functions in (bash behavior)

stdout:
line=4
stderr:
mksh11 set -o errtrace - trap ERR runs in shell functions

stdout:
line=4
line=10
stderr:
mksh: <stdin>[16]: set: errtrace: bad option
osh11 set -o errtrace - trap ERR runs in shell functions

[osh stdout] Expected 'line=14\nnow with errtrace\nline=4\nline=10\nline=20\nok\n' Got 'line=10\nline=16\nnow with errtrace\nline=10\nok\n'

stdout:
line=10
line=16
now with errtrace
line=10
ok
stderr:
  set -o errtrace
  ^~~
[ stdin ]:16: 'set' got invalid option 'errtrace'
mksh12 trap ERR with "atoms": assignment (( [[

stdout:
line=3
line=3
line=7
ok
stderr:
bash14 trap ERR with redirect

stdout:
line=3
line=3
ok
stderr:
bash: line 7: /zz: Permission denied
mksh14 trap ERR with redirect

stdout:
line=3
line=3
ok
stderr:
mksh: <stdin>[7]: can't create /zz: Permission denied
ash14 trap ERR with redirect

stdout:
line=3
ok
stderr:
ash: can't create /zz: Permission denied
bash15 trap ERR with YSH proc

stdout:
stderr: 
mksh15 trap ERR with YSH proc

stdout:
stderr: 
ash15 trap ERR with YSH proc

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

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