diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-27 07:28:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-27 07:28:36 +0000 |
commit | 26fde5d1cb9415a68e5c90f61dd14ecd9ca73582 (patch) | |
tree | e0f4074cf323f78ec96fe1f04621ba3b33bc929e /test | |
parent | cfacc8dad73147266cb2f3a41c94b14a6b19f09a (diff) | |
download | ruby-26fde5d1cb9415a68e5c90f61dd14ecd9ca73582.tar.gz |
test/unit.rb: --test-order option
* test/lib/test/unit.rb (setup_options): add --test-order option
to override the test order.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/test/unit.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb index 0473ddb524..cbf6d348d6 100644 --- a/test/lib/test/unit.rb +++ b/test/lib/test/unit.rb @@ -88,6 +88,10 @@ module Test opts.on '-n', '--name PATTERN', "Filter test method names on pattern: /REGEXP/ or STRING" do |a| options[:filter] = a end + + opts.on '--test-order=random|alpha|sorted', [:random, :alpha, :sorted] do |a| + MiniTest::Unit::TestCase.test_order = a + end end def non_options(files, options) @@ -981,6 +985,14 @@ module MiniTest # :nodoc: all end class MiniTest::Unit::TestCase # :nodoc: all + test_order = self.test_order + def self.test_order + @test_order || superclass.test_order + end + class << self + attr_writer :test_order + end + self.test_order = test_order undef run_test RUN_TEST_TRACE = "#{__FILE__}:#{__LINE__+3}:in `run_test'".freeze def run_test(name) |