NUnit Class | MSBuild Extension Pack Help 4.0.12.0 |
Executes Test Cases using NUnit (Tested using v2.6.2)
Inheritance Hierarchy
Microsoft.Build.UtilitiesToolTask
MSBuild.ExtensionPack.CodeQualityNUnit
Namespace: MSBuild.ExtensionPack.CodeQuality
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0
The NUnit type exposes the following members.
Constructors
Name | Description | |
---|---|---|
NUnit |
Properties
Name | Description | |
---|---|---|
Assemblies |
Gets or sets the assemblies.
| |
Configuration |
Sets the Project configuration (e.g.: Debug) to load
| |
Domain |
AppDomain Usage for tests. Supports None, Single, Multiple. The default is to use multiple domains if multiple assemblies are listed on the command line. Otherwise a single domain is used.
| |
ErrorOutputFile |
Sets the File to receive test error output
| |
Errors |
Gets the Errors count
| |
ExcludeCategory |
Comma separated list of categories to exclude.
| |
FailOnFailures |
Set to true to fail the task if this.Failures > 0. Helps for batching purposes. Default is false.
| |
Failures |
Gets the Failures count
| |
Framework |
Framework version to be used for tests
| |
Ignored |
Gets the Ignored count
| |
IncludeCategory |
Comma separated list of categories to include.
| |
Inconclusive |
Gets the Inconclusive count
| |
Invalid |
Gets the Invalid count
| |
Labels |
Label each test in stdOut. Default is false.
| |
NoShadow |
Disable shadow copy when running in separate domain. Default is false.
| |
NoThread |
Disable use of a separate thread for tests. Default is false.
| |
NotRun |
Gets the NotRun count
| |
OutputFile |
File to receive test output
| |
OutputXmlFile |
Sets the OutputXmlFile name
| |
Process |
Process model for tests. Supports Single, Separate, Multiple. Single is the Default
| |
Run |
Name of the test case(s), fixture(s) or namespace(s) to run
| |
Skipped |
Gets the Skipped count
| |
TestTimeout |
Set timeout for each test case in milliseconds
| |
Total |
Gets the Total count
| |
Use32Bit |
Set to true to run nunit-console-x86.exe
| |
Version |
The version of NUnit to run. Default is 2.6.2
|
Examples
<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath> <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath> </PropertyGroup> <Import Project="$(TPath)"/> <PropertyGroup> <ToolPath>D:\Program Files (x86)\NUnit 2.5.7\bin\net-2.0</ToolPath> </PropertyGroup> <Target Name="Default"> <ItemGroup> <Assemblies Include="d:\a\*.dll"/> </ItemGroup> <!-- Run an NUnit Project --> <MSBuild.ExtensionPack.CodeQuality.NUnit Assemblies="d:\a\Project1.nunit" ToolPath="$(ToolPath)"> <Output TaskParameter="Total" PropertyName="ResultTotal"/> <Output TaskParameter="NotRun" PropertyName="ResultNotRun"/> <Output TaskParameter="Failures" PropertyName="ResultFailures"/> <Output TaskParameter="Errors" PropertyName="ResultErrors"/> <Output TaskParameter="Inconclusive" PropertyName="ResultInconclusive"/> <Output TaskParameter="Ignored" PropertyName="ResultIgnored"/> <Output TaskParameter="Skipped" PropertyName="ResultSkipped"/> <Output TaskParameter="Invalid" PropertyName="ResultInvalid"/> </MSBuild.ExtensionPack.CodeQuality.NUnit> <Message Text="ResultTotal: $(ResultTotal)"/> <Message Text="ResultNotRun: $(ResultNotRun)"/> <Message Text="ResultFailures: $(ResultFailures)"/> <Message Text="ResultErrors: $(ResultErrors)"/> <Message Text="ResultInconclusive: $(ResultInconclusive)"/> <Message Text="ResultIgnored: $(ResultIgnored)"/> <Message Text="ResultSkipped: $(ResultSkipped)"/> <Message Text="ResultInvalid: $(ResultInvalid)"/> <!--- Run NUnit over a collection of assemblies --> <MSBuild.ExtensionPack.CodeQuality.NUnit Assemblies="@(Assemblies)" ToolPath="$(ToolPath)" OutputXmlFile="D:\a\NunitResults2.xml"> <Output TaskParameter="Total" PropertyName="ResultTotal"/> <Output TaskParameter="NotRun" PropertyName="ResultNotRun"/> <Output TaskParameter="Failures" PropertyName="ResultFailures"/> <Output TaskParameter="Errors" PropertyName="ResultErrors"/> <Output TaskParameter="Inconclusive" PropertyName="ResultInconclusive"/> <Output TaskParameter="Ignored" PropertyName="ResultIgnored"/> <Output TaskParameter="Skipped" PropertyName="ResultSkipped"/> <Output TaskParameter="Invalid" PropertyName="ResultInvalid"/> </MSBuild.ExtensionPack.CodeQuality.NUnit> <Message Text="ResultTotal: $(ResultTotal)"/> <Message Text="ResultNotRun: $(ResultNotRun)"/> <Message Text="ResultFailures: $(ResultFailures)"/> <Message Text="ResultErrors: $(ResultErrors)"/> <Message Text="ResultInconclusive: $(ResultInconclusive)"/> <Message Text="ResultIgnored: $(ResultIgnored)"/> <Message Text="ResultSkipped: $(ResultSkipped)"/> <Message Text="ResultInvalid: $(ResultInvalid)"/> </Target> </Project>
See Also