TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

TeamCity NUnit Test Launcher

Last modified: 20 April 2023

TeamCity provides its own NUnit tests launcher that can be used from command line. The tests are run according to the passed parameters and, if the process is run inside the TeamCity build agent environment, the results are reported to the TeamCity agent.

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

Category Expression



Beginning with NUnit 2.4.6 and up to but not including NUnit v3.0 , a Category Expression can be used. The table shows some examples:

Note: As shown by the last two examples, the comma operator (,) is equivalent to the pipe (|) but has a higher precendence. The order of evaluation is as follows:

  1. Unary exclusion operator (-)

  2. High-precendence union operator (,)

  3. Intersection and set subtraction operators (+ and binary -)

  4. Low-precedence union operator (|)

Note: Since the operator characters have special meaning, you should avoid creating a category that uses any of them in its name. For example, the category "db-tests" could not be used in the command line, as it appears to means "run category db, except for category tests." The same limitation applies to the characters having a special meaning for the shell you are using.

Examples

The following examples assume that the teamcity.dotnet.nunitlauncher property is set as a system property on the Parameters page of the Build Configuration.

Run tests from an assembly:

Run tests from an assembly with NUnit categories filter

Run tests from assemblies: