[Groonga-commit] groonga/groonga-query-log at 3d942fb [master] Add new options to run-regression-test command.

Back to archive index

HorimotoYasuhiro null+****@clear*****
Mon Apr 10 17:41:47 JST 2017


HorimotoYasuhiro	2017-04-10 17:41:47 +0900 (Mon, 10 Apr 2017)

  New Revision: 3d942fb252cec9a1fd25bf1b7ca1fbe5d6c702cf
  https://github.com/groonga/groonga-query-log/commit/3d942fb252cec9a1fd25bf1b7ca1fbe5d6c702cf

  Merged 47fec05: Merge pull request #5 from komainu8/feature/add_new_option

  Message:
    Add new options to run-regression-test command.
    
    New options are "--old-groonga-option" and "--new-groonga-option".

  Modified files:
    lib/groonga/query-log/command/run-regression-test.rb

  Modified: lib/groonga/query-log/command/run-regression-test.rb (+27 -1)
===================================================================
--- lib/groonga/query-log/command/run-regression-test.rb    2016-09-29 16:37:29 +0900 (e776d99)
+++ lib/groonga/query-log/command/run-regression-test.rb    2017-04-10 17:41:47 +0900 (cfc3465)
@@ -34,9 +34,11 @@ module Groonga
 
           @old_groonga = "groonga"
           @old_database = "db.old/db"
+          @old_groonga_options = []
 
           @new_groonga = "groonga"
           @new_database = "db.new/db"
+          @new_groonga_options = []
 
           @recreate_database = false
           @load_data = true
@@ -96,6 +98,14 @@ module Groonga
           end
 
           parser.separator("")
+          parser.separator("Old Groonga Option:")
+          parser.on("--old-groonga-option=GROONGA_OPTION",
+                    "Old groonga option",
+                    "(#{@old_groonga_options})") do |groonga_option|
+            @old_groonga_options << groonga_option
+          end
+
+          parser.separator("")
           parser.separator("New Groonga:")
           parser.on("--new-groonga=GROONGA",
                     "New groonga command",
@@ -104,6 +114,14 @@ module Groonga
           end
 
           parser.separator("")
+          parser.separator("New Groonga Option:")
+          parser.on("--new-groonga-option=GROONGA_OPTION",
+                    "New groonga option",
+                    "(#{@new_groonga_options})") do |groonga_option|
+            @new_groonga_options << groonga_option
+          end
+
+          parser.separator("")
           parser.separator("Operations:")
           parser.on("--recreate-database",
                     "Always recreate Groonga database") do
@@ -161,22 +179,25 @@ module Groonga
 
         def old_groonga_server
           GroongaServer.new(@old_groonga,
+                            @old_groonga_options,
                             @old_database,
                             server_options)
         end
 
         def new_groonga_server
           GroongaServer.new(@new_groonga,
+                            @new_groonga_options,
                             @new_database,
                             server_options)
         end
 
         class GroongaServer
           attr_reader :host, :port
-          def initialize(groonga, database_path, options)
+          def initialize(groonga, groonga_options, database_path, options)
             @input_directory = options[:input_directory] || Pathname.new(".")
             @working_directory = options[:working_directory] || Pathname.new(".")
             @groonga = groonga
+            @groonga_options = groonga_options
             @database_path = @working_directory + database_path
             @host = "127.0.0.1"
             @port = find_unused_port
@@ -192,6 +213,11 @@ module Groonga
               "--protocol", "http",
               "--log-path", log_path.to_s,
             ]
+
+            @groonga_options.each{|groonga_option|
+              arguments << groonga_option
+            }
+
             if @options[:output_query_log]
               arguments.concat(["--query-log-path", query_log_path.to_s])
             end
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index