From 86c7e68442b560e1c743d77d0783bc29a577790f Mon Sep 17 00:00:00 2001 From: sorah Date: Sat, 26 Feb 2011 07:17:59 +0000 Subject: * lib/test/unit.rb: --jobs-status won't puts over 2 lines. * test/testunit/test_parallel.rb: Fix test for above. * lib/test/*: refactoring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/test/unit/parallel.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/test/unit/parallel.rb') diff --git a/lib/test/unit/parallel.rb b/lib/test/unit/parallel.rb index ae1bf2961c..80dd4eae56 100644 --- a/lib/test/unit/parallel.rb +++ b/lib/test/unit/parallel.rb @@ -26,9 +26,9 @@ module Test stdout = STDOUT.dup - th = Thread.new(i.dup) do |io| + th = Thread.new do begin - while buf = (self.verbose ? io.gets : io.read(5)) + while buf = (self.verbose ? i.gets : i.read(5)) stdout.puts "p #{[buf].pack("m").gsub("\n","")}" end rescue IOError @@ -70,13 +70,11 @@ module Test @@stop_auto_run = true @opts = @options.dup - STDOUT.sync = true - STDOUT.puts "ready" Signal.trap(:INT,"IGNORE") - - @old_loadpath = [] begin + STDOUT.sync = true + STDOUT.puts "ready" stdin = STDIN.dup stdout = STDOUT.dup while buf = stdin.gets @@ -123,6 +121,7 @@ module Test exit end end + rescue Errno::EPIPE rescue Exception => e begin STDOUT.puts "bye #{[Marshal.dump(e)].pack("m").gsub("\n","")}" -- cgit v1.2.3