mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/testunit/tests_for_parallel/misc.rb: Fix bug in r30947.
* lib/test/unit.rb, lib/test/unit/assertions.rb: For this test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
48fa6ed529
commit
e9c22a6f1a
4 changed files with 43 additions and 21 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Feb 24 10:05:55 2011 Shota Fukumori (sora_h) <sorah@tubusu.net>
|
||||||
|
|
||||||
|
* test/testunit/tests_for_parallel/misc.rb: Fix bug in r30947.
|
||||||
|
* lib/test/unit.rb, lib/test/unit/assertions.rb: For this test.
|
||||||
|
|
||||||
Wed Feb 23 23:07:38 2011 Shota Fukumori (sora_h) <sorah@tubusu.net>
|
Wed Feb 23 23:07:38 2011 Shota Fukumori (sora_h) <sorah@tubusu.net>
|
||||||
|
|
||||||
* test/testunit/test_parallel.rb, test/testunit/parallel/*:
|
* test/testunit/test_parallel.rb, test/testunit/parallel/*:
|
||||||
|
|
|
@ -32,6 +32,7 @@ module Test
|
||||||
module Options
|
module Options
|
||||||
def initialize(*, &block)
|
def initialize(*, &block)
|
||||||
@init_hook = block
|
@init_hook = block
|
||||||
|
@options = nil
|
||||||
super(&nil)
|
super(&nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -232,6 +233,11 @@ module Test
|
||||||
|
|
||||||
alias orig_run_anything _run_anything
|
alias orig_run_anything _run_anything
|
||||||
undef _run_anything
|
undef _run_anything
|
||||||
|
undef options
|
||||||
|
|
||||||
|
def options
|
||||||
|
@optss ||= (@options||{}).merge(@opts)
|
||||||
|
end
|
||||||
|
|
||||||
def _run_anything type
|
def _run_anything type
|
||||||
if @opts[:parallel] && @warnings
|
if @opts[:parallel] && @warnings
|
||||||
|
|
|
@ -7,6 +7,12 @@ module Test
|
||||||
|
|
||||||
class TestCase < MiniTest::Unit::TestCase
|
class TestCase < MiniTest::Unit::TestCase
|
||||||
include Assertions
|
include Assertions
|
||||||
|
|
||||||
|
def run runner
|
||||||
|
@options = runner.options
|
||||||
|
super runner
|
||||||
|
end
|
||||||
|
|
||||||
def self.test_order
|
def self.test_order
|
||||||
:sorted
|
:sorted
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,31 +1,36 @@
|
||||||
module Test
|
# FIXME: more portability code
|
||||||
module Unit
|
if caller(7) && /block in non_options/ =~ caller(7)[0]
|
||||||
class Worker
|
class TestCaseForParallelTest < Test::Unit::TestCase;end
|
||||||
def run_tests
|
else
|
||||||
_run_anything :ptest
|
module Test
|
||||||
|
module Unit
|
||||||
|
class Worker
|
||||||
|
def run_tests
|
||||||
|
_run_anything :ptest
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
class Runner
|
||||||
class Runner
|
def run_tests
|
||||||
def run_tests
|
_run_anything :ptest
|
||||||
_run_anything :ptest
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
module MiniTest
|
||||||
module MiniTest
|
class Unit
|
||||||
class Unit
|
class << TestCase
|
||||||
class << TestCase
|
alias ptest_suites test_suites
|
||||||
alias ptest_suites test_suites
|
def ptest_methods;[];end
|
||||||
def ptest_methods;[];end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
class TestCaseForParallelTest < Test::Unit::TestCase
|
class TestCaseForParallelTest < Test::Unit::TestCase
|
||||||
class << self
|
class << self
|
||||||
undef ptest_methods
|
undef ptest_methods
|
||||||
def ptest_methods
|
def ptest_methods
|
||||||
public_instance_methods(true).grep(/^ptest/).map { |m| m.to_s }
|
public_instance_methods(true).grep(/^ptest/).map { |m| m.to_s }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue