diff --git a/ChangeLog b/ChangeLog index cd39222667..756d9c78eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Jun 16 07:58:01 2011 Shota Fukumori + + * test/testunit/test_parallel.rb(test_ignore_tzero): Test for r32109. + + * test/testunit/tests_for_parallel/test_third.rb: Use another way to + detect that test is running on worker. This fixes sometimes + TestParallel failing. + Thu Jun 16 07:20:06 2011 Shota Fukumori * lib/test/unit.rb(Test::Unit::Runner#_run_parallel): Ignore -j0 diff --git a/test/testunit/test_parallel.rb b/test/testunit/test_parallel.rb index 2f114bba69..7a2e9aece6 100644 --- a/test/testunit/test_parallel.rb +++ b/test/testunit/test_parallel.rb @@ -140,8 +140,15 @@ module TestParallel end end - #def test_childs - #end + def test_ignore_jzero + @test_out, o = IO.pipe + @test_pid = spawn(*@options[:ruby], TESTS+"/runner.rb", + "-j","0", out: File::NULL, err: o) + o.close + timeout(10) { + assert_match(/Error: parameter of -j option should be greater than 0/,@test_out.read) + } + end def test_should_run_all_without_any_leaks spawn_runner diff --git a/test/testunit/tests_for_parallel/test_third.rb b/test/testunit/tests_for_parallel/test_third.rb index 16bac16a04..2746a9ba71 100644 --- a/test/testunit/tests_for_parallel/test_third.rb +++ b/test/testunit/tests_for_parallel/test_third.rb @@ -3,7 +3,7 @@ require_relative "misc.rb" class TestD < TestCaseForParallelTest def ptest_fail_at_worker - if MiniTest::Unit.output != STDOUT + if /test\/unit\/parallel\.rb/ =~ $0 assert_equal(0,1) end end