ReportGenerator - New release with coverage by test support

 

Since my last blog post about ReportGenerator a couple of features have been added. In this post I will describe the most important changes.

Apart from reduced memory usage and the possibility to generate several output formats at once, the top three new features are:

Wildcards in report file pattern

Wildcards are now supported in report file pattern. This means you don't have to specify every coverage file separately. E.g.

-reports:SomeDirectory\*\target\Coverage.xml

Support for Visual Studio coverage reports

Apart from OpenCover, PartCover and NCover the Visual Studio coverage format is now supported. Code coverage in Visual Studio can be enabled if you follow these instructions. After executing the tests you can export the coverage results and run ReportGenerator with the coverage file.

coverbytest support of OpenCover

When OpenCover is executed with the -coverbytest command line argument, OpenCover tracks the coverage by unit test.
That helps you to identify the code that was covered by a specific test.
It also helps you to find code that was covered by "accident", i.e. if a test should cover component A but also covers component B (because A uses B) you are able to check whether a specific test for B also exists (otherwise you probably did an integration test not an unit test).
ReportGenerator now helps you to visualize the coverage by test method. If a class is covered by several tests you will notice the "Test methods" element on the right. If you select an other test the report is updated with the coverage information of that test.

Coverage by test method

Conclusion

Have fun with the new features. The latest release can be found on Codeplex.

Feedly Feedly Tweet


Related posts


Comments


Durai

Durai

8/3/2023

I am planning to merge multiple repo code coverage to show overall report. So I planned to create release pipeline to pull all repos build artifact that has code coverage files for the individual repos. I can able to read each repo code coverage now. Is there way to use already generated report in reportGenerator task to combine it?


Premjeet

Premjeet

5/4/2017

Hello Daniel, I want to add "Customer Name " field in the report but I am not familiar with .NET. Can you please suggest me what source code should i add and to which file of Report Generator?


Daniel

Daniel

4/27/2017

@Arpeet Yes you can create custom reports: https://github.com/danielpalme/ReportGenerator/wiki/Custom-reports


Arpeet Jain

Arpeet Jain

4/27/2017

I want to add some more information about my project into the test report generated by ReportGenerator in visual studio. Is their any way to customize the test report? Thanks


Daniel

Daniel

1/15/2013

@Ingmar: Are you talking about the "Visual Studio coverage reports"? Could you please provide me the coverage file? You could also use OpenCover but it should also work with Visual Studio coverage directly.


Ingmar

Ingmar

1/15/2013

I tried to get it working with a .coverage file created by our build server running TFS/VS 2012 Update 1. I receive an error Error during reading report 'C:\bin\1.coverage': Data at the root level is invalid. Line 1, position 1. So I still need opencover for transforming to XML?