Index: lib/test/unit/parallel.rb =================================================================== --- lib/test/unit/parallel.rb (リビジョン 36712) +++ lib/test/unit/parallel.rb (作業コピー) @@ -152,7 +152,7 @@ module Test end def puke(klass, meth, e) - @partial_report << [klass.name, meth, e] + @partial_report << [klass.name, meth, e.is_a?(MiniTest::Assertion) ? e : ProxyError.new(e)] super end end Index: lib/test/unit.rb =================================================================== --- lib/test/unit.rb (リビジョン 36712) +++ lib/test/unit.rb (作業コピー) @@ -828,6 +828,15 @@ module Test new(*args).run end end + + class ProxyError < StandardError + def initialize(ex) + @message = ex.message + @backtrace = ex.backtrace + end + + attr_accessor :message, :backtrace + end end end Index: test/testunit/tests_for_parallel/ptest_forth.rb =================================================================== --- test/testunit/tests_for_parallel/ptest_forth.rb (リビジョン 36712) +++ test/testunit/tests_for_parallel/ptest_forth.rb (作業コピー) @@ -1,6 +1,8 @@ require 'test/unit' class TestE < Test::Unit::TestCase + class UnknownError < RuntimeError; end + def test_not_fail assert_equal(1,1) end @@ -12,5 +14,8 @@ class TestE < Test::Unit::TestCase def test_always_fail assert_equal(0,1) end -end + def test_unknown_error + raise UnknownError, "unknown error" + end +end Index: test/testunit/test_parallel.rb =================================================================== --- test/testunit/test_parallel.rb (リビジョン 36712) +++ test/testunit/test_parallel.rb (作業コピー) @@ -91,7 +91,7 @@ module TestParallel timeout(10) do @worker_in.puts "run #{TESTS}/ptest_forth.rb test" i = 0 - 5.times { @worker_out.gets } + 6.times { @worker_out.gets } buf = @worker_out.gets assert_match(/^done (.+?)$/, buf) @@ -99,14 +99,15 @@ module TestParallel result = Marshal.load($1.chomp.unpack("m")[0]) - assert_equal(result[0],3) - assert_equal(result[1],2) + assert_equal(4, result[0]) + assert_equal(2, result[1]) assert_kind_of(Array,result[2]) assert_kind_of(Array,result[3]) assert_kind_of(Array,result[4]) assert_kind_of(Array,result[2][1]) assert_kind_of(MiniTest::Assertion,result[2][0][2]) assert_kind_of(MiniTest::Skip,result[2][1][2]) + assert_kind_of(Exception, result[2][2][2]) assert_equal(result[5], "TestE") end end @@ -156,7 +157,7 @@ module TestParallel def test_should_run_all_without_any_leaks spawn_runner buf = timeout(10){@test_out.read} - assert_match(/^[SF\.]{7}$/,buf) + assert_match(/^[SFE\.]{8}$/,buf) end def test_should_retry_failed_on_workers