Daniel Palme

Daniel Palme

.NET consultant from Germany.

Blog > ReportGenerator - New release with coverage by test support

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.


Subscribe to RSS Feed

 

Related posts

 

New comment

:

:

:

:

 

Comments

#1
Ingmar

Ingmar

01/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?
 
#2
Daniel

Daniel

01/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.
 
#3
Arpeet Jain

Arpeet Jain

04/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
 
#4
Daniel

Daniel

04/27/2017

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

Premjeet

05/04/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?