]> Dogcows Code - chaz/sbt-tap/blob - README.md
remove unused import
[chaz/sbt-tap] / README.md
1 This sbt plug-in provides reporting of test success and failure for tests run by
2 [simple build tool](https://github.com/sbt/sbt)
3 in [TAP](http://search.cpan.org/perldoc?TAP%3A%3AParser%3A%3AGrammar) format.
4
5 All the test results will be generated in one file, the path of which may be
6 specified in the `SBT_TAP_OUTPUT` environment variable. If unspecified in the
7 environment, the output file path defaults to `test-results/test.tap`.
8
9 To use:
10
11 1. Add this plug-in to your sbt project by creating a file
12 `project/project/Plugins.scala` that looks something like this:
13
14 ```scala
15 import sbt._
16 // sets up other project dependencies when building our root project
17 object Plugins extends Build {
18 lazy val root = Project("root", file(".")) dependsOn(tapListener)
19 lazy val tapListener = RootProject(uri("git://github.com/mkhettry/sbt-tap.git"))
20 }
21 ```
22
23 2. In your `build.sbt` file, add the `SbtTapListener` to the sequence of test
24 listeners.
25
26 ```scala
27 testListeners += SbtTapReporting()
28 ```
29
30 3. Optionally, in a UNIX environment, you can set up a named pipe for
31 collecting the TAP report, for your test harness.
32
33 ```sh
34 #!/bin/sh
35
36 pipe="$PWD/test.tap" # set where to make the pipe
37
38 rm -f "$pipe" # clear the path for the new pipe
39 mkfifo "$pipe" # make the pipe
40 cat "$pipe" & # redirect the report to stdout
41
42 SBT_TAP_OUTPUT="$pipe" sbt test 2>&1 >/dev/null
43
44 rm -f "$pipe" # all done - remove the pipe
45 ```
This page took 0.030181 seconds and 4 git commands to generate.