This sbt plug-in provides reporting of test success and failure for tests run by
[simple build tool](https://github.com/sbt/sbt)
-in [TAP](http://search.cpan.org/perldoc?Test%3A%3AHarness%3A%3ATAP) format.
+in [TAP](http://search.cpan.org/perldoc?TAP%3A%3AParser%3A%3AGrammar) format.
All the test results will be generated in one file, the path of which may be
specified in the `SBT_TAP_OUTPUT` environment variable. If unspecified in the
val file = new File(filename)
new File(file.getParent).mkdirs
fileWriter = new FileWriter(file)
+ writeTap("TAP", "version", 13)
}
def startGroup(name: String) =
def testEvent(event: TestEvent) = {
event.detail.foreach { e: TEvent =>
+ val description = e.testName.replaceAll("#", "%23")
e.result match {
- case TResult.Success => writeTap("ok", testId.incrementAndGet, "-", e.testName)
+ case TResult.Success =>
+ writeTap("ok", testId.incrementAndGet, "-", description)
+ case TResult.Skipped =>
+ writeTap("ok", testId.incrementAndGet, "-", description, "# SKIP")
case TResult.Error | TResult.Failure =>
- writeTap("not ok", testId.incrementAndGet, "-", e.testName)
+ writeTap("not ok", testId.incrementAndGet, "-", description)
// TODO: It would be nice if we could report the exact line in the test where this happened.
writeTapDiag(stackTraceForError(e.error))
- case TResult.Skipped =>
- // it doesn't look like this framework distinguishes between pending and ignored.
- writeTap("ok", testId.incrementAndGet, e.testName, "#", "skip", e.testName)
}
}
}