summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/envutil.rb8
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