NUnit3 Class | MSBuild Extension Pack Help 4.0.12.0 |
Executes Test Cases using NUnit (Tested using v3.0.5610.33199)
Inheritance Hierarchy
Microsoft.Build.UtilitiesToolTask
MSBuild.ExtensionPack.CodeQualityNUnit3
Namespace: MSBuild.ExtensionPack.CodeQuality
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0
The NUnit3 type exposes the following members.
Constructors
Name | Description | |
---|---|---|
NUnit3 |
Properties
Name | Description | |
---|---|---|
Assemblies |
Gets or sets the assemblies.
| |
Configuration |
Sets the Project configuration (e.g.: Debug) to load
| |
Domain |
DOMAIN isolation for test assemblies. Values: None, Single, Multiple. If not
specified, defaults to Separate for a single assembly or Multiple for more than one.
| |
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 type/version to use for tests. Examples: mono, net-3.5, v4.0, 2.0, mono-4.0.
If not specified, tests will run under the framework they are compiled with.
| |
Ignored |
Gets the Ignored count
| |
IncludeCategory |
Comma separated list of categories to include.
| |
Inconclusive |
Gets the Inconclusive count
| |
Invalid |
Gets the Invalid count
| |
Labels |
Specify whether to write test case names to the output. Values: Off, On, All
| |
NoShadow |
Disable shadow copy when running in separate domain. Default is false.
| |
NotRun |
Gets the NotRun count
| |
OutputFile |
File to receive test output
| |
OutputXmlFile |
Sets the OutputXmlFile name
| |
Process |
PROCESS isolation for test assemblies. Values: Single, Separate, Multiple. If not
specified, defaults to Separate for a single assembly or Multiple for more than one.
| |
Skipped |
Gets the Skipped count
| |
TeamCity |
Turns on use of TeamCity service messages.
| |
Test |
Name of the test case(s), fixture(s) or namespace(s) to run
| |
TestTimeout |
Set timeout for each test case in milliseconds
| |
Total |
Gets the Total count
| |
Use32Bit |
Run tests in an x86 process on 64 bit systems.
| |
Version |
The version of NUnit to run. Default is 3.0.5610
| |
WorkerThreads |
Number of worker threads to be used in running tests. If not specified, defaults to
2 or the number of processors, whichever is
greater.
|
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 3.0.5610\bin\net-4.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