Daniel Palme

Daniel Palme

.NET consultant from Germany.

Blog > ReportGenerator - New release with more advanced report preprocessing

ReportGenerator - New release with more advanced report preprocessing

ReportGenerator 1.3.0.0 has just been published. The new release offers some new features which I want do describe in this post.

Improved report preprocessing

The coverage reports generated by OpenCover/PartCover don't contain enough information to map every property/method to the corresponding source file.
For example auto properties are not mapped to a file. When a class contains only auto properties (e.g. a DTO), ReportGenerator was not able to map the class to the corresponding file and produced a report like this:

MissingFile

When the class contained at least one regular method, I was able to locate the auto properties in the corresponding file.
The new release now is able to locate the file, even if no other method is present. ReportGenerator searches the source directory for class files and locates the auto properties by using the NRefactory library.

In some cases ReportGenerator is not able to figure out the file. But you are able to supply one or more additional directories where ReportGenerator should look for the desired source files.
This can be done with the new command line argument: -sourcedirs.
The report will then look like expected:

After Preprocessing

Filtering assemblies

With the new release you are able to filter the assemblies that appear in the report. By specifying the command line argument -filters, assemblies could be included or excluded.
E.g. the following filter includes all assemblies that start with "MyAssembly.Include" but omits assemblies starting with "Exclude":

-filters:+MyAssembly.Include*;-Exclude*

Conclusion

I hope you like the new features. Feedback is always appreciated. Get the latest release on Codeplex.


Subscribe to RSS Feed

 

Related posts

 

New comment

:

:

:

:

 

Comments

#1
Lemuel

Lemuel

03/28/2014

I love this report generator!

Thanks so much.
 
#2
Abudhakeer

Abudhakeer

04/30/2014

How to filter specific class in a test assembly? Is there any way to achieve this? Please asap!
 
#3
Daniel

Daniel

04/30/2014

@Abudhakeer:
No, you can only filter full assemblies. When you are using OpenCover you can ignore classes by applying an attribute to that class.
 
#4
Abudhakeer

Abudhakeer

04/30/2014

Thank you for your reply! But i am using covearge xml generated by visual studio. Is there any other work around?

One more thing, will i be able to get the coverage with respect to the source code rather than the report produced by the open cover which is with respect to test method i mean unit tests.
 
#5
Daniel

Daniel

04/30/2014

@Abudhakeer:
No there is no other way. But why do you want to do that?

I'm not sure if understand your second question. ReportGenerator reports are always based on the source code. It doesn't matter which coverage tool you are using. IMHO OpenCover provides the best results.
 
#6
Abudhakeer

Abudhakeer

04/30/2014

Please refer this link http://stackoverflow.com/questions/23385191/coverage-report-using-opencover
 
#7
Abudhakeer

Abudhakeer

05/25/2014

Is it possible to get lines coverage for reports generated using visual studio?
 
#8
Abudhakeer

Abudhakeer

05/25/2014

One more thing is it possible to filter out 'std::' and other libraries in report generator? If yes how? If not is there any other work around?
 
#9
Daniel

Daniel

05/26/2014

@Abudhakeer:
Yes you can create reports based on Visual Studio? Please have a look here: https://reportgenerator.codeplex.com/wikipage?title=Visual%20Studio%20Coverage%20Tools

Filtering is only possible for assemblies.
 
#10
Abudhakeer

Abudhakeer

05/26/2014

Yeah i knew it currently i am able to get only blocks covered if i drill down to each class, here will i be able to see the lines covered instead of block coverage?