Results for builtin-trap.test.sh

statusoshosh-cpp
pass 2929
ok 22
FAIL 22
total3333
caseoshosh-cppdescription
0pass pass traps are not active inside subshells $() () trap | cat
1pass pass trap accepts/ignores --
2pass pass Register invalid trap, remove invalid trap
3pass pass trap foo gives non-zero error
4pass pass SIGINT and INT are aliases
5pass pass trap without args prints traps
6FAIL FAIL print trap handler with multiple lines
detailsdetails
7pass pass trap -p is like trap: it prints the handlers and full signal names
8pass pass Register the same handler for multiple signals
9pass pass Remove multiple handlers with trap -
10pass pass trap EXIT clears the EXIT trap
11pass pass trap 0 is equivalent to trap EXIT
12pass pass trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP
13pass pass trap 0 2 resets EXIT AND SIGINT
14FAIL FAIL trap '' EXIT - printing state
detailsdetails
15ok ok trap 'echo hi' KILL (regression test, caught by smoosh suite)
detailsdetails
16pass pass exit 1 when trap code string is invalid
17pass pass trap EXIT calling exit
18pass pass trap EXIT return status ignored
19pass pass trap EXIT with PARSE error
20pass pass trap EXIT with PARSE error and explicit exit
21pass pass trap EXIT with explicit exit
22pass pass trap EXIT with command sub / subshell / pipeline
23pass pass eval in the exit trap (regression for issue #293)
24pass pass exit codes for traps are isolated
25pass pass traps are cleared in subshell (started with &)
26pass pass trap USR1, sleep, SIGINT: non-interactively
27ok ok trap INT, sleep, SIGINT: non-interactively
detailsdetails
28pass pass trap EXIT, sleep, SIGINT: non-interactively
29pass pass Remove trap with an unsigned integer
30pass pass trap '' sets handler to empty string (SIG_IGN)
31pass pass trap '' with multiple signals
32pass pass trap with command.NoOp - check internal invariant
58 passed, 4 OK, 0 not implemented, 0 BUG, 2 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh6 print trap handler with multiple lines

[osh stdout] Expected "trap -- 'echo 1\necho 2\necho 3' SIGINT\n" Got "trap -- '<unknown>' SIGINT\n"

stdout:
trap -- '<unknown>' SIGINT
stderr:
osh-cpp6 print trap handler with multiple lines

[osh-cpp stdout] Expected "trap -- 'echo 1\necho 2\necho 3' SIGINT\n" Got "trap -- '<unknown>' SIGINT\n"

stdout:
trap -- '<unknown>' SIGINT
stderr:
osh14 trap '' EXIT - printing state

[osh stdout] Expected "trap -- 'echo exit' EXIT\n\ntrap -- '' EXIT\n\ntrap -- '# comment' EXIT\n" Got "trap -- 'echo exit' EXIT\n\ntrap -- '' EXIT\n\ntrap -- '<unknown>' EXIT\n"

stdout:
trap -- 'echo exit' EXIT

trap -- '' EXIT

trap -- '<unknown>' EXIT
stderr:
osh-cpp14 trap '' EXIT - printing state

[osh-cpp stdout] Expected "trap -- 'echo exit' EXIT\n\ntrap -- '' EXIT\n\ntrap -- '# comment' EXIT\n" Got "trap -- 'echo exit' EXIT\n\ntrap -- '' EXIT\n\ntrap -- '<unknown>' EXIT\n"

stdout:
trap -- 'echo exit' EXIT

trap -- '' EXIT

trap -- '<unknown>' EXIT
stderr:
osh15 trap 'echo hi' KILL (regression test, caught by smoosh suite)

stdout:
status=2
status=2
status=2
status=0
stderr:
  trap 'echo hi' 9
                 ^
[ stdin ]:1: Signal '9' can't be handled
  trap 'echo hi' KILL
                 ^~~~
[ stdin ]:4: Signal 'KILL' can't be handled
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:7: Signal 'STOP' can't be handled
osh-cpp15 trap 'echo hi' KILL (regression test, caught by smoosh suite)

stdout:
status=2
status=2
status=2
status=0
stderr:
  trap 'echo hi' 9
                 ^
[ stdin ]:1: Signal '9' can't be handled
  trap 'echo hi' KILL
                 ^~~~
[ stdin ]:4: Signal 'KILL' can't be handled
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:7: Signal 'STOP' can't be handled
osh27 trap INT, sleep, SIGINT: non-interactively

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

stdout:
int
status=0
stderr: