Question

How to get a list of test cases (fully qualified names) under current project?

The environment is Scala 2.10.2, Sbt 0.12.3 and scalatest 1.9.1

Était-ce utile?

La solution

(definedTests in Test) returns sbt.TestDefinition.

val printTests = taskKey[Unit]("something")

printTests := {
  val tests = (definedTests in Test).value
  tests map { t =>
    println(t.name)
  }
}

The above is in sbt 0.13 syntax, but the idea should be same in sbt 0.12.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top