Results for builtin-trap.test.sh

statusoshosh-cpp
pass 1919
ok 22
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
13pass pass trap ERR
14ok ok trap ERR and pipelines (lastpipe and PIPESTATUS difference)
detailsdetails
15pass pass error in trap ERR (recursive)
16pass pass trap 0 is equivalent to EXIT
17pass pass trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP
18pass pass eval in the exit trap (regression for issue #293)
19pass pass exit codes for traps are isolated
20pass pass traps are cleared in subshell (started with &)
38 passed, 4 OK, 0 not implemented, 0 BUG, 0 failed, 0 timeouts, 0 cases skipped

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 ]:3: Invalid signal or hook 'KILL'
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:5: 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 ]:3: Invalid signal or hook 'KILL'
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:5: Signal 'STOP' can't be handled
osh14 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:
osh-cpp14 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: