add tweakable test output and project test result summary

Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/84c8d3f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/84c8d3f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/84c8d3f1

Branch: refs/heads/master
Commit: 84c8d3f1fc5e30e59ec2a617b51c01378c60a050
Parents: 85cff2c
Author: Dale LaBossiere <[email protected]>
Authored: Tue Sep 27 12:42:06 2016 -0400
Committer: Dale LaBossiere <[email protected]>
Committed: Tue Sep 27 16:04:09 2016 -0400

----------------------------------------------------------------------
 build.gradle | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/84c8d3f1/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index d47843f..5d1d4fa 100644
--- a/build.gradle
+++ b/build.gradle
@@ -430,10 +430,23 @@ subprojects {
     systemProperty 'edgent.test.root.dir', rootProject.projectDir
     testLogging {
       exceptionFormat 'full'
+      showStandardStreams = System.properties['edgent.test.showOutput'] != null
+    }
+    beforeSuite { desc ->
+      if (!desc.parent) { // will match the outermost suite
+        println "$project.path testing ..."
+      }
+    }
+    afterSuite { desc, result ->
+      if (!desc.parent) { // will match the outermost suite
+        def duration = String.format('%.3fsec', (result.endTime - 
result.startTime) / 1000)
+        println "$project.path $duration $result.resultType ($result.testCount 
tests, $result.failedTestCount failures, $result.skippedTestCount skipped)"
+      }
     }
     reports {
-      junitXml.enabled = true
-      html.enabled = true
+      // individual <project>/build/reports not needed with aggregate 
junit/jacoco reports
+      junitXml.enabled = System.properties['edgent.test.projectReports'] != 
null
+      html.enabled = System.properties['edgent.test.projectReports'] != null
     }
     doFirst {
       // The project's tests are supposed to run against its target-dir jar.

Reply via email to