summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--benchmark/driver.rb5
2 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ad0ea0c..786ab97 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Oct 24 17:41:24 2012 Koichi Sasada <ko1@atdot.net>
+
+ * 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 <authornari@gmail.com>
* gc.c (gc_prepare_free_objects): rename to match the behavior of
diff --git a/benchmark/driver.rb b/benchmark/driver.rb
index 66bbe6b..c1e4a6c 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
}