summaryrefslogtreecommitdiff
path: root/tool/lib/test/unit/parallel.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/lib/test/unit/parallel.rb')
-rw-r--r--tool/lib/test/unit/parallel.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/tool/lib/test/unit/parallel.rb b/tool/lib/test/unit/parallel.rb
index 96aadf0249..ac297d4a0e 100644
--- a/tool/lib/test/unit/parallel.rb
+++ b/tool/lib/test/unit/parallel.rb
@@ -1,12 +1,6 @@
# frozen_string_literal: true
-$LOAD_PATH.unshift "#{__dir__}/../.."
-require_relative '../../test/unit'
-require_relative '../../profile_test_all' if ENV.key?('RUBY_TEST_ALL_PROFILE')
-require_relative '../../tracepointchecker'
-require_relative '../../zombie_hunter'
-require_relative '../../iseq_loader_checker'
-require_relative '../../gc_checker'
+require_relative "../../../test/init"
module Test
module Unit
@@ -31,6 +25,10 @@ module Test
end
end
+ def _start_method(inst)
+ _report "start", Marshal.dump([inst.class.name, inst.__name__])
+ end
+
def _run_suite(suite, type) # :nodoc:
@partial_report = []
orig_testout = Test::Unit::Runner.output
@@ -107,7 +105,7 @@ module Test
case buf.chomp
when /^loadpath (.+?)$/
@old_loadpath = $:.dup
- $:.push(*Marshal.load($1.unpack("m")[0].force_encoding("ASCII-8BIT"))).uniq!
+ $:.push(*Marshal.load($1.unpack1("m").force_encoding("ASCII-8BIT"))).uniq!
when /^run (.+?) (.+?)$/
_report "okay"
@@ -182,7 +180,7 @@ module Test
else
error = ProxyError.new(error)
end
- _report "record", Marshal.dump([suite.name, method, assertions, time, error])
+ _report "record", Marshal.dump([suite.name, method, assertions, time, error, suite.instance_method(method).source_location])
super
end
end
@@ -204,5 +202,9 @@ if $0 == __FILE__
end
end
require 'rubygems'
+ begin
+ require 'rake'
+ rescue LoadError
+ end
Test::Unit::Worker.new.run(ARGV)
end