Permalink
Browse files

Only print extra test status counts if nonzero

  • Loading branch information...
1 parent 301c11f commit 53191cb787703d0a533e1fd02c4f25e1da09a10a @harrah harrah committed Jun 28, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 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)

0 comments on commit 53191cb

Please sign in to comment.