How can I gather code coverage data from programs outside of my testing solution?

61 Views Asked by At

I am attempting to gather code coverage data for my automated tests. However, the testing framework we built is not a part of the same solution as our product and our tests have no direct references to our product's code.

Because of this, I am worried that simply turning on code coverage in vstest will not be sufficient to see what code was executed in the product.

How can I include separate executables in the code coverage data?

The paths I am currently trying to pursue:

  • Include the path to our product's .pdb files in the .runsettings file and things just magically work
  • Use another tool that gathers code coverage, such as vsperfmon, to gather code coverage data of our product for the duration of the test run
1

There are 1 best solutions below

0
On

After further research (and some trial and error) I learned that my fears were unfounded.

Including the path to the compiled code for your application under test (and symbols files) works fine out of the box.

You just need to add them using the Include tag in a .runsettings file as documented in this article.