[Groonga-commit] droonga/drntest at 3b6aed4 [master] Introduce @enable(disable)_completion and @enable(disable)_validation directives

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Jan 16 18:41:34 JST 2015


YUKI Hiroshi	2015-01-16 18:41:34 +0900 (Fri, 16 Jan 2015)

  New Revision: 3b6aed4f353345e40141ca2f252eba00b2d041b9
  https://github.com/droonga/drntest/commit/3b6aed4f353345e40141ca2f252eba00b2d041b9

  Message:
    Introduce @enable(disable)_completion and @enable(disable)_validation directives

  Modified files:
    lib/drntest/directive.rb
    lib/drntest/test-executor.rb
    lib/drntest/test-loader.rb

  Modified: lib/drntest/directive.rb (+12 -0)
===================================================================
--- lib/drntest/directive.rb    2014-12-16 18:45:19 +0900 (0d600d7)
+++ lib/drntest/directive.rb    2015-01-16 18:41:34 +0900 (732a397)
@@ -55,4 +55,16 @@ module Drntest
       @version = version
     end
   end
+
+  class EnableCompletionDirective < Directive
+  end
+
+  class DisableCompletionDirective < Directive
+  end
+
+  class EnableValidationDirective < Directive
+  end
+
+  class DisableValidationDirective < Directive
+  end
 end

  Modified: lib/drntest/test-executor.rb (+16 -2)
===================================================================
--- lib/drntest/test-executor.rb    2014-12-16 18:45:19 +0900 (6782c2e)
+++ lib/drntest/test-executor.rb    2015-01-16 18:41:34 +0900 (149e6f0)
@@ -63,6 +63,8 @@ module Drntest
         @requests = []
         @responses = []
         @logging = true
+        @completion = nil
+        @validation = nil
       end
 
       def execute(operation)
@@ -98,19 +100,31 @@ module Drntest
             @results.omit(message)
             abort_execution
           end
+        when EnableCompletionDirective
+          @completion = true
+        when DisableCompletionDirective
+          @completion = false
+        when EnableValidationDirective
+          @validation = true
+        when DisableValidationDirective
+          @validation = false
         end
       end
 
       def execute_request(request)
+        options = {}
+        options[:completion] = @completion unles****@compl*****?
+        options[:validation] = @validation unles****@valid*****?
+
         if @logging
           responses = []
-          request_process =****@clien*****(request) do |raw_response|
+          request_process =****@clien*****(request, options) do |raw_response|
             responses << clean_response(request, raw_response)
           end
           request_process.wait
           @responses.concat(normalize_responses(request, responses))
         else
-          @requests << @client.request(request) do
+          @requests << @client.request(request, options) do
           end
         end
       end

  Modified: lib/drntest/test-loader.rb (+8 -0)
===================================================================
--- lib/drntest/test-loader.rb    2014-12-16 18:45:19 +0900 (37ac725)
+++ lib/drntest/test-loader.rb    2015-01-16 18:41:34 +0900 (30966ce)
@@ -91,6 +91,14 @@ module Drntest
         OmitDirective.new(options.first)
       when :require_catalog_version
         RequireCatalogVersionDirective.new(Integer(options.first))
+      when :enable_completion
+        EnableCompletionDirective.new
+      when :disable_completion
+        DisableCompletionDirective.new
+      when :enable_validation
+        EnableValidationDirective.new
+      when :disable_validation
+        DisableValidationDirective.new
       else
         UnknownDirective.new(type, options)
       end
-------------- next part --------------
HTML����������������������������...
Download 



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