Navigation Menu

Skip to content

Commit

Permalink
Use inplace reporter for multi workers
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 11, 2012
1 parent 4077fc9 commit f02b2e4
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions lib/groonga/tester.rb
Expand Up @@ -112,7 +112,7 @@ def create_option_parser(tester, tag)
parser.on("--reporter=REPORTER", available_reporters,
"Report test result by REPORTER",
"[#{available_reporter_labels}]",
"(#{tester.reporter})") do |reporter|
"(auto)") do |reporter|
tester.reporter = reporter
end

Expand Down Expand Up @@ -157,21 +157,22 @@ def create_option_parser(tester, tag)

attr_accessor :groonga, :groonga_httpd, :groonga_suggest_create_dataset
attr_accessor :protocol, :testee
attr_accessor :base_directory, :diff, :diff_options, :reporter
attr_accessor :base_directory, :diff, :diff_options
attr_accessor :n_workers
attr_accessor :output
attr_accessor :gdb, :default_gdb
attr_writer :keep_database, :use_color
attr_writer :reporter, :keep_database, :use_color
def initialize
@groonga = "groonga"
@groonga_httpd = "groonga-httpd"
@groonga_suggest_create_dataset = "groonga-suggest-create-dataset"
@protocol = :gqtp
@testee = "groonga"
@base_directory = "."
@reporter = :stream
@reporter = nil
@n_workers = 1
@output = $stdout
@keep_database = false
@use_color = nil
detect_suitable_diff
initialize_debuggers
Expand All @@ -185,6 +186,18 @@ def run(*targets)
run_test_suites(test_suites)
end

def reporter
if @reporter.nil?
if @n_workers == 1
:stream
else
:inplace
end
else
@reporter
end
end

def keep_database?
@keep_database
end
Expand Down

0 comments on commit f02b2e4

Please sign in to comment.