Implemented log summary and updated log configurations (#54) (#55)
authorJeanderson Barros Candido <jeandersonbc@gmail.com>
Wed, 23 May 2018 11:30:31 +0000 (08:30 -0300)
committercyrille-artho <cyrille-artho@users.noreply.github.com>
Wed, 23 May 2018 11:30:31 +0000 (20:30 +0900)
build.gradle

index a213a1d..2f9b7f3 100644 (file)
@@ -58,6 +58,23 @@ test {
         def ignoredPath = "**/" + failedTestClass.replace(".", "/") + ".class"
         exclude ignoredPath
     }
+
+    testLogging {
+        events "passed", "skipped", "failed"
+    }
+
+    afterSuite { testDescriptor, result ->
+        if (!testDescriptor.parent) {
+            println "Test Execution: ${result.resultType}"
+
+            def summaryFields = ["${result.testCount} tests",
+                                 "${result.successfulTestCount} passed",
+                                 "${result.failedTestCount} failed",
+                                 "${result.skippedTestCount} skipped"]
+
+            println "Summary: " + summaryFields.join(", ")
+        }
+    }
 }
 
 task compile {