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
This commit is contained in:
parent
a3656d4222
commit
61cd4e9dda
@ -1203,11 +1203,14 @@ class TestProcess < Test::Unit::TestCase
|
|||||||
return unless Process.respond_to?(:kill)
|
return unless Process.respond_to?(:kill)
|
||||||
return unless Signal.list.include?("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
|
with_tmpchdir do
|
||||||
write_file("foo", "Process.kill(:KILL, $$); exit(42)")
|
write_file("foo", "Process.kill(:KILL, $$); exit(42)")
|
||||||
system(RUBY, "foo")
|
system(RUBY, "foo")
|
||||||
s = $?
|
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?],
|
||||||
"[s.exited?, s.signaled?, s.stopped?, s.success?]")
|
"[s.exited?, s.signaled?, s.stopped?, s.success?]")
|
||||||
assert_equal(false, s.exited?)
|
assert_equal(false, s.exited?)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user