mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Added --test-order=nosort option
Run tests in the order given in the command line.
This commit is contained in:
parent
2c3c6c96cf
commit
968d6df49f
2 changed files with 8 additions and 3 deletions
|
@ -1404,11 +1404,14 @@ module MiniTest
|
|||
end
|
||||
|
||||
def self.test_suites # :nodoc:
|
||||
suites = @@test_suites.keys
|
||||
case self.test_order
|
||||
when :random
|
||||
@@test_suites.keys.shuffle
|
||||
suites.shuffle
|
||||
when :nosort
|
||||
suites
|
||||
else
|
||||
@@test_suites.keys.sort_by { |ts| ts.name.to_s }
|
||||
suites.sort_by { |ts| ts.name.to_s }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1424,6 +1427,8 @@ module MiniTest
|
|||
methods.sort.sort_by { rand max }
|
||||
when :alpha, :sorted then
|
||||
methods.sort
|
||||
when :nosort
|
||||
methods
|
||||
else
|
||||
raise "Unknown test_order: #{self.test_order.inspect}"
|
||||
end
|
||||
|
|
|
@ -102,7 +102,7 @@ module Test
|
|||
(options[:filter] ||= []) << a
|
||||
end
|
||||
|
||||
opts.on '--test-order=random|alpha|sorted', [:random, :alpha, :sorted] do |a|
|
||||
opts.on '--test-order=random|alpha|sorted|nosort', [:random, :alpha, :sorted, :nosort] do |a|
|
||||
MiniTest::Unit::TestCase.test_order = a
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue