summaryrefslogtreecommitdiff
path: root/test/testunit/test_parallel.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-07 03:55:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-07 03:55:47 +0000
commit406c5252a2037ae78c199e12578bee0233bff2d3 (patch)
tree9eac8e615cd69da341284b60b19daa59d67a2bbb /test/testunit/test_parallel.rb
parent10c51ff5ce07c4c0bf72bdcfe65cc222a83e9369 (diff)
test/unit: record in parallel
* test/lib/test/unit.rb (Test::Unit::Parallel#deal): deal with record. * test/lib/test/unit/parallel.rb (Test::Unit::Worker#record): report test records to the master. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/testunit/test_parallel.rb')
-rw-r--r--test/testunit/test_parallel.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/testunit/test_parallel.rb b/test/testunit/test_parallel.rb
index 3d85f9c..35901df 100644
--- a/test/testunit/test_parallel.rb
+++ b/test/testunit/test_parallel.rb
@@ -43,6 +43,7 @@ module TestParallel
assert_match(/^ready/,@worker_out.gets)
@worker_in.puts "run #{TESTS}/ptest_first.rb test"
assert_match(/^okay/,@worker_out.gets)
+ assert_match(/^record/,@worker_out.gets)
assert_match(/^p/,@worker_out.gets)
assert_match(/^done/,@worker_out.gets)
assert_match(/^ready/,@worker_out.gets)
@@ -54,8 +55,10 @@ module TestParallel
assert_match(/^ready/,@worker_out.gets)
@worker_in.puts "run #{TESTS}/ptest_second.rb test"
assert_match(/^okay/,@worker_out.gets)
+ assert_match(/^record/,@worker_out.gets)
assert_match(/^p/,@worker_out.gets)
assert_match(/^done/,@worker_out.gets)
+ assert_match(/^record/,@worker_out.gets)
assert_match(/^p/,@worker_out.gets)
assert_match(/^done/,@worker_out.gets)
assert_match(/^ready/,@worker_out.gets)
@@ -67,13 +70,16 @@ module TestParallel
assert_match(/^ready/,@worker_out.gets)
@worker_in.puts "run #{TESTS}/ptest_first.rb test"
assert_match(/^okay/,@worker_out.gets)
+ assert_match(/^record/,@worker_out.gets)
assert_match(/^p/,@worker_out.gets)
assert_match(/^done/,@worker_out.gets)
assert_match(/^ready/,@worker_out.gets)
@worker_in.puts "run #{TESTS}/ptest_second.rb test"
assert_match(/^okay/,@worker_out.gets)
+ assert_match(/^record/,@worker_out.gets)
assert_match(/^p/,@worker_out.gets)
assert_match(/^done/,@worker_out.gets)
+ assert_match(/^record/,@worker_out.gets)
assert_match(/^p/,@worker_out.gets)
assert_match(/^done/,@worker_out.gets)
assert_match(/^ready/,@worker_out.gets)
@@ -93,11 +99,9 @@ module TestParallel
def test_done
Timeout.timeout(10) do
@worker_in.puts "run #{TESTS}/ptest_forth.rb test"
- 7.times { @worker_out.gets }
- buf = @worker_out.gets
- assert_match(/^done (.+?)$/, buf)
-
- /^done (.+?)$/ =~ buf
+ while buf = @worker_out.gets
+ break if /^done (.+?)$/ =~ buf
+ end
result = Marshal.load($1.chomp.unpack("m")[0])