[Groonga-commit] droonga/drntest at f8dae9f [master] Add ability to embed options

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Nov 25 16:41:38 JST 2013


YUKI Hiroshi	2013-11-25 16:41:38 +0900 (Mon, 25 Nov 2013)

  New Revision: f8dae9f1d9c483398ae844ffc8f2daa3b4b19483
  https://github.com/droonga/drntest/commit/f8dae9f1d9c483398ae844ffc8f2daa3b4b19483

  Message:
    Add ability to embed options

  Modified files:
    lib/drntest/test-runner.rb

  Modified: lib/drntest/test-runner.rb (+21 -2)
===================================================================
--- lib/drntest/test-runner.rb    2013-11-25 16:11:45 +0900 (a9df2c8)
+++ lib/drntest/test-runner.rb    2013-11-25 16:41:38 +0900 (c1ebddc)
@@ -32,7 +32,14 @@ module Drntest
 
     def run
       print "#{target_path}: "
+      options = load_options
+      process_requests
+    end
+
+    private
+    def process_requests
       results = TestResults.new(target_path.to_s)
+
       load_request_envelopes.each do |request|
         executor = Executor.new(tester, request)
         results.actuals << executor.execute
@@ -59,7 +66,15 @@ module Drntest
       results
     end
 
-    private
+    def load_options
+      options = {}
+      target_path.read.each_line do |line|
+        next unless /\A#([^\s]+)\s+(.+)\z/ =~ line
+        options[$1] = $2
+      end
+      options
+    end
+
     def load_request_envelopes
       load_jsons(target_path)
     end
@@ -74,7 +89,11 @@ module Drntest
       parser.on_parse_complete = Proc.new do |json_object|
         json_objects << json_object
       end
-      parser << pathname.read
+      pathname.read.each_line do |line|
+        unless line[0] == "#"
+          parser << line 
+        end
+      end
       json_objects
     end
 
-------------- next part --------------
HTML����������������������������...
Download 



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