Class: GroongaQueryLog::Command::RunRegressionTest::Tester

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/groonga-query-log/command/run-regression-test.rb

Instance Method Summary collapse

Methods included from Loggable

#puts

Constructor Details

#initialize(old, new, options) ⇒ Tester

Returns a new instance of Tester.



515
516
517
518
519
520
521
522
523
524
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 515

def initialize(old, new, options)
  @old = old
  @new = new
  @input_directory = options[:input_directory] || Pathname.new(".")
  @working_directory = options[:working_directory] || Pathname.new(".")
  @n_clients = options[:n_clients] || 1
  @stop_on_failure = options[:stop_on_failure]
  @options = options
  @n_ready_waits = 2
end

Instance Method Details

#runObject



526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 526

def run
  @old.ensure_database
  @new.ensure_database

  old_thread = Thread.new do
    @old.run do
      run_test
    end
  end
  new_thread = Thread.new do
    @new.run do
      run_test
    end
  end

  old_thread_success = old_thread.value
  new_thread_success = new_thread.value

  old_thread_success and new_thread_success
end