+ afterSuite { desc, result ->
+
+ if (desc.parent) return // Only summarize results for whole modules
+
+ String summary = "${testTask.project.name}:${testTask.name} results: ${result.resultType} " +
+ "(" +
+ "${result.testCount} tests, " +
+ "${result.successfulTestCount} successes, " +
+ "${result.failedTestCount} failures, " +
+ "${result.skippedTestCount} skipped" +
+ ") " +
+ "in ${TimeCategory.minus(new Date(result.endTime), new Date(result.startTime))}" +
+ "\n" +
+ "Report file: ${testTask.reports.html.entryPoint}"
+
+ // Add reports in `testsResults`, keep failed suites at the end
+ if (result.resultType == TestResult.ResultType.SUCCESS) {
+ rootProject.ext.testsResults.add(0, summary)
+ } else {
+ rootProject.ext.testsResults += summary
+ }
+ if (result.resultType == TestResult.ResultType.FAILURE) {
+ testsFailed = true
+ }
+ }
+
+ // from original test task