mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
7e8f558aea
commit
a31d53ecf5
2 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Fri Oct 19 10:20:10 2012 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* benchmark/driver.rb: add new option `--ruby-arg [ARG]'
|
||||||
|
which is passed as a launch parameter for each ruby's execution.
|
||||||
|
($ ruby [ARG] [File])
|
||||||
|
|
||||||
Thu Oct 18 18:42:35 2012 Koichi Sasada <ko1@atdot.net>
|
Thu Oct 18 18:42:35 2012 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* insns.def (opt_send_simple): move the location of
|
* insns.def (opt_send_simple): move the location of
|
||||||
|
|
|
@ -76,6 +76,7 @@ class BenchmarkDriver
|
||||||
@verbose = opt[:quiet] ? false : (opt[:verbose] || false)
|
@verbose = opt[:quiet] ? false : (opt[:verbose] || false)
|
||||||
@output = opt[:output] ? open(opt[:output], 'w') : nil
|
@output = opt[:output] ? open(opt[:output], 'w') : nil
|
||||||
@loop_wl1 = @loop_wl2 = nil
|
@loop_wl1 = @loop_wl2 = nil
|
||||||
|
@ruby_arg = opt[:ruby_arg] || nil
|
||||||
@opt = opt
|
@opt = opt
|
||||||
|
|
||||||
# [[name, [[r-1-1, r-1-2, ...], [r-2-1, r-2-2, ...]]], ...]
|
# [[name, [[r-1-1, r-1-2, ...], [r-2-1, r-2-2, ...]]], ...]
|
||||||
|
@ -235,7 +236,9 @@ class BenchmarkDriver
|
||||||
end
|
end
|
||||||
|
|
||||||
def measure executable, file
|
def measure executable, file
|
||||||
cmd = "#{executable} #{file}"
|
cmd = "#{executable} #{@ruby_arg} #{file}"
|
||||||
|
|
||||||
|
output cmd
|
||||||
m = Benchmark.measure{
|
m = Benchmark.measure{
|
||||||
`#{cmd}`
|
`#{cmd}`
|
||||||
}
|
}
|
||||||
|
@ -274,6 +277,9 @@ if __FILE__ == $0
|
||||||
o.on('-o', '--output-file [FILE]', "Output file"){|f|
|
o.on('-o', '--output-file [FILE]', "Output file"){|f|
|
||||||
opt[:output] = 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|
|
o.on('-q', '--quiet', "Run without notify information except result table."){|q|
|
||||||
opt[:quiet] = q
|
opt[:quiet] = q
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue