diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-11 13:54:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-11 13:54:02 +0000 |
commit | a88e787277589617341afdcf86998afd7ffb9f83 (patch) | |
tree | 83368f69048f0e097149954549c1cc1ae9d75824 /test/lib/envutil.rb | |
parent | c13fedf33db35b3788e16ff5ec44a5db61131b84 (diff) | |
download | ruby-a88e787277589617341afdcf86998afd7ffb9f83.tar.gz |
envutil.rb: kill pgroup
* test/lib/envutil.rb (invoke_ruby): kill whole group when :pgroup
option is set.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib/envutil.rb')
-rw-r--r-- | test/lib/envutil.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/lib/envutil.rb b/test/lib/envutil.rb index e48d683f09..1193a1a525 100644 --- a/test/lib/envutil.rb +++ b/test/lib/envutil.rb @@ -68,8 +68,14 @@ module EnvUtil stderr = th_stderr.value if capture_stderr && capture_stderr != :merge_to_stdout else signal = /mswin|mingw/ =~ RUBY_PLATFORM ? :KILL : :TERM + case pgroup = opt[:pgroup] + when 0, true + pgroup = -pid + when nil, false + pgroup = pid + end begin - Process.kill signal, pid + Process.kill signal, pgroup Timeout.timeout((reprieve unless signal == :KILL)) do Process.wait(pid) end |