Class: GroongaQueryLog::Command::RunRegressionTest::Tester
- Inherits:
-
Object
- Object
- GroongaQueryLog::Command::RunRegressionTest::Tester
- Includes:
- Loggable
- Defined in:
- lib/groonga-query-log/command/run-regression-test.rb
Instance Attribute Summary collapse
-
#new ⇒ Object
readonly
Returns the value of attribute new.
-
#old ⇒ Object
readonly
Returns the value of attribute old.
Instance Method Summary collapse
-
#initialize(old, new, options) ⇒ Tester
constructor
A new instance of Tester.
- #n_executed_commands ⇒ Object
- #run ⇒ Object
Methods included from Loggable
Constructor Details
#initialize(old, new, options) ⇒ Tester
Returns a new instance of Tester.
762 763 764 765 766 767 768 769 770 771 772 773 774 |
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 762 def initialize(old, new, ) @old = old @new = new @input_directory = [:input_directory] || Pathname.new(".") @working_directory = [:working_directory] || Pathname.new(".") @results_directory = [:results_directory] || (@working_directory + "results") @n_clients = [:n_clients] || 1 @stop_on_failure = [:stop_on_failure] @options = @n_ready_waits = 2 @n_executed_commands = 0 end |
Instance Attribute Details
#new ⇒ Object (readonly)
Returns the value of attribute new.
761 762 763 |
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 761 def new @new end |
#old ⇒ Object (readonly)
Returns the value of attribute old.
760 761 762 |
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 760 def old @old end |
Instance Method Details
#n_executed_commands ⇒ Object
797 798 799 |
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 797 def n_executed_commands @n_executed_commands end |
#run ⇒ Object
776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 |
# File 'lib/groonga-query-log/command/run-regression-test.rb', line 776 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 |