summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-26 09:19:00 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-26 09:19:00 +0000
commit2e87867a8f07e93141156933e8d648c57c0b57d4 (patch)
treef3369ddc998461d98f3fe18edfd8cccc9b19625b /benchmark
parent6746eecaf132cd2b4f4fed85e9bb66c4f655eb2e (diff)
* benchmark/driver.rb: accept multiple `-e'.
You don't need to use `;' separation character. [ruby-core:50139] [ruby-trunk - Bug #7380] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/driver.rb23
1 files changed, 13 insertions, 10 deletions
diff --git a/benchmark/driver.rb b/benchmark/driver.rb
index 82b61f2b1b..5719a7a4c3 100644
--- a/benchmark/driver.rb
+++ b/benchmark/driver.rb
@@ -60,13 +60,14 @@ class BenchmarkDriver
if /(.+)::(.+)/ =~ e
# ex) ruby-a::/path/to/ruby-a
- v = $1.strip
- e = $2
+ label = $1.strip
+ path = $2
+ version = `#{path} -v`.chomp
else
- v = `#{e} -v`.chomp
- v.sub!(/ patchlevel \d+/, '')
+ path = e
+ version = label = `#{path} -v`.chomp
end
- [e, v]
+ [path, label, version]
}.compact
@dir = dir
@@ -86,8 +87,8 @@ class BenchmarkDriver
if @verbose
@start_time = Time.now
message @start_time
- @execs.each_with_index{|(_, v), i|
- message "target #{i}: #{v}"
+ @execs.each_with_index{|(path, label, version), i|
+ message "target #{i}: " + (label == version ? "#{label}" : "#{label} (#{version})") + " at #{path}"
}
end
end
@@ -255,7 +256,7 @@ end
if __FILE__ == $0
opt = {
- :execs => ['ruby'],
+ :execs => [],
:dir => File.dirname(__FILE__),
:repeat => 1,
:output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
@@ -263,8 +264,10 @@ if __FILE__ == $0
parser = OptionParser.new{|o|
o.on('-e', '--executables [EXECS]',
- "Specify benchmark one or more targets. (exec1;exec2;exec3;...)"){|e|
- opt[:execs] = e.split(/;/)
+ "Specify benchmark one or more targets (e1::path1; e2::path2; e3::path3;...)"){|e|
+ e.split(/;/).each{|path|
+ opt[:execs] << path
+ }
}
o.on('-d', '--directory [DIRECTORY]', "Benchmark suites directory"){|d|
opt[:dir] = d