Results for builtin-trap-bash.test.sh

statusoshosh-cpp
pass 1416
ok 33
N-I 22
FAIL 42
total2323
caseoshosh-cppdescription
0pass pass trap -l
1pass pass trap -p
2pass pass trap -p in child is BUGGY in bash
3pass pass trap DEBUG ignores $?
4pass pass but trap DEBUG respects errexit
5ok ok trap DEBUG with 'return'
detailsdetails
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
11ok ok One 'echo' in first pipeline part - why does bash behave differently from case above?
detailsdetails
12ok ok trap DEBUG and pipeline (lastpipe difference)
detailsdetails
13pass pass trap DEBUG function call
14pass pass trap DEBUG case
15N-I N-I trap DEBUG for each
detailsdetails
16N-I N-I trap DEBUG for expr
detailsdetails
17pass pass trap DEBUG if while
18FAIL FAIL trap RETURN
detailsdetails
19FAIL FAIL Compare trap DEBUG vs. trap ERR
detailsdetails
20FAIL pass Combine DEBUG trap and USR1 trap
details
21FAIL pass Combine ERR trap and USR1 trap
details
22pass pass Combine DEBUG trap and ERR trap
30 passed, 6 OK, 4 not implemented, 0 BUG, 4 failed, 0 timeouts, 0 cases skipped
4 failed under osh

Details on runs that didn't PASS

osh5 trap DEBUG with 'return'

stdout:
  [7]
stderr:
osh-cpp5 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:
osh-cpp11 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:
osh-cpp12 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:
osh-cpp15 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:
osh-cpp16 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
osh-cpp18 trap RETURN

[osh-cpp 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:
osh-cpp19 Compare trap DEBUG vs. trap ERR

[osh-cpp 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:
osh20 Combine DEBUG trap and USR1 trap

[osh stdout] Expected '6 dbg\n1 dbg\n1 dbg\n1 usr1\n7 dbg\nafter=0\n', got '6 dbg\n'
[osh status] Expected 0, got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
6 dbg
stderr:
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 201, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 170, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 140, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1240, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 365, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2051, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1850, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1585, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 874, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 546, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 385, in RunSimpleCommand
    status = p.RunProcess(self.waiter, trace.External(cmd_val.argv))
  File "/home/uke/oil/core/process.py", line 1193, in RunProcess
    return self.Wait(waiter)
  File "/home/uke/oil/core/process.py", line 1122, in Wait
    if waiter.WaitForOne() == W1_ECHILD:
  File "/home/uke/oil/core/process.py", line 1908, in WaitForOne
    pid, status = pyos.WaitPid(waitpid_options)
  File "/home/uke/oil/core/pyos.py", line 64, in WaitPid
    if e.errno == EINTR and gSignalSafe.PollUntrappedSigInt():
AttributeError: 'NoneType' object has no attribute 'PollUntrappedSigInt'
osh21 Combine ERR trap and USR1 trap

[osh stdout] Expected '1 err\n1 usr1\nafter=0\n', got ''
[osh status] Expected 0, got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 201, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 170, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 140, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1240, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 365, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2051, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1850, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1585, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 874, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 546, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 385, in RunSimpleCommand
    status = p.RunProcess(self.waiter, trace.External(cmd_val.argv))
  File "/home/uke/oil/core/process.py", line 1193, in RunProcess
    return self.Wait(waiter)
  File "/home/uke/oil/core/process.py", line 1122, in Wait
    if waiter.WaitForOne() == W1_ECHILD:
  File "/home/uke/oil/core/process.py", line 1908, in WaitForOne
    pid, status = pyos.WaitPid(waitpid_options)
  File "/home/uke/oil/core/pyos.py", line 64, in WaitPid
    if e.errno == EINTR and gSignalSafe.PollUntrappedSigInt():
AttributeError: 'NoneType' object has no attribute 'PollUntrappedSigInt'