From 9b68747be0f70908d0147b4d753e322bab5a8b5c Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 24 Oct 2012 08:46:01 +0000 Subject: * benchmark/driver.rb: add `-x' or `--exclude' option to specify exclude benchmark name pattern. You can specify "-x foo" if you want to exclude the benchmarks if the name of benchmark contains `foo'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ benchmark/driver.rb | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index ad0ea0cb5c..786ab971b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Oct 24 17:41:24 2012 Koichi Sasada + + * benchmark/driver.rb: add `-x' or `--exclude' option + to specify exclude benchmark name pattern. + You can specify "-x foo" if you want to exclude the benchmarks + if the name of benchmark contains `foo'. + Wed Oct 24 11:57:24 2012 Narihiro Nakamura * gc.c (gc_prepare_free_objects): rename to match the behavior of diff --git a/benchmark/driver.rb b/benchmark/driver.rb index 66bbe6b35f..c1e4a6c5e8 100644 --- a/benchmark/driver.rb +++ b/benchmark/driver.rb @@ -73,6 +73,7 @@ class BenchmarkDriver @repeat = opt[:repeat] || 1 @repeat = 1 if @repeat < 1 @pattern = opt[:pattern] || nil + @exclude = opt[:exclude] || nil @verbose = opt[:quiet] ? false : (opt[:verbose] || false) @output = opt[:output] ? open(opt[:output], 'w') : nil @loop_wl1 = @loop_wl2 = nil @@ -175,6 +176,7 @@ class BenchmarkDriver flag = {} @files = Dir.glob(File.join(@dir, 'bm*.rb')).map{|file| next if @pattern && /#{@pattern}/ !~ File.basename(file) + next if @exclude && /#{@exclude}/ =~ File.basename(file) case file when /bm_(vm[12])_/, /bm_loop_(whileloop2?).rb/ flag[$1] = true @@ -270,6 +272,9 @@ if __FILE__ == $0 o.on('-p', '--pattern [PATTERN]', "Benchmark name pattern"){|p| opt[:pattern] = p } + o.on('-x', '--exclude [PATTERN]', "Benchmark exclude pattern"){|e| + opt[:exclude] = e + } o.on('-r', '--repeat-count [NUM]', "Repeat count"){|n| opt[:repeat] = n.to_i } -- cgit v1.2.3