summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/test/unit.rb7
-rw-r--r--lib/test/unit/parallel.rb4
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index 1272153c7b..6c4cecc442 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -87,7 +87,12 @@ module Test
end
opts.on '-j N', '--jobs N', "Allow run tests with N jobs at once" do |a|
- options[:parallel] = a.to_i
+ if /^t/ =~ a
+ options[:testing] = true # For testing
+ options[:parallel] = a[1..-1].to_i
+ else
+ options[:parallel] = a.to_i
+ end
end
opts.on '--no-retry', "Don't retry running testcase when --jobs specified" do
diff --git a/lib/test/unit/parallel.rb b/lib/test/unit/parallel.rb
index acfdc84bb4..ae1bf2961c 100644
--- a/lib/test/unit/parallel.rb
+++ b/lib/test/unit/parallel.rb
@@ -10,6 +10,7 @@ module Test
alias orig_run_suite _run_suite
undef _run_suite
undef _run_suites
+ undef run
def _run_suites suites, type
suites.map do |suite|
@@ -42,13 +43,12 @@ module Test
MiniTest::Unit.output = orig_stdout
o.close
- i.close
-
begin
th.join
rescue IOError
raise unless ["stream closed","closed stream"].include? $!.message
end
+ i.close
result << (report - r)
result << [@errors-e,@failures-f,@skips-s]