diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-24 00:50:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-24 00:50:59 +0000 |
commit | 642b3a260bda7e4b8380bcc797efce547879295e (patch) | |
tree | 31815f25f28210acc368662e08d9baea6ea058f9 /test/lib/test/unit.rb | |
parent | cad799b006e2451853495aa7d7201ccc7b99ed55 (diff) |
test/unit.rb: --repeat-count option
* test/lib/test/unit.rb (Test::Unit::RepeatOption): --repeat-count
option to repeat COUNT times while success.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib/test/unit.rb')
-rw-r--r-- | test/lib/test/unit.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb index 1a5957bfc1..f0bd26f32f 100644 --- a/test/lib/test/unit.rb +++ b/test/lib/test/unit.rb @@ -853,6 +853,22 @@ module Test end end + module RepeatOption # :nodoc: all + def setup_options(parser, options) + super + options[:repeat_count] = nil + parser.separator "repeat options:" + parser.on '--repeat-count=NUM', "Number of times to repeat", Integer do |n| + options[:repeat_count] = n + end + end + + def _run_anything(type) + @repeat_count = @options[:repeat_count] + super + end + end + module ExcludesOption # :nodoc: all class ExcludedMethods < Struct.new(:excludes) def exclude(name, reason) @@ -922,6 +938,7 @@ module Test include Test::Unit::Parallel include Test::Unit::Skipping include Test::Unit::GlobOption + include Test::Unit::RepeatOption include Test::Unit::LoadPathOption include Test::Unit::GCStressOption include Test::Unit::ExcludesOption |