ruby-changes:18925
From: sorah <ko1@a...>
Date: Thu, 24 Feb 2011 13:48:32 +0900 (JST)
Subject: [ruby-changes:18925] Ruby:r30950 (trunk): * common.mk: Use $RUNRUBY for worker process.
sorah 2011-02-24 13:47:48 +0900 (Thu, 24 Feb 2011) New Revision: 30950 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30950 Log: * common.mk: Use $RUNRUBY for worker process. * lib/test/unit.rb: Fix bug. * lib/test/unit.rb: @options[:ruby](@opts[:ruby]) is now Array. * test/testunit/parallel.rb: Fix for above. Modified files: trunk/ChangeLog trunk/common.mk trunk/lib/test/unit.rb trunk/test/testunit/test_parallel.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 30949) +++ ChangeLog (revision 30950) @@ -1,3 +1,10 @@ +Thu Feb 24 13:39:25 2011 Shota Fukumori (sora_h) <sorah@t...> + + * common.mk: Use $RUNRUBY for worker process. + * lib/test/unit.rb: Fix bug. + * lib/test/unit.rb: @options[:ruby](@opts[:ruby]) is now Array. + * test/testunit/parallel.rb: Fix for above. + Thu Feb 24 10:05:55 2011 Shota Fukumori (sora_h) <sorah@t...> * test/testunit/tests_for_parallel/misc.rb: Fix bug in r30947. Index: lib/test/unit.rb =================================================================== --- lib/test/unit.rb (revision 30949) +++ lib/test/unit.rb (revision 30950) @@ -101,7 +101,7 @@ end opts.on '--ruby VAL', "Path to ruby; It'll have used at -j option" do |a| - options[:ruby] = a + options[:ruby] = a.split(/ /).reject(&:empty?) end end @@ -364,8 +364,9 @@ i,o = IO.pipe("ASCII-8BIT") # worker o>|i> master j,k = IO.pipe("ASCII-8BIT") # worker <j|<k master k.sync = true - pid = spawn(*@opts[:ruby].split(/ /),File.dirname(__FILE__) + - "/unit/parallel.rb", *@args, out: o, in: j) + pid = spawn(*@opts[:ruby], + "#{File.dirname(__FILE__)}/unit/parallel.rb", + *@args, out: o, in: j) [o,j].each{|io| io.close } {in: k, out: i, pid: pid, status: :waiting} end Index: common.mk =================================================================== --- common.mk (revision 30949) +++ common.mk (revision 30950) @@ -471,7 +471,7 @@ test-all: $(TEST_RUNNABLE)-test-all yes-test-all: PHONY - $(RUNRUBY) "$(srcdir)/test/runner.rb" $(TESTS) + $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TESTS) TESTS_BUILD = mkmf no-test-all: PHONY $(MINIRUBY) -I"$(srcdir)/lib" "$(srcdir)/test/runner.rb" $(TESTS_BUILD) Index: test/testunit/test_parallel.rb =================================================================== --- test/testunit/test_parallel.rb (revision 30949) +++ test/testunit/test_parallel.rb (revision 30950) @@ -10,7 +10,7 @@ def setup i, @worker_in = IO.pipe @worker_out, o = IO.pipe - @worker_pid = spawn(*@options[:ruby].split(/ /), PARALLEL_RB, + @worker_pid = spawn(*@options[:ruby], PARALLEL_RB, "-j", "t1", "-v", out: o, in: i) [i,o].each(&:close) end @@ -124,7 +124,7 @@ class TestParallel < Test::Unit::TestCase def spawn_runner(*opt_args) @test_out, o = IO.pipe - @test_pid = spawn(*@options[:ruby].split(/ /), TESTS+"/runner.rb", + @test_pid = spawn(*@options[:ruby], TESTS+"/runner.rb", "-j","t2","-x","sleeping",*opt_args, out: o) o.close end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/