Results for builtin-trap.test.sh

statusoshosh-cpp
pass 1717
ok 11
FAIL 55
total2323
caseoshosh-cppdescription
0pass pass trap -l
1pass pass trap accepts/ignores --
2ok ok trap 'echo hi' KILL (regression test, caught by smoosh suite)
detailsdetails
3pass pass trap -p
4pass pass Register invalid trap
5pass pass Remove invalid trap
6pass pass SIGINT and INT are aliases
7pass pass Invalid trap invocation
8pass pass exit 1 when trap code string is invalid
9pass pass trap EXIT calling exit
10pass pass trap EXIT return status ignored
11pass pass trap EXIT with PARSE error
12pass pass trap EXIT with PARSE error and explicit exit
13pass pass trap EXIT with explicit exit
14FAIL FAIL trap DEBUG
detailsdetails
15FAIL FAIL trap DEBUG and pipeline
detailsdetails
16FAIL FAIL trap DEBUG with compound commands
detailsdetails
17FAIL FAIL trap RETURN
detailsdetails
18FAIL FAIL trap ERR and disable it
detailsdetails
19pass pass trap 0 is equivalent to EXIT
20pass pass trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP
21pass pass eval in the exit trap (regression for issue #293)
22pass pass exit codes for traps are isolated
34 passed, 2 OK, 0 not implemented, 0 BUG, 10 failed, 0 timeouts, 0 cases skipped
5 failed under osh

Details on runs that didn't PASS

osh2 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: Signal 'KILL' can't be handled
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:5: Signal 'STOP' can't be handled
osh-cpp2 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: Signal 'KILL' can't be handled
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:5: Signal 'STOP' can't be handled
osh14 trap DEBUG

[osh stdout] Expected 'debuglog [x y]\n1\ndebuglog [x y]\n2\n', got '1\n2\n'

stdout:
1
2
stderr:
osh warning: The 'DEBUG' hook isn't implemented
osh-cpp14 trap DEBUG

[osh-cpp stdout] Expected 'debuglog [x y]\n1\ndebuglog [x y]\n2\n', got '1\n2\n'

stdout:
1
2
stderr:
osh warning: The 'DEBUG' hook isn't implemented
osh15 trap DEBUG and pipeline

[osh stdout] Expected ' [8]\na\n [8]\nb\n [10]\n2\n [12]\n [12]\n1\n [14]\n [15]\n1\n' Got 'a\nb\n2\n1\n1\n'

stdout:
a
b
2
1
1
stderr:
osh warning: The 'DEBUG' hook isn't implemented
osh-cpp15 trap DEBUG and pipeline

[osh-cpp stdout] Expected ' [8]\na\n [8]\nb\n [10]\n2\n [12]\n [12]\n1\n [14]\n [15]\n1\n' Got 'a\nb\n2\n1\n1\n'

stdout:
a
b
2
1
1
stderr:
osh warning: The 'DEBUG' hook isn't implemented
osh16 trap DEBUG with compound commands

[osh stdout] Expected ' [16]\n-- assign --\n [17]\n [19]\n-- function call --\n [20]\n [23]\n-- for --\n [24]\n [25]\nfor1 1\n [26]\nfor2 1\n [24]\n [25]\nfor1 2\n [26]\nfor2 2\n [29]\n-- while --\n [30]\n [31]\n [32]\nwhile1\n [33]\nwhile2\n [34]\n [31]\n [32]\nwhile1\n [33]\nwhile2\n [34]\n [31]\n [37]\n-- if --\n [38]\n [39]\nIF\n [42]\n-- case --\n [43]\n [45]\nCASE\n' Got '-- assign --\n-- function call --\n-- for --\nfor1 1\nfor2 1\nfor1 2\nfor2 2\n-- while --\nwhile1\nwhile2\nwhile1\nwhile2\n-- if --\nIF\n-- case --\nCASE\n'

stdout:
-- assign --
-- function call --
-- for --
for1 1
for2 1
for1 2
for2 2
-- while --
while1
while2
while1
while2
-- if --
IF
-- case --
CASE
stderr:
osh warning: The 'DEBUG' hook isn't implemented
osh-cpp16 trap DEBUG with compound commands

[osh-cpp stdout] Expected ' [16]\n-- assign --\n [17]\n [19]\n-- function call --\n [20]\n [23]\n-- for --\n [24]\n [25]\nfor1 1\n [26]\nfor2 1\n [24]\n [25]\nfor1 2\n [26]\nfor2 2\n [29]\n-- while --\n [30]\n [31]\n [32]\nwhile1\n [33]\nwhile2\n [34]\n [31]\n [32]\nwhile1\n [33]\nwhile2\n [34]\n [31]\n [37]\n-- if --\n [38]\n [39]\nIF\n [42]\n-- case --\n [43]\n [45]\nCASE\n' Got '-- assign --\n-- function call --\n-- for --\nfor1 1\nfor2 1\nfor1 2\nfor2 2\n-- while --\nwhile1\nwhile2\nwhile1\nwhile2\n-- if --\nIF\n-- case --\nCASE\n'

stdout:
-- assign --
-- function call --
-- for --
for1 1
for2 1
for1 2
for2 2
-- while --
while1
while2
while1
while2
-- if --
IF
-- case --
CASE
stderr:
osh warning: The 'DEBUG' hook isn't implemented
osh17 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-cpp17 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
osh18 trap ERR and disable it

[osh stdout] Expected '1\nerr [x y] 1\n2\n3\n', got '1\n2\n3\n'

stdout:
1
2
3
stderr:
osh warning: The 'ERR' hook isn't implemented
osh-cpp18 trap ERR and disable it

[osh-cpp stdout] Expected '1\nerr [x y] 1\n2\n3\n', got '1\n2\n3\n'

stdout:
1
2
3
stderr:
osh warning: The 'ERR' hook isn't implemented