TeamCity 5.0 Help

TeamCity NUnit Test Launcher

TeamCity provides its own NUnit tests launcher that can be used from any runner, e.g. MSBuild, NAnt, Rake, etc. The tests are run according to the passed parameters and if the process is run inside TeamCity build agent environment, the results are reported to the TeamCity agent.

You can pass to the TeamCity NUnit Test Launcher the following command line options:

${teamcity.dotnet.nunitlauncher} <.NET Framework> <platform> <NUnit vers.> [/category-include:<list>] [/category-exclude:<list>] [/addin:<list>] <assemblies to test>

Option

Description

<.NET Framework>

Version of .NET Framework to run tests. Acceptable values are v1.1, v2.0, v4.0(since TeamCity 5.1) or ANY.

<platform>

Platform to run tests. Acceptable values are x86, x64 and MSIL.

<NUnit vers.>

Test framework to use. The value has to be specified in the following format: NUnit-<version>, where <version> can be one of the following: 2.2.10, 2.4.1, 2.4.6, 2.4.7, 2.4.8, 2.5.0, 2.5.2, 2.5.3, and 2.5.4.

/category-include:<list>

The list of categories separated by ';' (optional).

/category-exclude:<list>

The list of categories separated by ';' (optional).

/addin:<list>

List of third-party NUnit addins to use (optional).

<assemblies to test>

List of assemblies paths separated by ';' or space.

/runAssemblies:processPerAssembly

Specify, if you want to run each assembly in a new process. Since TeamCity 5.1

Examples

The following examples assume that the teamcity.dotnet.nunitlauncher property is set as system property on the 6.Properties and environment variables page of the Build Configuration.

Run tests from an assembly:

%teamcity.dotnet.nunitlauncher% v2.0 x64 NUnit-2.2.10 Assembly.dll

Run tests from an assembly with NUnit categories filter

%teamcity.dotnet.nunitlauncher% v2.0 x64 NUnit-2.2.10 /category-include:C1 /category-exclude:C2 Assembly.dll

Run tests from assemblies:

%teamcity.dotnet.nunitlauncher% v2.0 x64 NUnit-2.5.0 /addin:Addin1.dll;Addin2.dll Assembly.dll Assebly2.dll

Last modified: 20 April 2023