Results for builtin-trap-err.test.sh

statusoshosh-cpp
pass 1717
ok 11
FAIL 22
total2020
caseoshosh-cppdescription
0pass pass trap can use original $LINENO
1pass pass trap ERR and set -o errexit
2pass pass trap ERR and errexit disabled context
3pass pass trap ERR and if statement
4pass pass trap ERR and || conditional
5pass pass trap ERR and pipeline
6pass pass trap ERR pipelines without simple commands
7pass pass Pipeline group quirk
8pass pass trap ERR does not run in errexit situations
9pass pass trap ERR doesn't run in subprograms - subshell, command sub, async
10FAIL FAIL set -o errtrace: trap ERR runs in subprograms
detailsdetails
11pass pass trap ERR not active in shell functions in (bash behavior)
12FAIL FAIL set -o errtrace - trap ERR runs in shell functions
detailsdetails
13pass pass trap ERR with "atoms": assignment (( [[
14pass pass trap ERR with for, case, { }
15pass pass trap ERR with redirect
16pass pass trap ERR with YSH proc
17pass pass trap ERR
18ok ok trap ERR and pipelines - PIPESTATUS difference
detailsdetails
19pass pass error in trap ERR (recursive)
34 passed, 2 OK, 0 not implemented, 0 BUG, 2 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh10 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 9953
[1] Done PID 9954
osh-cpp10 set -o errtrace: trap ERR runs in subprograms

[osh-cpp 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 9967
[1] Done PID 9969
osh12 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'
osh-cpp12 set -o errtrace - trap ERR runs in shell functions

[osh-cpp 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'
osh18 trap ERR and pipelines - PIPESTATUS difference

stdout:
A
err [] status=1 []
B
err [] status=1 [0 1]
err [] status=1 [0 1 0]
ok
stderr:
osh-cpp18 trap ERR and pipelines - PIPESTATUS difference

stdout:
A
err [] status=1 []
B
err [] status=1 [0 1]
err [] status=1 [0 1 0]
ok
stderr: