Results for builtin-trap-bash.test.sh

statusbashosh
pass 2820
ok 03
N-I 02
BUG 10
FAIL 04
total2929
casebashoshdescription
0pass pass trap -l
1pass pass trap -p
2BUG pass trap -p in child is BUGGY in bash
details
3pass pass trap DEBUG ignores $?
4pass pass but trap DEBUG respects errexit
5pass ok trap DEBUG with 'return'
details
6pass pass trap DEBUG with 'exit'
7pass pass trap DEBUG with non-compound commands
8pass pass trap DEBUG and control flow
9pass pass trap DEBUG and command sub / subshell
10pass pass trap DEBUG not run in forked interpreter for first pipeline part
11pass ok One 'echo' in first pipeline part - why does bash behave differently from case above?
details
12pass ok trap DEBUG and pipeline (lastpipe difference)
details
13pass pass trap DEBUG function call
14pass pass trap DEBUG case
15pass N-I trap DEBUG for each
details
16pass N-I trap DEBUG for expr
details
17pass pass trap DEBUG if while
18pass FAIL trap RETURN
details
19pass FAIL Compare trap DEBUG vs. trap ERR
details
20pass pass Combine DEBUG trap and USR1 trap
21pass pass Combine ERR trap and USR1 trap
22pass pass Combine DEBUG trap and ERR trap
23pass pass trap ERR with errtrace (-E)
24pass pass trap ERR without errtrace (+E)
25pass pass trap ERR LINENO
26pass pass trap ERR NoLastFork
27pass FAIL trap ERR shadowing with errtrace (-E)
details
28pass FAIL trap ERR shadowing without errtrace (+E)
details
48 passed, 3 OK, 2 not implemented, 1 BUG, 4 failed, 0 timeouts, 0 cases skipped
4 failed under osh

Details on runs that didn't PASS

bash2 trap -p in child is BUGGY in bash

stdout:
shown
exit
stderr:
osh5 trap DEBUG with 'return'

stdout:
  [7]
stderr:
osh11 One 'echo' in first pipeline part - why does bash behave differently from case above?

stdout:
  LINENO=7
pipeline
  LINENO=8
ok
stderr:
osh12 trap DEBUG and pipeline (lastpipe difference)

stdout:
  [6]
a
  [6]
b
  [8]
2
  [10]
1
  [14]
1
stderr:
osh15 trap DEBUG for each

stdout:
  [7]
x=1
  [7]
x=2
  [10]
ok
stderr:
osh16 trap DEBUG for expr

stdout:
  [7]
i=3
  [7]
i=4
  [10]
ok
stderr:
osh18 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
osh19 Compare trap DEBUG vs. trap ERR

[osh stdout] Expected 'dbg 3\ndbg 3\ndbg 3\ndbg 5\ndbg 5\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nok\n' Got 'dbg 3\ndbg 5\ndbg 5\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nok\n'

stdout:
dbg 3
dbg 5
dbg 5
dbg 5
dbg 7
dbg 9
err 14
err 16
ok
stderr:
osh27 trap ERR shadowing with errtrace (-E)

[osh stdout] Expected 'ERR\nERRx\nERR2\nERR\nERRx\nERR3\nERR\nERRx\nERR4\nERR4\nERRx\nERR5\nERR\nERRx\nERR6\nERR\nERR\nERRx\nERR7\nERR7\nERR7\nERRx\n' Got 'ERR\nERRx\nERR\nERRx\n\nERR\nERRx\nERR4\nERR4\nERRx\nERR\nERRx\nERR\nERR\nERRx\nERR7\nERR7\nERR7\nERRx\n'

stdout:
ERR
ERRx
ERR
ERRx

ERR
ERRx
ERR4
ERR4
ERRx
ERR
ERRx
ERR
ERR
ERRx
ERR7
ERR7
ERR7
ERRx
stderr:
date: invalid date ‘X’
date: invalid date ‘X’
date: invalid date ‘X’
date: invalid date ‘X’
[1] Done PID 11900
date: invalid date ‘X’
date: invalid date ‘X’
date: invalid date ‘X’
osh28 trap ERR shadowing without errtrace (+E)

[osh stdout] Expected 'ERR\nERRx\nERR2\nERR\nERRx\nERR3\nERR\nERRx\nERR4\nERR4\nERRx\nERR5\nERR\nERRx\nERR6\nERR\nERR\nERRx\nERR7\nERR7\nERR7\nERRx\n' Got 'ERR\nERRx\nERR\nERRx\n\nERR\nERRx\nERR4\nERR4\nERRx\nERR\nERRx\nERR\nERR\nERRx\nERR7\nERR7\nERR7\nERRx\n'

stdout:
ERR
ERRx
ERR
ERRx

ERR
ERRx
ERR4
ERR4
ERRx
ERR
ERRx
ERR
ERR
ERRx
ERR7
ERR7
ERR7
ERRx
stderr:
date: invalid date ‘X’
date: invalid date ‘X’
date: invalid date ‘X’
date: invalid date ‘X’
[1] Done PID 11926
date: invalid date ‘X’
date: invalid date ‘X’
date: invalid date ‘X’