From 53191cb787703d0a533e1fd02c4f25e1da09a10a Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Fri, 28 Jun 2013 09:48:27 -0400 Subject: [PATCH] Only print extra test status counts if nonzero --- main/actions/src/main/scala/sbt/Tests.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main/actions/src/main/scala/sbt/Tests.scala b/main/actions/src/main/scala/sbt/Tests.scala index b612720a8..4f1275dfe 100644 --- a/main/actions/src/main/scala/sbt/Tests.scala +++ b/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)