summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-19 01:22:08 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-19 01:22:08 +0000
commita31d53ecf58686718128021b4d3c4f0575e0ad28 (patch)
tree430448b7d22736d1991ee0fe39fe66546ebabefe /benchmark
parent7e8f558aea05d97f7879d6ead4488cc9807c5136 (diff)
* benchmark/driver.rb: add new option `--ruby-arg [ARG]'
which is passed as a launch parameter for each ruby's execution. ($ ruby [ARG] [File]) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/driver.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/benchmark/driver.rb b/benchmark/driver.rb
index cea5d55..f93ccb3 100644
--- a/benchmark/driver.rb
+++ b/benchmark/driver.rb
@@ -76,6 +76,7 @@ class BenchmarkDriver
@verbose = opt[:quiet] ? false : (opt[:verbose] || false)
@output = opt[:output] ? open(opt[:output], 'w') : nil
@loop_wl1 = @loop_wl2 = nil
+ @ruby_arg = opt[:ruby_arg] || nil
@opt = opt
# [[name, [[r-1-1, r-1-2, ...], [r-2-1, r-2-2, ...]]], ...]
@@ -235,7 +236,9 @@ class BenchmarkDriver
end
def measure executable, file
- cmd = "#{executable} #{file}"
+ cmd = "#{executable} #{@ruby_arg} #{file}"
+
+ output cmd
m = Benchmark.measure{
`#{cmd}`
}
@@ -274,6 +277,9 @@ if __FILE__ == $0
o.on('-o', '--output-file [FILE]', "Output file"){|f|
opt[:output] = f
}
+ o.on('--ruby-arg [ARG]', "Optional argument for ruby"){|a|
+ opt[:ruby_arg] = a
+ }
o.on('-q', '--quiet', "Run without notify information except result table."){|q|
opt[:quiet] = q
}