diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_process.rb | 9 | ||||
| -rw-r--r-- | test/ruby/test_thread.rb | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 5882e6abcc..34c1355e58 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1360,4 +1360,13 @@ class TestProcess < Test::Unit::TestCase assert(io.close_on_exec?) } 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 8d6a87b705..b6514cfc88 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -681,12 +681,13 @@ class TestThreadGroup < Test::Unit::TestCase end def test_thread_timer_and_interrupt - skip 'Process.kill cannot kill a subprocess' if /mswin|mingw/ =~ RUBY_PLATFORM bug5757 = '[ruby-dev:44985]' 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) |
