Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The method to combine multiple code coverage files for dotnet tests is as follows:

  1. Generate the code coverage files for each test project by running the tests with the "--collect:Code Coverage" option.

  2. Use the "dotnet test" command to combine the code coverage files for all test projects. You can do this by specifying the "-- DataCollectorRunSettings.DataCollectors.DataCollector.Configuration.Format" option with the value "cobertura".

  3. After running the "dotnet test" command, a "coverage.cobertura.xml" file will be generated in each test project folder.

  4. Use a code coverage tool like "OpenCover" or "Coverlet" to merge the "coverage.cobertura.xml" files into a single report.