summaryrefslogtreecommitdiff
path: root/test/testunit
diff options
context:
space:
mode:
authorsorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-16 11:24:23 +0000
committersorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-16 11:24:23 +0000
commit288c18cdd8895d007458b6440d24b8949b4689e8 (patch)
treea32c4fef158f16629cd8f20817c668ec39642131 /test/testunit
parenta15dfa6b4a0c8afc0fd47a5d1b6c7d12191e38fa (diff)
downloadruby-288c18cdd8895d007458b6440d24b8949b4689e8.tar.gz
* test/testunit/test_parallel.rb: Fix Regexp for test.
* test/testunit/tests_for_parallel/test_third.rb: Use Test::Unit::TestCase#on_parallel_worker? for detecting worker. * lib/test/unit/testcase.rb(Test::Unit::TestCase#on_parallel_worker?): New Method Test::Unit::TestCase#on_parallel_worker? returns true when a testcase is running on parallel worker. * lib/test/unit/parallel.rb(Test::Unit::TestCase#on_parallel_worker?): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/testunit')
-rw-r--r--test/testunit/test_parallel.rb5
-rw-r--r--test/testunit/tests_for_parallel/test_third.rb3
2 files changed, 4 insertions, 4 deletions
diff --git a/test/testunit/test_parallel.rb b/test/testunit/test_parallel.rb
index 7a2e9aece6..4c4d14b226 100644
--- a/test/testunit/test_parallel.rb
+++ b/test/testunit/test_parallel.rb
@@ -122,7 +122,7 @@ module TestParallel
def spawn_runner(*opt_args)
@test_out, o = IO.pipe
@test_pid = spawn(*@options[:ruby], TESTS+"/runner.rb",
- "-j","t2",*opt_args, out: o, err: o)
+ "-j","t1",*opt_args, out: o, err: o)
o.close
end
@@ -153,14 +153,13 @@ module TestParallel
def test_should_run_all_without_any_leaks
spawn_runner
buf = timeout(10){@test_out.read}
- assert_match(/^\.*(\.SF\.*F|F\.*\.+SF)\.*$/,buf)
+ assert_match(/^[SF\.]{7}$/,buf)
end
def test_should_retry_failed_on_workers
spawn_runner
buf = timeout(10){@test_out.read}
assert_match(/^Retrying\.+$/,buf)
- assert_match(/^\.*SF\.*$/,buf)
end
def test_no_retry_option
diff --git a/test/testunit/tests_for_parallel/test_third.rb b/test/testunit/tests_for_parallel/test_third.rb
index 2746a9ba71..61124b291a 100644
--- a/test/testunit/tests_for_parallel/test_third.rb
+++ b/test/testunit/tests_for_parallel/test_third.rb
@@ -3,7 +3,8 @@ require_relative "misc.rb"
class TestD < TestCaseForParallelTest
def ptest_fail_at_worker
- if /test\/unit\/parallel\.rb/ =~ $0
+ #if /test\/unit\/parallel\.rb/ =~ $0
+ if on_parallel_worker?
assert_equal(0,1)
end
end