All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dog.DogTracker.scala Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
package dog

import java.util.concurrent.atomic.AtomicInteger

private[dog] class DogTracer() {

  private[this] val successCount = new AtomicInteger
  private[this] val failureCount = new AtomicInteger
  private[this] val errorCount = new AtomicInteger
  private[this] val ignoredCount = new AtomicInteger
  private[this] val testCount = new AtomicInteger

  def success(): Int = successCount.incrementAndGet()
  def failure(): Int = failureCount.incrementAndGet()
  def error(): Int = errorCount.incrementAndGet()
  def ignore(): Int = ignoredCount.incrementAndGet()
  def total(): Int = testCount.incrementAndGet()

  def done: String = Seq(
    s"Total test count: $testCount",
    s"Failed $failureCount, Errors $errorCount, Passed $successCount, Ignored $ignoredCount"
  ).map(Console.CYAN + _).mkString(sys.props("line.separator"))
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy