Can a Microsoft code coverage tool generate an XML file as a report format?

The Microsoft Code Coverage Tool (vsinstr.exe) creates a binary for reading in Visual Studio. Can it also generate an XML file?

+4
source share
3 answers

Minor correction: vsinstr.exe is a tool used to process binary code to cover code (or profiling). VSPerfMon.exe is a code coverage monitor that actually writes a binary .coverage file to disk.

Inside the IDE, in the Code Coverage Results tool window, you can click Export Results to export the coverage data in XML format:

Code coverage XML export.

VS2010 does not have a command line utility for dump.coverage files in XML, however you can use the code coverage API to do it yourself. See this blog post (and Peter’s blog as a whole ) and CoverageDS.ExportXml for this.

The coverage XML file contains summary data similar to what you see in the VS user interface. If you need more specific coverage information (for example, information about each block), you can use the code coverage API to get it.

+6
source

You can also generate XML from the command line using this:
http://blogs.msdn.com/b/ms_joc/archive/2005/04/08/406608.aspx

+2
source

As far as I know, the version of Visual Studio supports the export of coverage in the command line natively.

You can use the CoverageInfo and CoverageDS objects in a separate Visual Studio project to convert the file to xml format before creating a report.

You can refer to this answer: fooobar.com/questions/1215827 / ... based on this snip2code snippet

+1
source

Source: https://habr.com/ru/post/1338935/


All Articles