Вопрос

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

Это было полезно?

Решение

(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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top