1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<!-- Documenting T:NAnt.NUnit1.Tasks.NUnitTask-->
5
<meta http-equiv="Content-Language" content="en-ca" />
6
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
<link rel="stylesheet" type="text/css" href="../style.css" />
8
<title><nunit> Task</title>
11
<table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
13
<td class="NavBar-Cell">
14
<a href="http://nant.sourceforge.net">
17
<img alt="->" src="../images/arrow.gif" />
18
<a href="../index.html">Help</a>
19
<img alt="->" src="../images/arrow.gif" />
20
<a href="../tasks/index.html">Task Reference</a>
21
<img alt="->" src="../images/arrow.gif" /> <nunit></td>
22
<td class="NavBar-Cell" align="right">
26
<h1><nunit></h1>
30
<p> Runs tests using the NUnit V1.0 framework. </p>
31
<p> See the <a href="http://nunit.sf.net">NUnit home page</a> for more information. </p>
32
<p> The <code>haltonfailure</code> or <code>haltonerror</code> attributes are only used to stop more than one test suite to stop running. If any test suite fails a build error will be thrown. Set <code>failonerror</code> to <b>false</b> to ignore test errors and continue build. </p>
38
<th style="text-align: center;">Type</th>
40
<th style="text-align: center;">Required</th>
43
<td valign="top">haltonerror</td>
44
<td style="text-align: center;">bool</td>
45
<td> Stops running tests when a test causes an error. The default is <b>false</b>. </td>
46
<td style="text-align: center;">False</td>
49
<td valign="top">haltonfailure</td>
50
<td style="text-align: center;">bool</td>
51
<td> Stops running tests if a test fails (errors are considered failures as well). The default is <b>false</b>. </td>
52
<td style="text-align: center;">False</td>
55
<td valign="top">timeout</td>
56
<td style="text-align: center;">int</td>
57
<td> Cancel the individual tests if they do not finish in the specified time (measured in milliseconds). Ignored if fork is disabled. </td>
58
<td style="text-align: center;">False</td>
61
<td valign="top">failonerror</td>
62
<td style="text-align: center;">bool</td>
63
<td> Determines if task failure stops the build, or is just reported. The default is <b>true</b>. </td>
64
<td style="text-align: center;">False</td>
67
<td valign="top">if</td>
68
<td style="text-align: center;">bool</td>
69
<td> If <b>true</b> then the task will be executed; otherwise, skipped. The default is <b>true</b>. </td>
70
<td style="text-align: center;">False</td>
73
<td valign="top">unless</td>
74
<td style="text-align: center;">bool</td>
75
<td> Opposite of <code>if</code>. If <b>false</b> then the task will be executed; otherwise, skipped. The default is <b>false</b>. </td>
76
<td style="text-align: center;">False</td>
79
<td valign="top">verbose</td>
80
<td style="text-align: center;">bool</td>
81
<td> Determines whether the task should report detailed build log messages. The default is <b>false</b>. </td>
82
<td style="text-align: center;">False</td>
86
<h3>Nested Elements:</h3>
88
<!--NestedElementArray=T:NAnt.NUnit1.Types.NUnitTest-->
94
<div class="nested-element"> Tests to run. <p> Represents a test element of an <a href="../tasks/nunit.html"><nunit></a> task. </p><h3>Parameters</h3><div class="table"><table><tr><th>Attribute</th><th style="text-align: center;">Type</th><th>Description</th><th style="text-align: center;">Required</th></tr><tr><td valign="top" class="required">assembly</td><td style="text-align: center;">string</td><td> Assembly to load the test from. </td><td style="text-align: center;">True</td></tr><tr><td valign="top" class="required">class</td><td style="text-align: center;">string</td><td> Class name of the test. </td><td style="text-align: center;">True</td></tr><tr><td valign="top">appconfig</td><td style="text-align: center;">string</td><td> The application configuration file to use for the NUnit test domain. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">fork</td><td style="text-align: center;">bool</td><td> Run the tests in a separate <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemAppDomainClassTopic.asp">AppDomain</a>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">haltonerror</td><td style="text-align: center;">bool</td><td> Stop the build process if an error occurs during the test run. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">haltonfailure</td><td style="text-align: center;">bool</td><td> Stop the build process if a test fails (errors are considered failures as well). </td><td style="text-align: center;">False</td></tr><tr><td valign="top">outfile</td><td style="text-align: center;">string</td><td> Base name of the test result. The full filename is determined by this attribute and the extension of formatter. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">todir</td><td style="text-align: center;">string</td><td> Directory to write the reports to. </td><td style="text-align: center;">False</td></tr></table></div></div>
101
<!--NestedElementArray=T:NAnt.NUnit.Types.FormatterElement-->
107
<div class="nested-element"> Formatters to output results of unit tests. <p> Represents the FormatterElement of the NUnit task. </p><h3>Parameters</h3><div class="table"><table><tr><th>Attribute</th><th style="text-align: center;">Type</th><th>Description</th><th style="text-align: center;">Required</th></tr><tr><td valign="top" class="required">type</td><td style="text-align: center;"><a href="../enums/NAnt.NUnit.Types.FormatterType.html">FormatterType</a></td><td> Type of formatter. </td><td style="text-align: center;">True</td></tr><tr><td valign="top">extension</td><td style="text-align: center;">string</td><td> Extension to append to the output filename. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">outputdir</td><td style="text-align: center;">directory</td><td> Specifies the directory where the output file should be written to, if <code>usefile</code> is <b>true</b>. If not specified, the output file will be written to the directory where the test module is located. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">usefile</td><td style="text-align: center;">bool</td><td> Determines whether output should be persisted to a file. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr></table></div></div>
114
<ul class="examples">
116
<p> Run tests in the <code>MyProject.Tests.dll</code> assembly. </p>
117
<p> The test results are logged in <code>results.xml</code> and <code>results.txt</code> using the <code>Xml</code> and <code>Plain</code> formatters, respectively. </p>
119
<nunit basedir="build" verbose="false" haltonerror="true" haltonfailure="true">
120
<formatter type="Xml" />
121
<formatter type="Plain" />
122
<test name="MyProject.Tests.AllTests" assembly="MyProject.Tests.dll" outfile="results"/>
127
<h3>Requirements</h3>
128
<div style="margin-left: 20px;">
129
<b>Assembly:</b> NAnt.NUnit1Tasks (0.90.3780.0)
b'\\ No newline at end of file'