Enable code coverage in VS 2010

This may seem a little silly, but I can't find the answer like this:
My team just switched to VS2010, and we would like to enable code coverage. All the instructions I found indicate to open the Local.testsettings file and go to the Execution Criteria tab.
Well, I do not have this tab, and I have VS2010 final, which should support code coverage.

Help me please:)

Noah

+7
source share
5 answers

Your Exlorer solution should have a folder with solution elements. Double-click the Local.testsettings file.

A new window will appear. There is a list to choose from. Entries such as General, Roles, etc.

Select the "Data and Diagnostics" entry. There you can enable code coverage.

+7
source

Screenshot for the Test Settings Dialog

Do not forget about the "Configure" button !!!

  • Select Test/Edit Test settings/your active settings/

  • Select the Data & Diagnostics tab.

  • Select the line Code Coverage

  • Check Enabled

  • Click the small Customize symbol on top of the grid.

  • Check all the builds that you want to get code coverage information from ...

+12
source

Just to summarize:

Your solution browser should have a Solution Items folder, which should contain the Local.testsettings file. Double click on it, go to Data and Diagnostics in the window that opens, enable Code Coverage . Then click the Configure button and check the builds for which you want to use Code Coverage. Apply your settings, now Code Coverage should work.

If you do not have a Solution Items folder or if you do not have a Local.testsettings file, you can simply create a new Test Project . He will create Local.testsettings . You can delete a new test project if you do not need it.

+2
source

Here are the steps for VS 2010 Ultimate

  • Double-click Local.Testsettings
  • Go to the "Data and Diagnostics" tab
  • Check code coverage
  • Double-click on this line of code coverage.
  • Select dll to check code coverage for
  • Click "Apply" and "Close"
+1
source

If you cannot find the local.testsettings file, you can create a new one.

Just create a new test project, then delete it - then you should have a Solution Items project folder with the Local.testsettings and TraceAndTestImpact.testsettings and vsmdi .

0
source

All Articles