Results for builtin-trap.test.sh

statusoshosh_.pyosh_.cc
pass 171710
ok 110
FAIL 5513
total232323
caseoshosh_.pyosh_.ccdescription
0pass pass FAIL trap -l
details
1pass pass pass trap accepts/ignores --
2ok ok FAIL trap 'echo hi' KILL (regression test, caught by smoosh suite)
detailsdetailsdetails
3pass pass FAIL trap -p
details
4pass pass FAIL Register invalid trap
details
5pass pass FAIL Remove invalid trap
details
6pass pass FAIL SIGINT and INT are aliases
details
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 FAIL trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP
details
21pass pass pass eval in the exit trap (regression for issue #293)
22pass pass FAIL exit codes for traps are isolated
details
44 passed, 2 OK, 0 not implemented, 0 BUG, 23 failed, 0 timeouts, 0 cases skipped
5 failed under osh

Details on runs that didn't PASS

osh_.cc0 trap -l

[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
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)

[osh_.cc stdout] Expected 'status=1\nstatus=1\nstatus=1\nstatus=0\n', got 'status=1\n'
[osh_.cc status] Expected 0, got -6

stdout:
status=1
stderr:
  trap 'echo hi' 9
                 ^
[ stdin ]:1: Signal '9' can't be handled
osh_eval.stripped: /home/andy/git/oilshell/benchmark-data/src/oil-native-0.12.3/cpp/leaky_osh_eval_stubs.h:45: int signal_def::GetNumber(Str*): Assertion `!"Not Implemented"' failed.
timeout: the monitored command dumped core
osh_.cc3 trap -p

[osh_.cc status] Expected 0, got 1

stdout:
exit
stderr:
osh_.cc4 Register invalid trap

[osh_.cc status] Expected 1, got -6

stdout:
stderr: 
osh_eval.stripped: /home/andy/git/oilshell/benchmark-data/src/oil-native-0.12.3/cpp/leaky_osh_eval_stubs.h:45: int signal_def::GetNumber(Str*): Assertion `!"Not Implemented"' failed.
timeout: the monitored command dumped core
osh_.cc5 Remove invalid trap

[osh_.cc status] Expected 1, got -6

stdout:
stderr: 
osh_eval.stripped: /home/andy/git/oilshell/benchmark-data/src/oil-native-0.12.3/cpp/leaky_osh_eval_stubs.h:45: int signal_def::GetNumber(Str*): Assertion `!"Not Implemented"' failed.
timeout: the monitored command dumped core
osh_.cc6 SIGINT and INT are aliases

[osh_.cc stdout] Expected '0\n0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.stripped: /home/andy/git/oilshell/benchmark-data/src/oil-native-0.12.3/cpp/leaky_osh_eval_stubs.h:45: int signal_def::GetNumber(Str*): Assertion `!"Not Implemented"' failed.
timeout: the monitored command dumped core
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
osh_.cc20 trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP

[osh_.cc stdout] Expected 'status=0\nstatus=0\nstatus=0\nstatus=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.stripped: /home/andy/git/oilshell/benchmark-data/src/oil-native-0.12.3/cpp/leaky_osh_eval_stubs.h:45: int signal_def::GetNumber(Str*): Assertion `!"Not Implemented"' failed.
timeout: the monitored command dumped core
osh_.cc22 exit codes for traps are isolated

[osh_.cc stdout] Expected 'before=0\nUSR1 trap status=0\nafter=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.stripped: /home/andy/git/oilshell/benchmark-data/src/oil-native-0.12.3/cpp/leaky_osh_eval_stubs.h:45: int signal_def::GetNumber(Str*): Assertion `!"Not Implemented"' failed.
timeout: the monitored command dumped core