Ask Your Question
0

What is the method to combine multiple code coverage files for dotnet tests?

asked 2023-07-14 09:14:54 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-07-14 09:36:02 +0000

lakamha gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-14 09:14:54 +0000

Seen: 13 times

Last updated: Jul 14 '23