Share via


TestToolsTask Task

The TestToolsTask task runs the test for an end-to-end build or for a desktop build. Set a desktop build type by setting the property IsDesktopBuild to true.

TestToolsTask task is defined in Microsoft.TeamFoundation.Build.targets file as a part of the RunTestWithConfiguration target. It is stored in the <root>:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild folder on the Team Foundation Build server.

Parameters

Property Description

Condition

Optional String parameter.

Boolean expression that the MSBuild engine uses to determine whether this task will be executed. For information, see MSBuild Conditions.

BuildFlavor

Specifies the build configuration. For example, Debug.

Defined for end-to-end build only.

Platform

Specifies the platform. For example, x86 or Any CPU.

Defined for end-to-end (not desktop) build only.

PublishServer

Specifies the Team Foundation Server URL.

Defined for end-to-end build only.

PublishBuild

Specifies the build number for the build.

Defined for end-to-end build only.

SearchPathRoot

Specifies the search path for test files.

Defined for end-to-end and desktop builds.

PathToResultsFilesRoot

Specifies where test results get uploaded.

Defined for end-to-end and desktop builds.

MetaDataFile

Specifies the test metadata file. This file contains test lists and links to tests. For more information about test lists, see Using Test Lists. Test metadata files have the extension .vsmdi.

Defined for end-to-end and desktop builds.

RunConfigFile

Specifies the test configuration file. These files configure the way tests are run. For more information, see Configuring Test Execution. Test run configuration files have the extension .testrunconfig.

Defined for end-to-end and desktop builds.

TestLists

Specifies the test list that is contained in the test metadata file.

Defined for end-to-end and desktop builds.

TeamProject

Specifies the team project name. The team project name is generally defined by the New Team Build Type Creation Wizard. You can also specify a different name in the TfsBuild.proj file by modifying the TeamProject property.

Defined for end-to-end build only.

Remarks

The Microsoft.TeamFoundation.Build.targets file contains an instance of the TestToolsTask task that Team Foundation Build uses as a default implementation for the RunTestWithConfiguration target.

Microsoft.TeamFoundation.Build.targets file is stored in the <root>:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild folder on the Team Foundation Build server.

Example

The following XML describes the instance of TestToolsTask in the Microsoft.TeamFoundation.Build.targets file that is used for an end-to-end build.

<TestToolsTask
          Condition=" '$(IsDesktopBuild)'!='true' and '%(MetaDataFile.Identity)'!=''"
          BuildFlavor="$(Flavor)"
          Platform="$(Platform)"
          PublishServer="$(TeamFoundationServerUrl)"
          PublishBuild="$(BuildNumber)"
          SearchPathRoot="$(SearchPathRoot)"
          PathToResultsFilesRoot="$(TestResultsRoot)"
          MetaDataFile="%(MetaDataFile.Identity)"
          RunConfigFile="$(RunConfigFile)"
          TestLists="%(MetaDataFile.TestList)"
          TeamProject="$(TeamProject)"
          ContinueOnError="true" />

The following XML describes the instance of TestToolsTask in the Microsoft.TeamFoundation.Build.targets file that is used for a desktop build.

<TestToolsTask
          Condition=" '$(IsDesktopBuild)'!='false' and '%(MetaDataFile.Identity)'!=''"
          SearchPathRoot="$(SearchPathRoot)"
          PathToResultsFilesRoot="$(TestResultsRoot)"
          MetaDataFile="%(MetaDataFile.Identity)"
          RunConfigFile="$(RunConfigFile)"
          TestLists="%(MetaDataFile.TestList)"
          ContinueOnError="true" />

See Also

Tasks

How to: Configure and Run Build Verification Tests (BVTs)
How to: Customize Build Numbers
How to: Configure Tests with Build Types

Concepts

Team Foundation Build Tasks

Other Resources

Customizing Team Foundation Build
Team Foundation Build Targets, Tasks, and Properties