Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Only print extra test status counts if nonzero

  • Loading branch information...
commit 53191cb787703d0a533e1fd02c4f25e1da09a10a 1 parent 301c11f
@harrah harrah authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 main/actions/src/main/scala/sbt/Tests.scala
View
8 main/actions/src/main/scala/sbt/Tests.scala
@@ -236,8 +236,12 @@ object Tests
ignoredAcc + testEvent.ignoredCount, canceledAcc + testEvent.canceledCount, pendingAcc + testEvent.pendingCount)
}
val totalCount = failuresCount + errorsCount + skippedCount + passedCount
- val postfix = "Total " + totalCount + ", Failed " + failuresCount + ", Errors " + errorsCount + ", Passed " + passedCount + ", Skipped " + skippedCount +
- ", Ignored " + ignoredCount + ", Canceled " + canceledCount + ", Pending " + pendingCount
+ val base = s"Total $totalCount, Failed $failuresCount, Errors $errorsCount, Passed $passedCount"
+
+ val otherCounts = Seq("Skipped" -> skippedCount, "Ignored" -> ignoredCount, "Canceled" -> canceledCount, "Pending" -> pendingCount)
+ val extra = otherCounts.filter(_._2 > 0).map{case(label,count) => s", $label $count" }
+
+ val postfix = base + extra.mkString
results.overall match {
case TestResult.Error => log.error("Error: " + postfix)
case TestResult.Passed => log.info("Passed: " + postfix)
Please sign in to comment.
Something went wrong with that request. Please try again.