Results for builtin-trap.test.sh

statusoshosh-cpp
pass 1718
ok 11
FAIL 32
total2121
caseoshosh-cppdescription
0pass pass trap accepts/ignores --
1ok ok trap 'echo hi' KILL (regression test, caught by smoosh suite)
detailsdetails
2pass pass Register invalid trap
3pass pass Remove invalid trap
4pass pass SIGINT and INT are aliases
5pass pass Invalid trap invocation
6pass pass exit 1 when trap code string is invalid
7pass pass trap EXIT calling exit
8pass pass trap EXIT return status ignored
9pass pass trap EXIT with PARSE error
10pass pass trap EXIT with PARSE error and explicit exit
11pass pass trap EXIT with explicit exit
12pass pass trap EXIT with command sub / subshell / pipeline
13FAIL FAIL trap EXIT doesn't run with shopt -s no_fork_last
detailsdetails
14pass pass trap 0 is equivalent to EXIT
15pass pass trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP
16pass pass eval in the exit trap (regression for issue #293)
17pass pass exit codes for traps are isolated
18pass pass traps are cleared in subshell (started with &)
19FAIL pass trap USR1, sleep, SIGINT: non-interactively
details
20FAIL FAIL trap INT, sleep, SIGINT: non-interactively
detailsdetails
35 passed, 2 OK, 0 not implemented, 0 BUG, 3 failed, 0 timeouts, 0 cases skipped
3 failed under osh

Details on runs that didn't PASS

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 ]:4: Invalid signal or hook 'KILL'
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:7: Signal 'STOP' can't be handled
osh-cpp1 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 ]:4: Invalid signal or hook 'KILL'
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:7: Signal 'STOP' can't be handled
osh13 trap EXIT doesn't run with shopt -s no_fork_last

[osh stdout] Expected 'exit1\nexit2\n', got 'exit1\nexit2\nexit3\n'

stdout:
exit1
exit2
exit3
stderr:
  shopt -s no_fork_last
  ^~~~~
[ -c flag ]:1: 'shopt' got invalid option 'no_fork_last'
osh-cpp13 trap EXIT doesn't run with shopt -s no_fork_last

[osh-cpp stdout] Expected 'exit1\nexit2\n', got 'exit1\nexit2\nexit3\n'

stdout:
exit1
exit2
exit3
stderr:
  shopt -s no_fork_last
  ^~~~~
[ -c flag ]:1: 'shopt' got invalid option 'no_fork_last'
osh19 trap USR1, sleep, SIGINT: non-interactively

[osh stdout] Expected 'usr1\nstatus=0\n', got 'status=0\n'

stdout:
status=0
stderr:
osh20 trap INT, sleep, SIGINT: non-interactively

[osh stdout] Expected 'status=0\n', got 'int\nstatus=0\n'

stdout:
int
status=0
stderr:
osh-cpp20 trap INT, sleep, SIGINT: non-interactively

[osh-cpp stdout] Expected 'status=0\n', got '\nstatus=0\n'

stdout:
status=0
stderr: