summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_process.rb9
-rw-r--r--test/ruby/test_thread.rb4
2 files changed, 12 insertions, 1 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index b37fbfebd6..e184b85366 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1327,4 +1327,13 @@ class TestProcess < Test::Unit::TestCase
end
end
end
+
+ def test_execopts_new_pgroup
+ return unless windows?
+
+ assert_nothing_raised { system(*TRUECOMMAND, :new_pgroup=>true) }
+ assert_nothing_raised { system(*TRUECOMMAND, :new_pgroup=>false) }
+ assert_nothing_raised { spawn(*TRUECOMMAND, :new_pgroup=>true) }
+ assert_nothing_raised { IO.popen([*TRUECOMMAND, :new_pgroup=>true]) {} }
+ end
end
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 589ae7a899..e8cb3b1722 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -691,7 +691,9 @@ class TestThreadGroup < Test::Unit::TestCase
t0 = Time.now.to_f
pid = nil
cmd = 'r,=IO.pipe; Thread.start {Thread.pass until Thread.main.stop?; puts; STDOUT.flush}; r.read'
- s, err = EnvUtil.invoke_ruby(['-e', cmd], "", true, true) do |in_p, out_p, err_p, cpid|
+ opt = {}
+ opt[:new_pgroup] = true if /mswin|mingw/ =~ RUBY_PLATFORM
+ s, err = EnvUtil.invoke_ruby(['-e', cmd], "", true, true, opt) do |in_p, out_p, err_p, cpid|
out_p.gets
pid = cpid
Process.kill(:SIGINT, pid)