Results for builtin-trap.test.sh

statusbashmkshkshtoyshsushbrushosh
pass 221819013820
ok 0200002
BUG 1300000
FAIL 0042310151
total23232323232323
casebashmkshkshtoyshsushbrushoshdescription
0pass pass pass FAIL FAIL FAIL pass trap accepts/ignores --
detailsdetailsdetails
1pass pass pass FAIL pass pass pass Register invalid trap
details
2pass pass pass FAIL pass pass pass Remove invalid trap
details
3pass pass pass FAIL pass pass pass SIGINT and INT are aliases
details
4pass BUG FAIL FAIL pass pass FAIL trap without args prints traps, like trap -p
detailsdetailsdetailsdetails
5pass pass pass FAIL FAIL pass ok trap 'echo hi' KILL (regression test, caught by smoosh suite)
detailsdetailsdetails
6pass BUG FAIL FAIL pass FAIL pass Invalid trap invocation
detailsdetailsdetailsdetails
7BUG BUG FAIL FAIL FAIL FAIL pass exit 1 when trap code string is invalid
detailsdetailsdetailsdetailsdetailsdetails
8pass pass pass FAIL pass FAIL pass trap EXIT calling exit
detailsdetails
9pass pass pass FAIL FAIL FAIL pass trap EXIT return status ignored
detailsdetailsdetails
10pass ok FAIL FAIL FAIL FAIL pass trap EXIT with PARSE error
detailsdetailsdetailsdetailsdetails
11pass pass pass FAIL pass FAIL pass trap EXIT with PARSE error and explicit exit
detailsdetails
12pass pass pass FAIL FAIL FAIL pass trap EXIT with explicit exit
detailsdetailsdetails
13pass pass pass FAIL pass FAIL pass trap EXIT with command sub / subshell / pipeline
detailsdetails
14pass pass pass FAIL FAIL pass pass trap 0 is equivalent to EXIT
detailsdetails
15pass pass pass FAIL pass pass pass trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP
details
16pass pass pass FAIL pass FAIL pass eval in the exit trap (regression for issue #293)
detailsdetails
17pass pass pass FAIL FAIL FAIL pass exit codes for traps are isolated
detailsdetailsdetails
18pass pass pass FAIL FAIL FAIL pass traps are cleared in subshell (started with &)
detailsdetailsdetails
19pass pass pass FAIL pass FAIL pass trap USR1, sleep, SIGINT: non-interactively
detailsdetails
20pass ok pass FAIL pass pass ok trap INT, sleep, SIGINT: non-interactively
detailsdetailsdetails
21pass pass pass FAIL pass FAIL pass trap EXIT, sleep, SIGINT: non-interactively
detailsdetails
22pass pass pass FAIL FAIL FAIL pass Remove trap with an unsigned integer
detailsdetailsdetails
100 passed, 4 OK, 0 not implemented, 4 BUG, 53 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

toysh0 trap accepts/ignores --

[toysh stdout] Expected 'ok\nhi\n', got 'ok\n'

stdout:
ok
stderr:
sh: trap: No such file or directory
sush0 trap accepts/ignores --

[sush stdout] Expected 'ok\nhi\n', got 'ok\n'

stdout:
ok
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: trap: echo hi: invalid signal specification
brush0 trap accepts/ignores --

[brush stdout] Expected 'ok\nhi\n', got 'ok\n'

stdout:
ok
stderr:
toysh1 Register invalid trap

[toysh status] Expected 1, got 127

stdout:
stderr: 
sh: trap: No such file or directory
toysh2 Remove invalid trap

[toysh status] Expected 1, got 127

stdout:
stderr: 
sh: trap: No such file or directory
toysh3 SIGINT and INT are aliases

[toysh stdout] Expected '0\n0\n', got '127\n127\n'

stdout:
127
127
stderr:
sh: trap: No such file or directory
sh: trap: No such file or directory
mksh4 trap without args prints traps, like trap -p

stdout:
status=0
status=1
stderr:
ksh4 trap without args prints traps, like trap -p

[ksh stdout] Expected "status=0\ntrap -- 'true' EXIT\nstatus=0\n", got 'status=0\nstatus=1\n'

stdout:
status=0
status=1
stderr:
toysh4 trap without args prints traps, like trap -p

[toysh stdout] Expected "status=0\ntrap -- 'true' EXIT\nstatus=0\n", got ''
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
osh4 trap without args prints traps, like trap -p

[osh stdout] Expected "status=0\ntrap -- 'true' EXIT\nstatus=0\n", got 'status=0\nstatus=1\n'

stdout:
status=0
status=1
stderr:
  trap | grep EXIT
  ^~~~
[ -c flag ]:6: 'trap' requires a code string
toysh5 trap 'echo hi' KILL (regression test, caught by smoosh suite)

[toysh stdout] Expected 'status=0\nstatus=0\nstatus=0\nstatus=0\n', got 'status=127\nstatus=127\nstatus=127\nstatus=127\n'

stdout:
status=127
status=127
status=127
status=127
stderr:
sh: trap: No such file or directory
sh: trap: No such file or directory
sh: trap: No such file or directory
sh: trap: No such file or directory
sush5 trap 'echo hi' KILL (regression test, caught by smoosh suite)

[sush stdout] Expected 'status=0\nstatus=0\nstatus=0\nstatus=0\n', got 'status=1\n'
[sush status] Expected 0, got 101

stdout:
status=1
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: trap: 9: forbidden signal for trap

thread 'main' panicked at src/signal.rs:17:10:
sush(fatal): cannot ignore signal: EINVAL
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
osh5 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 ]:4: Invalid signal or hook 'KILL'
  trap 'echo hi' STOP
                 ^~~~
