mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_signal.rb: use SIGINT if needed
* test/ruby/test_signal.rb (test_kill_immediately_before_termination): use SIGINT if SIGUSR1 is not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
291c1bc314
commit
98ca921088
1 changed files with 4 additions and 3 deletions
|
@ -173,9 +173,10 @@ class TestSignal < Test::Unit::TestCase
|
|||
end if Process.respond_to?(:kill)
|
||||
|
||||
def test_kill_immediately_before_termination
|
||||
assert_in_out_err(["-e", <<-'end;'], "", %w"foo")
|
||||
Signal.trap(:USR1) { STDOUT.syswrite("foo") }
|
||||
Process.kill :USR1, $$
|
||||
Signal.list[sig = "USR1"] or sig = "INT"
|
||||
assert_in_out_err(["-e", <<-"end;"], "", %w"foo")
|
||||
Signal.trap(:#{sig}) { STDOUT.syswrite("foo") }
|
||||
Process.kill :#{sig}, $$
|
||||
end;
|
||||
end if Process.respond_to?(:kill)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue