NAnt
![]() ![]() ![]() |
v0.85 |
[This is preliminary documentation and subject to change.]
(Deprecated)
Runs tests using the NUnit V1.0 framework.
See the NUnit home page for more information.
The haltonfailure
or haltonerror
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 failonerror
to false to ignore test errors and continue build.
Attribute | Type | Description | Required |
---|---|---|---|
haltonerror | bool | Stops running tests when a test causes an error. The default is false. | False |
haltonfailure | bool | Stops running tests if a test fails (errors are considered failures as well). The default is false. | False |
timeout | int | Cancel the individual tests if they do not finish in the specified time (measured in milliseconds). Ignored if fork is disabled. | False |
failonerror | bool | Determines if task failure stops the build, or is just reported. The default is true. | False |
if | bool | If true then the task will be executed; otherwise, skipped. The default is true. | False |
unless | bool | Opposite of if . If false then the task will be executed; otherwise, skipped. The default is false. |
False |
verbose | bool | Determines whether the task should report detailed build log messages. The default is false. | False |
Contains a strongly typed collection of NUnitTest objects.
Contains a strongly typed collection of FormatterElement objects.
Run tests in the MyProject.Tests.dll
assembly.
The test results are logged in results.xml
and results.txt
using the Xml
and Plain
formatters, respectively.
<nunit basedir="build" verbose="false" haltonerror="true" haltonfailure="true"> <formatter type="Xml" /> <formatter type="Plain" /> <test name="MyProject.Tests.AllTests" assembly="MyProject.Tests.dll" outfile="results"/> </nunit>