ruby-changes:25210
From: ko1 <ko1@a...>
Date: Fri, 19 Oct 2012 10:23:22 +0900 (JST)
Subject: [ruby-changes:25210] ko1:r37261 (trunk): * benchmark/driver.rb: add new option `--ruby-arg [ARG]'
ko1 2012-10-19 10:22:08 +0900 (Fri, 19 Oct 2012) New Revision: 37261 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37261 Log: * benchmark/driver.rb: add new option `--ruby-arg [ARG]' which is passed as a launch parameter for each ruby's execution. ($ ruby [ARG] [File]) Modified files: trunk/ChangeLog trunk/benchmark/driver.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 37260) +++ ChangeLog (revision 37261) @@ -1,3 +1,9 @@ +Fri Oct 19 10:20:10 2012 Koichi Sasada <ko1@a...> + + * 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@a...> * insns.def (opt_send_simple): move the location of Index: benchmark/driver.rb =================================================================== --- benchmark/driver.rb (revision 37260) +++ benchmark/driver.rb (revision 37261) @@ -76,6 +76,7 @@ @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 @@ end def measure executable, file - cmd = "#{executable} #{file}" + cmd = "#{executable} #{@ruby_arg} #{file}" + + output cmd m = Benchmark.measure{ `#{cmd}` } @@ -274,6 +277,9 @@ 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 } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/