1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt-doc.git synced 2025-04-25 03:57:11 -07:00

Document tests.

This commit is contained in:
Cedric Beust 2016-02-20 11:27:40 -08:00
parent 888360381d
commit 08b3d95ea4

View file

@ -589,7 +589,43 @@ New versions found:
</tr>
</table>
<h2 class="section" id="testing">Testing</h2>
<p>
Kobalt automatically detects how to run your tests based on the test dependencies that you declared:
</p>
<pre class="brush:java">
dependenciesTest {
compile("org.testng:testng:6.9.9")
}</pre>
<p>
By default, Kobalt supports TestNG, JUnit and Spek. You can also configure how your tests run
with the <code>test{}</code> directive:
</p>
<pre class="brush:java">
test {
args("-excludegroups", "broken", "src/test/resources/testng.xml")
}</pre>
<p>
The full list of configuration parameters can be found in the <a href="https://github.com/cbeust/kobalt/blob/master/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TestDirective.kt#L6">TestConfig</a> class.
</p>
<p>
Additionally, you can define multiple test configurations, each with a different name. Each
configuration will create an additional task named <code>"test"</code> followed by the name of
that configuration. For example:
</p>
<pre>
test {
args("-excludegroups", "broken", "src/test/resources/testng.xml")
}
test {
name = "All"
args("src/test/resources/testng.xml")
}</pre>
<p>
The first configuration has no name, so it will be launched with the task <code>"test"</code>,
while the second one can be run with the task <code>"testAll"</code>.
</p>
<h2 class="section" id="publishing">Publishing</h2>
<p>