[ stdin ]:7: Signal 'STOP' can't be handled
mksh6 Invalid trap invocation

stdout:
status=0
stderr:
ksh6 Invalid trap invocation

[ksh stdout] Expected 'status=2\n', got 'status=0\n'

stdout:
status=0
stderr:
toysh6 Invalid trap invocation

[toysh stdout] Expected 'status=2\n', got 'status=127\n'

stdout:
status=127
stderr:
sh: trap: No such file or directory
brush6 Invalid trap invocation

[brush stdout] Expected 'status=2\n', got 'status=1\n'

stdout:
status=1
stderr:
ERROR foo: invalid signal specification
bash7 exit 1 when trap code string is invalid

stdout:
status=0
stderr:
bash: exit trap: line 1: syntax error near unexpected token `newline'
bash: exit trap: line 1: `echo <'
mksh7 exit 1 when trap code string is invalid

stdout:
status=0
stderr:
mksh: syntax error: unexpected EOF
ksh7 exit 1 when trap code string is invalid

[ksh stdout] Expected 'status=1\n', got 'status=0\n'
[ksh status] Expected 0, got 1

stdout:
status=0
stderr:
E: ksh: syntax error: unexpected EOF
toysh7 exit 1 when trap code string is invalid

[toysh stdout] Expected 'status=1\n', got 'status=127\n'

stdout:
status=127
stderr:
sh: trap: No such file or directory
sush7 exit 1 when trap code string is invalid

[sush stdout] Expected 'status=1\n', got 'status=0\n'
[sush status] Expected 0, got 2

stdout:
status=0
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: Unexpected token: <
brush7 exit 1 when trap code string is invalid

[brush stdout] Expected 'status=1\n', got 'status=0\n'

stdout:
status=0
stderr:
toysh8 trap EXIT calling exit

[toysh stdout] Expected 'cleanup [x y z]\n', got ''
[toysh status] Expected 42, got 127

stdout:
stderr: 
sh: trap: No such file or directory
brush8 trap EXIT calling exit

[brush stdout] Expected 'cleanup [x y z]\n', got ''
[brush status] Expected 42, got 0

stdout:
stderr: 
toysh9 trap EXIT return status ignored

[toysh stdout] Expected 'cleanup [x y z]\n', got ''
[toysh status] Expected 0, got 127

stdout:
stderr: 
sh: trap: No such file or directory
sush9 trap EXIT return status ignored

