summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-19 15:57:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-19 15:57:11 +0000
commit98ca9210881963a1566b0401d36165cf0fd208e6 (patch)
tree4d9e2b2a1bedc60a2c4ad57d189a1f749c935afe /test
parent291c1bc3148d4d5954dc15411086112161d65867 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_signal.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb
index 5d6ca12581..ee63f8d8e0 100644
--- a/test/ruby/test_signal.rb
+++ b/test/ruby/test_signal.rb
@@ -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)