-
Notifications
You must be signed in to change notification settings - Fork 3
Nunit task documentation
Run NUnit on a group of assemblies.
The following parameters are available for the NUnit task.
The assemblies to test. You may specify one or more assemblies or a single project file of type .nunit or .csproj/.vbproj.
Name of the test case, fixture or namespace to run.
Project configuration (e.g.: Debug) to load. Valid only when a project is specified (.nunit or .xxproj).
Name of XML output file (Default: TestResult.xml).
File to receive test error output.
Label each test in stdOut.
List of categories to include.
List of categories to exclude.
Process model for tests: Default, Single, Separate, Multiple
AppDomain Usage for tests: Default, None, Single, Multiple
Framework version to be used for tests. Ex.: net-2.0, net-3.5, mono-2.0
Disable shadow copy when running in separate domain
Enable use of a separate thread for tests (Default: true).
Set timeout for each test case in milliseconds.
Do not display progress
Uses the 32bit specific runner.
The path of the NUnit bin folder where are the console runners. If omitted the path where this task assembly is located is use (NUnit side-installation)
Specifies the exit code provided by NUnit.
Specifies the directory in which the NUnit runner will run.
The following example uses the NUnit task to test all unit tests in this project, at the end of the build, stopping if any of them fails. It assumes the NUnit binaries are installed in the ToolPath specified. You can also have the binaries in the same directory as the task assembly (Side-Installation) and avoid having to specify the ToolPath.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
...
<UsingTask AssemblyFile="..\NUnit\MSBuild.NUnit.dll" TaskName="MSBuild.Tasks.NUnit" />
<Target Name="RunUnitTest">
<NUnit Assemblies="$(ProjectName).csproj"
ToolPath="C:\Program Files (x86)\NUnit 2.5.5\bin\net-2.0"
DisableShadowCopy="true" Force32Bit="false" ProjectConfiguration="$(Configuration)" FrameworkToUse="net-3.5"
WorkingDirectory="$(ProjectDir)" ContinueOnError="false" />
</Target>
<Target Name="AfterBuild" DependsOnTargets="RunUnitTest">
</Target>
</Project>