Geeks With Blogs

Tim Huffam Dotting the I and crossing the T of I.T.

This requires a testrunconfig file that has been configured correctly.  To do this I did the following:

  1. In VS2008, right click on Solution Items folder and select Add - New Item...
  2. Select Test Run Configuration and enter the name WithCodeCoverage.testrunconfig.
  3. Open/edit this file in VS.
  4. Select the 'Code Coverage' item on the left, then selected (checked) the assemblies I wanted to instrument
  5. Click Apply to save these changes.

Note that you can select which is the active test run configuration from under the Test menu in VS2008.

Now we need to update the TFS build...

  1. Open your TFS build file (eg TFSBuild.proj)
  2. In the section starting with
    <PropertyGroup>
    <!--
    TEST ARGUMENTS...
    Add the following line (after the comments and before the closing of PropertyGroup):
    <RunConfigFile Condition=" '$(IsDesktopBuild)' != 'true' ">$(SolutionRoot)\DEV\Release1\Source\WithCodeCoverage.testrunconfig</RunConfigFile>
    (update accordingly to suit your build server paths).

That's it.  Queue a build to test - you may need to verify your server build paths to get it working (I did).

HTH
Tim

Posted on Tuesday, June 16, 2009 11:32 PM BizTalk , C# .NET , ASP.NET , Unit Testing , Dev Env, TFS, MSBuild etc | Back to top


Comments on this post: Turning on code coverage/instrumentation in a TFS Build

# re: Turning on code coverage/instrumentation in a TFS Build
Requesting Gravatar...
Thank you for posting.Waiting for updating.Cheap women brand Highheel shoes from China for wholesale
Left by Cheapbagshopping.com on Nov 25, 2011 7:53 AM

# re: Turning on code coverage/instrumentation in a TFS Build
Requesting Gravatar...
A few weeks ago, Used to do possibly not supply a lot thought to applying reactions utilizing world-wide-web assess content and put up secured creative ideas still a lot less. Taking a look at ones own awesome written text, could possibly arouse some others to perform this ordinarily.
Left by Nandroid Backup on Apr 10, 2012 4:44 PM

Your comment:
 (will show your gravatar)


Copyright © Tim Huffam | Powered by: GeeksWithBlogs.net