[Groonga-commit] droonga/drntest at 63e5276 [master] Show test results at the last

Back to archive index

Yoji Shidara null+****@clear*****
Thu Sep 19 16:58:06 JST 2013


Yoji Shidara	2013-09-19 16:58:06 +0900 (Thu, 19 Sep 2013)

  New Revision: 63e52764f51ce50f18598c182133c5cda6970a19
  https://github.com/droonga/drntest/commit/63e52764f51ce50f18598c182133c5cda6970a19

  Message:
    Show test results at the last

  Added files:
    lib/drntest/test-suites-result.rb
  Modified files:
    lib/drntest/test-result.rb
    lib/drntest/test-runner.rb
    lib/drntest/tester.rb

  Modified: lib/drntest/test-result.rb (+3 -2)
===================================================================
--- lib/drntest/test-result.rb    2013-09-19 14:35:20 +0900 (65771a5)
+++ lib/drntest/test-result.rb    2013-09-19 16:58:06 +0900 (df4748b)
@@ -1,8 +1,9 @@
 module Drntest
   class TestResult
-    attr_accessor :expected, :actual
+    attr_accessor :name, :expected, :actual
 
-    def initialize
+    def initialize(name)
+      @name = name
       @expected = nil
       @actual = nil
     end

  Modified: lib/drntest/test-runner.rb (+4 -3)
===================================================================
--- lib/drntest/test-runner.rb    2013-09-19 14:35:20 +0900 (8ab60f2)
+++ lib/drntest/test-runner.rb    2013-09-19 16:58:06 +0900 (dd6d3b2)
@@ -15,7 +15,7 @@ module Drntest
 
     def run
       client = Droonga::Client.new(tag: tester.tag, port: tester.port)
-      result = TestResult.new
+      result = TestResult.new(target_path.to_s)
 
       print "#{target_path}: "
       request_envelope = load_request_envelope
@@ -31,14 +31,15 @@ module Drntest
 
       case result.status
       when :success
-        puts "PASS"
+        puts "SUCCESS"
       when :no_response
         puts "NO RESPONSE"
       when :failure
-        puts "FAIL"
+        puts "FAILURE"
         output_reject_file(actual)
         show_diff(expected, actual)
       when :not_checked
+        puts "NOT CHECKED"
         output_actual_file(actual)
       end
 

  Added: lib/drntest/test-suites-result.rb (+9 -0) 100644
===================================================================
--- /dev/null
+++ lib/drntest/test-suites-result.rb    2013-09-19 16:58:06 +0900 (f05120d)
@@ -0,0 +1,9 @@
+module Drntest
+  class TestSuitesResult
+    attr_accessor :test_results
+
+    def initialize
+      @test_results = []
+    end
+  end
+end

  Modified: lib/drntest/tester.rb (+12 -1)
===================================================================
--- lib/drntest/tester.rb    2013-09-19 14:35:20 +0900 (20623fd)
+++ lib/drntest/tester.rb    2013-09-19 16:58:06 +0900 (d5568a1)
@@ -1,5 +1,6 @@
 require "optparse"
 require "drntest/test-runner"
+require "drntest/test-suites-result"
 
 module Drntest
   class Tester
@@ -49,10 +50,20 @@ module Drntest
     end
 
     def run(*targets)
+      test_suites_result = TestSuitesResult.new
       tests = load_tests(*targets)
       tests.each do |test|
         test_runner = TestRunner.new(self, test)
-        test_runner.run
+        test_suites_result.test_results << test_runner.run
+      end
+
+      puts
+      puts "==== Test Results ===="
+      test_suites_result.test_results.each do |result|
+        puts "%s: %s" % [
+          result.name,
+          result.status
+        ]
       end
       0 # FIXME
     end
-------------- next part --------------
HTML����������������������������...
Download 



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