[sush status] Expected 0, got 42

stdout:
cleanup [x y z]
stderr:
brush9 trap EXIT return status ignored

[brush stdout] Expected 'cleanup [x y z]\n', got ''

stdout:
stderr: 
mksh10 trap EXIT with PARSE error

stdout:
FAILED
stderr:
mksh: <stdin>[2]: syntax error: 'newline' unexpected
ksh10 trap EXIT with PARSE error

[ksh status] Expected 2, got 1

stdout:
FAILED
stderr:
E: ksh: <stdin>[2]: syntax error: unexpected 'newline'
toysh10 trap EXIT with PARSE error

[toysh stdout] Expected 'FAILED\n', got ''

stdout:
stderr: 
sh: trap: No such file or directory
main: line 2: sh: syntax error: newline
sush10 trap EXIT with PARSE error

[sush status] Expected 2, got 0

stdout:
FAILED
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: Unexpected token: 

brush10 trap EXIT with PARSE error

[brush stdout] Expected 'FAILED\n', got ''

stdout:
stderr: 
ERROR main: syntax error near token `
' (line 1 col 4)
toysh11 trap EXIT with PARSE error and explicit exit

[toysh stdout] Expected 'FAILED\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
sh: trap: No such file or directory
main: line 2: sh: syntax error: newline
brush11 trap EXIT with PARSE error and explicit exit

[brush stdout] Expected 'FAILED\n', got ''
[brush status] Expected 0, got 2

stdout:
stderr: 
ERROR main: syntax error near token `
' (line 1 col 4)
toysh12 trap EXIT with explicit exit

[toysh stdout] Expected 'IN TRAP\nFOO\n', got ''

stdout:
stderr: 
sh: trap: No such file or directory
sush12 trap EXIT with explicit exit

[sush status] Expected 42, got 0

stdout:
IN TRAP
FOO
stderr:
brush12 trap EXIT with explicit exit

[brush stdout] Expected 'IN TRAP\nFOO\n', got ''

stdout:
stderr: 
toysh13 trap EXIT with command sub / subshell / pipeline

[toysh stdout] Expected 'command sub\nsubshell\npipeline\nEXIT TRAP\n' Got 'command sub\nsubshell\npipeline\n'

stdout:
command sub
subshell
pipeline
stderr:
sh: trap: No such file or directory
brush13 trap EXIT with command sub / subshell / pipeline

[brush stdout] Expected 'command sub\nsubshell\npipeline\nEXIT TRAP\n' Got 'command sub\nsubshell\npipeline\n'

stdout:
command sub
subshell
pipeline
stderr:
toysh14 trap 0 is equivalent to EXIT

[toysh stdout] Expected 'status=0\nstatus=0\n', got 'status=127\nstatus=127\n'

stdout:
status=127
status=127
stderr:
sh: trap: No such file or directory
sh: trap: No such file or directory
sush14 trap 0 is equivalent to EXIT

[sush status] Expected 0, got 127

stdout:
status=0
status=0
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: -: command not found
toysh15 trap 1 is equivalent to SIGHUP; HUP is equivalent to SIGHUP

[toysh stdout] Expected 'status=0\nstatus=0\nstatus=0\nstatus=0\n', got 'status=127\nstatus=127\nstatus=127\nstatus=127\n'

