]> Dogcows Code - chaz/sbt-tap/commitdiff
update tap protocol version to 13
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Mon, 14 Jan 2013 18:27:27 +0000 (11:27 -0700)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Mon, 14 Jan 2013 18:27:27 +0000 (11:27 -0700)
README.md
src/main/scala/SbtTapReporting.scala

index 380fd9e55ef1103ddd3ccbff36a4a2d04f2d3484..c0c6d9df3e5c89d3f9a31b9fed6bce33c3c5aaa5 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 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
index eb6eac44c42b34e8054ae779b6a91e248da5deaa..20b1130bbeab5ff6e9bda4f6b418bcb4a2183217 100644 (file)
@@ -25,6 +25,7 @@ class SbtTapListener extends TestsListener {
     val file = new File(filename)
     new File(file.getParent).mkdirs
     fileWriter = new FileWriter(file)
+    writeTap("TAP", "version", 13)
   }
 
   def startGroup(name: String) =
@@ -40,15 +41,16 @@ class SbtTapListener extends TestsListener {
 
   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)
       }
     }
   }
This page took 0.025469 seconds and 4 git commands to generate.