|
Documentation Index
|
.NET Testing Frameworks SupportIn order to support the real-time reporting test results, TeamCity should either run the tests using its own test runner or be able to interact with the testing frameworks so it receives notifications on test events. Custom TeamCity-aware test runners are used to implement the bundled support for the testing frameworks. The following frameworks are supported:
This section covers:
TeamCity 3.0TeamCity NUnit Test LauncherTeamCity uses its own NUnit tests launcher that can be used from the any runner. 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. The properties are available as both environment variables and system properties are available under any build process running on TeamCity, e.g. NAnt, MSBuild, Ant, SimpleRunner, etc. teamcity.dotnet.nunitlauncher1.1 - full launcher application name for .Net Framework 1.1, NUnit 2.2.8
Inside the build run by TeamCity the name of the NUnit launcher can be obtained through the system properties and environment variables. The command line syntax is as follows: %teamcity.dotnet.nunitlauncher<version>% MyAssemblyToTest1 MyAssemblyToTest2 The launcher can be used in the build script to run the tests. e.g. here is an example for NAnt script (as of TeamCity 3.0): <exec program="${teamcity.dotnet.nunitlauncher<version>}"> <arg file="MyAssemblyToTest.dll"/> <arg file="MyAssemblyToTest2.dll"/> </exec> NAnt RunnerTeamCity provides custom <nunit2> task implementation. TeamCity automatically replaces the original <nunit2> task with its own task, so if your build script uses the nunit2 task, it will automatically work without any modifications to the build script. MSBuild RunnerTeamCity provides custom NUnitTeamCity task and NUnit task that is compatible with NUnit task from MSBuild Community tasks project. <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <UsingTask TaskName="NUnit" AssemblyFile="$(teamcity_dotnet_nunitlauncher_msbuild_task)"/> <Target Name="SayHello"> <NUnit Assemblies="!!!*put here item group of assemblies to run tests on*!!!"/> </Target> </Project>
TeamCity 3.1NAnt RunnerSince TeamCity 3.1, the following options are supported for TeamCity <nunit2> task implementation:
TeamCity 3.1 also supports the NAnt 0.86 runner and the NUnit 2.4 testing framework. TeamCity NUnit test launcher will run tests in the .NET Framework, which is specified by NAnt target framework, i.e. on .NET Framework 1.1 or .NET Framework 2.0 runtime. TeamCity 3.1. also supports test categories for <nunit2> task.
MSBuild RunnerSince TeamCity 3.1, the NUnitTeamCity task supports extra attributes to the NUnitTeamCity task:
TeamCity NUnit LauncherThe property is available as both environment variables and system properties of the build system (NAnt, MSTest) TeamCity 3.1 is backward compatible to TeamCity 3.0, thus it still defines the set of properties teamcity.dotnet.nunitlauncher<version>, but now those properties are obsolete. The launcher supports the following command line options: ${teamcity.dotnet.nunitlauncher} [<.NET Framework>] [<platform>] [/category-include:<list>] [/category-exclude:<list>] [<NUnit vers.>] <assemblies to test>
where
See also:
|