Skip to content

ReportGenerator converts XML reports generated by OpenCover, PartCover, dotCover, Visual Studio, NCover or Cobertura into human readable reports in various formats.

License

Notifications You must be signed in to change notification settings

sstragier/ReportGenerator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

ReportGenerator

ReportGenerator converts XML reports generated by OpenCover, dotCover, Visual Studio, NCover or Cobertura into human readable reports in various formats.

The reports do not only show the coverage quota, but also include the source code and visualize which lines have been covered.

ReportGenerator supports merging several reports into one. It is also possible to pass one XML file containing several reports to ReportGenerator (e.g. a build log file).

The following output formats are supported by ReportGenerator (Download sample reports):

  • HTML, HTMLSummary, HTMLInline, HTMLChart, MHTML
  • Cobertura
  • XML, XMLSummary
  • Latex, LatexSummary
  • TextSummary
  • CsvSummary
  • Badges
  • Custom reports

Compatibility:

Additional information about ReportGenerator can be found under Resources.

Author: Daniel Palme
Blog: www.palmmedia.de
Twitter: @danielpalme

Screenshots

The screenshots show two snippets of the generated reports: Screenshot 1 Screenshot 2

Badges

Badges in SVG and PNG format can be generated if -reporttypes:Badges is used:

Sample badge

Usage

ReportGenerator is a commandline tool which works with full .NET Framework and .NET Core.
Use the online configuration tool to get started quickly.

ReportGenerator requires the following parameters:

Parameters:
    ["]-reports:<report>[;<report>][;<report>]["]
    ["]-targetdir:<target directory>["]
    [["]-reporttypes:<Html|HtmlSummary|...>[;<Html|HtmlSummary|...>]["]]
    [["]-historydir:<history directory>["]]
    [["]-assemblyfilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]
    [["]-classfilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]
    [["]-filefilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]
    [["]-verbosity:<Verbose|Info|Warning|Error|Off>["]]
    [["]-tag:<tag>["]]

Explanations:
   Reports:           The coverage reports that should be parsed (separated by 
                      semicolon). Wildcards are allowed.
   Targetdirectory:   The directory where the generated report should be saved.
   Reporttypes:       The output formats and scope (separated by semicolon).
                      Values: Badges, Cobertura, CsvSummary, Html, HtmlChart, HtmlSummary, Latex, LatexSummary, MHtml,
                              PngChart, TextSummary, Xml, XmlSummary
   History directory: Optional directory for storing persistent coverage information.
                      Can be used in future reports to show coverage evolution.
   Assembly Filters:  Optional list of assemblies that should be included or excluded in the report.
   Class Filters:     Optional list of classes that should be included or excluded in the report.
   File Filters:      Optional list of files that should be included or excluded in the report.
                      Exclusion filters take precedence over inclusion filters.                      
                      Wildcards are allowed.
   Verbosity:         The verbosity level of the log messages.
                      Values: Verbose, Info, Warning, Error, Off
   Tag:               Optional tag or build version.

Default values:
   -reporttypes:Html
   -assemblyfilters:+*
   -classfilters:+*
   -filefilters:+*
   -verbosity:Verbose

Examples:
   "-reports:coverage.xml" "-targetdir:C:\report"
   "-reports:target\*\*.xml" "-targetdir:C:\report" -reporttypes:Latex;HtmlSummary -tag:v1.4.5
   "-reports:coverage1.xml;coverage2.xml" "-targetdir:report"
   "-reports:coverage.xml" "-targetdir:C:\report" "-assemblyfilters:+Included;-Excluded.*"

Available packages

Package Platfoms Installation/Usage
ReportGenerator .NET Core 2.0
.NET Framework 4.7
Use this package if your project is based on .NET Framework or .NET Core and you want to use ReportGenerator via the command line or a build script.

Usage
$(UserProfile)\.nuget\packages\reportgenerator\x.y.z\tools\net47\ReportGenerator.exe [options]

dotnet $(UserProfile).nuget\packages\reportgenerator\x.y.z\tools\netcoreapp2.0\ReportGenerator.dll [options]
dotnet-reportgenerator-cli .NET Core 2.0 Use this package if your project is based on .NET Core and you want to use ReportGenerator as a 'DotnetCliTool'.

Installation
Add <DotNetCliToolReference Include="dotnet-reportgenerator-cli" Version="x.y.z" /> to your project file.

Usage
dotnet reportgenerator [options]
dotnet-reportgenerator-globaltool .NET Core 2.1 Use this package if your project is based on .NET Core and you want to use ReportGenerator as a (global) 'DotnetTool'.

Installation
dotnet tool install -g dotnet-reportgenerator-globaltool
dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools

Usage
reportgenerator [options]
tools\reportgenerator.exe [options]
ReportGenerator.Core .NET Standard 2.0 Use this package if you want to write a custom plugin for ReportGenerator or if you want to call/execute ReportGenerator within your code base.

Plugin development
Custom reports
Custom history storage

MSBuild
A MSBuild task also exists:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Coverage" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <UsingTask TaskName="ReportGenerator" AssemblyFile="ReportGenerator.exe" />
  <ItemGroup>
    <CoverageFiles Include="OpenCover.xml" />
  </ItemGroup>
  <Target Name="Coverage">
    <ReportGenerator ReportFiles="@(CoverageFiles)" TargetDirectory="report" ReportTypes="Html;Latex" HistoryDirectory="history" AssemblyFilters="+Include;-Excluded" VerbosityLevel="Verbose" />
  </Target>
</Project>

AxoCover
With the Visual Studio Plugin AxoCover you can get good test integration and you are able to generate a HTML report with a single click: Download in Visual Studio Marketplace

Resources

About

ReportGenerator converts XML reports generated by OpenCover, PartCover, dotCover, Visual Studio, NCover or Cobertura into human readable reports in various formats.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 89.3%
  • JavaScript 6.6%
  • CSS 2.2%
  • PowerShell 1.0%
  • F# 0.4%
  • Java 0.3%
  • Batchfile 0.2%