Navigation Menu

Skip to content

Commit

Permalink
run-regression-test: support rewriting "vector == ..."
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Sep 13, 2018
1 parent 454ab8d commit e82badd
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/groonga-query-log/command/run-regression-test.rb
Expand Up @@ -45,6 +45,8 @@ def initialize
@skip_finished_queries = false
@output_query_log = false
@stop_on_failure = false
@rewrite_vector_equal = false
@vector_accessors = []

@care_order = true
@ignored_drilldown_keys = []
Expand Down Expand Up @@ -151,6 +153,17 @@ def create_option_parser
"(#{@stop_on_failure})") do |boolean|
@stop_on_failure = boolean
end
parser.on("--[no-]rewrite-vector-equal",
"Rewrite 'vector == ...' with 'vector @ ...'",
"(#{@rewrite_vector_equal})") do |boolean|
@rewrite_vector_equal = boolean
end
parser.on("--vector-accessor=ACCESSOR",
"Mark ACCESSOR as rewrite vector targets",
"You can specify multiple vector accessors by",
"specifying this option multiple times") do |accessor|
@vector_accessors << accessor
end

parser.separator("")
parser.separator("Comparisons:")
Expand Down Expand Up @@ -208,6 +221,8 @@ def tester_options
:skip_finished_queries => @skip_finished_queries,
:ignored_drilldown_keys => @ignored_drilldown_keys,
:stop_on_failure => @stop_on_failure,
:rewrite_vector_equal => @rewrite_vector_equal,
:vector_accessors => @vector_accessors,
:target_command_names => @target_command_names,
:read_timeout => @read_timeout,
}
Expand Down Expand Up @@ -484,6 +499,14 @@ def verify_server(test_log_path, query_log_path, &callback)
if @stop_on_failure
command_line << "--stop-on-failure"
end
if @options[:rewrite_vector_equal]
command_line << "--rewrite-vector-equal"
end
vector_accessors = @options[:vector_accessors] || []
vector_accessors.each do |vector_accessor|
command_line << "--vector-accessor"
command_line << vector_accessor
end
if @options[:target_command_names]
command_line << "--target-command-names"
command_line << @options[:target_command_names].join(",")
Expand Down

0 comments on commit e82badd

Please sign in to comment.