stdout:
status=127
status=127
status=127
status=127
stderr:
sh: trap: No such file or directory
sh: trap: No such file or directory
sh: trap: No such file or directory
sh: trap: No such file or directory
toysh16 eval in the exit trap (regression for issue #293)

[toysh stdout] Expected 'hi\n', got ''
[toysh status] Expected 0, got 127

stdout:
stderr: 
sh: trap: No such file or directory
brush16 eval in the exit trap (regression for issue #293)

[brush stdout] Expected 'hi\n', got ''

stdout:
stderr: 
toysh17 exit codes for traps are isolated

[toysh stdout] Expected 'before=0\nUSR1 trap status=0\nafter=0\n', got 'before=127\n'
[toysh status] Expected 0, got -10

stdout:
before=127
stderr:
sh: trap: No such file or directory
sush17 exit codes for traps are isolated

[sush stdout] Expected 'before=0\nUSR1 trap status=0\nafter=0\n', got 'before=0\nafter=0\n'

stdout:
before=0
after=0
stderr:
brush17 exit codes for traps are isolated

[brush stdout] Expected 'before=0\nUSR1 trap status=0\nafter=0\n', got 'before=0\n'
[brush status] Expected 0, got -10

stdout:
before=0
stderr:
toysh18 traps are cleared in subshell (started with &)

[toysh stdout] Expected 'SIGURG\nbegin child\nend child\nwait status 0\n' Got 'begin child\nend child\nwait status 0\n'

stdout:
begin child
end child
wait status 0
stderr:
sh: trap: No such file or directory
kill: missing argument (see "kill --help")
sush18 traps are cleared in subshell (started with &)

[sush stdout] Expected 'SIGURG\nbegin child\nend child\nwait status 0\n' Got 'begin child\nSIGURG\nend child\nwait status 0\n'

stdout:
begin child
SIGURG
end child
wait status 0
stderr:
3684687
brush18 traps are cleared in subshell (started with &)

[brush stdout] Expected 'SIGURG\nbegin child\nend child\nwait status 0\n' Got 'begin child\nend child\nwait status 0\n'

stdout:
begin child
end child
wait status 0
stderr:
kill: invalid usage
toysh19 trap USR1, sleep, SIGINT: non-interactively

[toysh stdout] Expected 'usr1\nstatus=0\n', got 'status=0\n'

stdout:
status=0
stderr:
sh: command: No such file or directory
sh: trap: No such file or directory
sh: -USR1: No such file or directory
brush19 trap USR1, sleep, SIGINT: non-interactively

[brush stdout] Expected 'usr1\nstatus=0\n', got 'status=0\n'

stdout:
status=0
stderr:
mksh20 trap INT, sleep, SIGINT: non-interactively

stdout:
mksh
stderr:
toysh20 trap INT, sleep, SIGINT: non-interactively

[toysh stdout] Expected 'status=0\n', got ''
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
osh20 trap INT, sleep, SIGINT: non-interactively

stdout:
int
status=0
stderr:
toysh21 trap EXIT, sleep, SIGINT: non-interactively

[toysh stdout] Expected 'on exit\nstatus=0\n', got 'status=0\n'

stdout:
status=0
stderr:
sh: command: No such file or directory
sh: trap: No such file or directory
sh: -INT: No such file or directory
brush21 trap EXIT, sleep, SIGINT: non-interactively

[brush stdout] Expected 'on exit\nstatus=0\n', got 'status=0\n'

stdout:
status=0
stderr:
toysh22 Remove trap with an unsigned integer

[toysh stdout] Expected 'ok0\n\nok42space\n\nok07\n\ntrap-exit\nfailure\n' Got '\n\n\nfailure\n'

stdout:


failure
stderr:
sh: Unknown option 'e' (see "sh --help")
sh: Unknown option 'e' (see "sh --help")
sh: Unknown option 'e' (see "sh --help")
sh: Unknown option 'e' (see "sh --help")
sush22 Remove trap with an unsigned integer

[sush stdout] Expected 'ok0\n\nok42space\n\nok07\n\ntrap-exit\nfailure\n' Got 'ok0\n\nok42space\n\nok07\n\nbad\nfailure\n'

stdout:
ok0

ok42space

ok07

bad
failure
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: 0: command not found
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: 42: command not found
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: 07: command not found
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: -1: command not found
brush22 Remove trap with an unsigned integer

[brush stdout] Expected 'ok0\n\nok42space\n\nok07\n\ntrap-exit\nfailure\n' Got 'ok0\n\nok42space\n\nok07\n\nbad\n'

stdout:
ok0

ok42space

ok07

bad
stderr:
error: unexpected argument '-1' found

  tip: to pass '-1' as a value, use '-- -1'

Usage: trap [OPTIONS] [ARGS]...

For more information, try '--help'.