Primary Purpose:
ReportGenerator is a versatile tool designed to convert code coverage reports from various sources into clear, human-readable formats. It supports inputs from tools like coverlet, OpenCover, dotCover, and more, providing outputs in HTML, Markdown, and other formats.
Key Features:
Multi-source Support: Converts reports from coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov, or lcov.
Diverse Output Formats: Generates reports in HTML, Markdown, CSV, XML, and other formats for comprehensive coverage insights.
Report Merging: Combines multiple coverage files into a single report, offering a consolidated view of code coverage.
Source Code Visualization: Highlights covered lines in source code, aiding developers in identifying areas needing more testing.
Customization Options: Supports plugins for custom reports or history storage, allowing tailored solutions for specific needs.
Audience & Benefits:
Ideal for developers, QA teams, and project managers seeking to enhance their understanding of test effectiveness. ReportGenerator aids in improving test coverage by providing clear insights, facilitating better decision-making. Its support for integration into CI/CD pipelines streamlines workflow processes, fostering team collaboration and efficiency.
Installation Note:
Available via winget, with the x64 version automatically installing .NET 10 Runtime. Users preferring to avoid newer runtimes can opt for the x86 version using "-a x86", ensuring compatibility without unnecessary dependencies.
With ReportGenerator, teams gain a powerful tool to visualize and optimize code coverage, enhancing software quality and project outcomes.
README
ReportGenerator
Powerful code coverage visualization
ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov, or lcov into human readable reports in various formats.
The reports show the coverage quotas and also visualize which lines of your source code have been covered.
ReportGenerator supports merging several coverage files into a single report.
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.Usagedotnet $(UserProfile).nuget\packages\reportgenerator\x.y.z\tools\net8.0\ReportGenerator.dll [options]``````$(UserProfile).nuget\packages\reportgenerator\x.y.z\tools\net10.0\ReportGenerator.exe [options]``````$(UserProfile)\.nuget\packages\reportgenerator\x.y.z\tools\net47\ReportGenerator.exe [options]
Use this package if your project is based on .NET Core and you want to use ReportGenerator as a (global) 'DotnetTool'.Installationdotnet tool install -g dotnet-reportgenerator-globaltool``````dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools``````dotnet new tool-manifest``````dotnet tool install dotnet-reportgenerator-globaltoolUsagereportgenerator [options]``````tools\reportgenerator.exe [options]``````dotnet reportgenerator [options]
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 developmentCustom reportsCustom history storage
Add the GitHub Action to your build pipeline.Learn more
Usage / Command line parameters
Use the online configuration tool to get started quickly.
The more advanced settings are documented in the wiki.
Parameters:
["]-reports:[;][;]["]
["]-targetdir:["]
[["]-reporttypes:[;]["]]
[["]-sourcedirs:[;][;]["]]
[["]-historydir:["]]
[["]-plugins:[;][;]["]]
[["]-assemblyfilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]
[["]-classfilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]
[["]-filefilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]
[["]-riskhotspotassemblyfilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]
[["]-riskhotspotclassfilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]
[["]-verbosity:["]]
[["]-title:["]]
[["]-tag:<tag>["]]
[["]-license:<license>["]]
Explanations:
Reports: The coverage reports that should be parsed (separated by semicolon).
Globbing is supported.
Target directory: The directory where the generated report should be saved.
Report types: The output formats and scope (separated by semicolon).
Values: Badges, Clover, Cobertura, CsvSummary,
Markdown, MarkdownSummary, MarkdownAssembliesSummary, MarkdownSummaryGithub,
MarkdownDeltaSummary
OpenCover
Html, Html_Light, Html_Dark, Html_BlueRed
HtmlChart, HtmlInline, HtmlSummary, Html_BlueRed_Summary
HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Light, HtmlInline_AzurePipelines_Dark
JsonSummary, CodeClimate, Latex, LatexSummary, lcov, MHtml, SvgChart, SonarQube, TeamCitySummary
TextSummary, TextDeltaSummary
Xml, XmlSummary
Source directories: Optional directories which contain the corresponding source code (separated by semicolon).
The source directories are used if coverage report contains classes without path information.
Globbing is not supported.
History directory: Optional directory for storing persistent coverage information.
Can be used in future reports to show coverage evolution.
Plugins: Optional plugin files for custom reports or custom history storage (separated by semicolon).
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.
Risk hotspot assembly filters: Optional list of assemblies that should be included or excluded in the risk hotspots.
Risk hotspot class filters: Optional list of classes that should be included or excluded in the risk hotspots.
Exclusion filters take precedence over inclusion filters.
Wildcards are allowed.
Verbosity: The verbosity level of the log messages.
Values: Verbose, Info, Warning, Error, Off
Title: Optional title.
Tag: Optional tag or build version.
License: Optional license for PRO version. Get your license here: https://reportgenerator.io/pro
License can also be supplied via 'REPORTGENERATOR_LICENSE' environment variable.
Default values:
-reporttypes:Html
-assemblyfilters:+*
-classfilters:+*
-filefilters:+*
-riskhotspotassemblyfilters:+*
-riskhotspotclassfilters:+*
-verbosity:Info
Examples:
"-reports:coverage.xml" "-targetdir:C:\report"
"-reports:target\*\*.xml" "-targetdir:C:\report" -reporttypes:Latex;HtmlSummary -title:IntegrationTest -tag:v1.4.5
"-reports:coverage1.xml;coverage2.xml" "-targetdir:report" "-sourcedirs:C:\MyProject" -plugins:CustomReports.dll
"-reports:coverage.xml" "-targetdir:C:\report" "-assemblyfilters:+Included;-Excluded.*"
.netconfig support
All the above parameters can also be persisted in a .netconfig file, under a [ReportGenerator]
section. Examples:
The MSBuild task parameters can be complemented with the .netconfig, if used. That means that parameters
can be omitted if they are provided via .netconfig, which is useful when reusing fixed settings across
multiple projects in a solution, where the MSBuild task is only provided the dynamic values for the current
project:
ReportGenerator supports several input and output formats.
The wiki explains the different output formats or you can download sample reports of all supported output formats.
If you need a custom format, you can create a plugin.