[Groonga-commit] droonga/drntest at 7cc83c9 [master] Support tests under subdirectories

Back to archive index

Yoji Shidara null+****@clear*****
Wed Sep 18 18:22:22 JST 2013


Yoji Shidara	2013-09-18 18:22:22 +0900 (Wed, 18 Sep 2013)

  New Revision: 7cc83c917abcf7450355df6aef13b8c77c381058
  https://github.com/droonga/drntest/commit/7cc83c917abcf7450355df6aef13b8c77c381058

  Message:
    Support tests under subdirectories

  Modified files:
    lib/drntest/tester.rb

  Modified: lib/drntest/tester.rb (+17 -2)
===================================================================
--- lib/drntest/tester.rb    2013-09-18 17:34:22 +0900 (027828d)
+++ lib/drntest/tester.rb    2013-09-18 18:22:22 +0900 (e1b1481)
@@ -52,12 +52,27 @@ module Drntest
     end
 
     def run(*targets)
-      targets.each do |target|
-        run_test(target)
+      tests = load_tests(*targets)
+      tests.each do |test|
+        run_test(test)
       end
       0 # FIXME
     end
 
+    def load_tests(*targets)
+      tests = []
+      targets.each do |target|
+        target_path = Pathname(target)
+        next unless target_path.exist?
+        if target_path.directory?
+          tests += Pathname.glob(target_path + "**" + "*.test")
+        else
+          tests << target_path
+        end
+      end
+      tests
+    end
+
     def run_test(target)
       client = Droonga::Client.new(tag: tag, port: port)
       envelope = JSON.parse(File.read(target))
-------------- next part --------------
HTML����������������������������...
Download 



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