Results for builtin-trap.test.sh

statusoshosh_.pyosh_.cc
pass 171717
ok 111
FAIL 555
total232323
caseoshosh_.pyosh_.ccdescription
0pass pass pass trap -l
1pass pass pass trap accepts/ignores --
2ok ok ok trap 'echo hi' KILL (regression test, caught by smoosh suite)
detailsdetailsdetails
3pass pass pass trap -p
4pass pass pass Register invalid trap
5pass pass pass Remove invalid trap
6pass pass pass SIGINT and INT are aliases
7pass pass pass Invalid trap invocation
8pass pass pass exit 1 when trap code string is invalid
9pass pass pass trap EXIT calling exit
10pass pass pass trap EXIT return status ignored
11pass pass pass trap EXIT with PARSE error
12pass pass pass trap EXIT with PARSE error and explicit exit
13pass pass pass trap EXIT with explicit exit
14FAIL FAIL FAIL trap DEBUG
detailsdetailsdetails
15FAIL FAIL FAIL trap DEBUG and pipeline
detailsdetailsdetails
16FAIL FAIL FAIL trap DEBUG with compound commands
detailsdetailsdetails
17FAIL FAIL FAIL trap RETURN
detailsdetailsdetails
18FAIL FAIL FAIL trap ERR and disable it
detailsdetailsdetails
19pass pass pass trap 0 is equivalent to EXIT
20pass pass pass trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP
21pass pass pass eval in the exit trap (regression for issue #293)
22pass pass pass exit codes for traps are isolated
51 passed, 3 OK, 0 not implemented, 0 BUG, 15 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_.py2 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_.cc2 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_.py14 trap DEBUG

[osh_.py 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_.cc14 trap DEBUG

[osh_.cc 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_.py15 trap DEBUG and pipeline

[osh_.py 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_.cc15 trap DEBUG and pipeline

[osh_.cc 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_.py16 trap DEBUG with compound commands

[osh_.py 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_.cc16 trap DEBUG with compound commands

[osh_.cc 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_.py17 trap RETURN

[osh_.py 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_.cc17 trap RETURN

[osh_.cc 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_.py18 trap ERR and disable it

[osh_.py 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_.cc18 trap ERR and disable it

[osh_.cc 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