summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-11 03:19:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-11 03:19:29 +0000
commit61cd4e9dda5a5741f44308c96758a81fd4724621 (patch)
treea0118bb3b46a7db4c946b032752bc17051f34aee
parenta3656d4222509f0befa6d01f0ccd3f7a9442665b (diff)
test_process.rb: WIFEXITED and so on are system dependent
* test/ruby/test_process.rb (test_status_kill): WIFEXITED and so on are available only if signal is supported by the system. [ruby-dev:48203] [Bug #9820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_process.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 5abc5bca0b..3e7f3b6964 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1203,11 +1203,14 @@ class TestProcess < Test::Unit::TestCase
return unless Process.respond_to?(:kill)
return unless Signal.list.include?("KILL")
+ # assume the system supports signal if SIGQUIT is available
+ expected = Signal.list.include?("QUIT") ? [false, true, false, nil] : [true, false, false, true]
+
with_tmpchdir do
write_file("foo", "Process.kill(:KILL, $$); exit(42)")
system(RUBY, "foo")
s = $?
- assert_equal([false, true, false, nil],
+ assert_equal(expected,
[s.exited?, s.signaled?, s.stopped?, s.success?],
"[s.exited?, s.signaled?, s.stopped?, s.success?]")
assert_equal(false, s.exited?)