OutputTestCoverage 0.1.0

dotnet tool install --global OutputTestCoverage --version 0.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local OutputTestCoverage --version 0.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=OutputTestCoverage&version=0.1.0
                    
nuke :add-package OutputTestCoverage --version 0.1.0
                    

OutputTestCoverage

OutputTestCoverage is a command-line utility for aggregating and reporting code coverage from multiple XML coverage reports generated by .NET test tools (such as those using --collect:"XPlat Code Coverage"). It is compatible with .NET 6, .NET 8, and .NET 9.

What does Program.cs do?

The main program scans a specified directory (provided as a command-line argument) for XML coverage reports. For each report, it extracts the line-rate attribute, calculates the partial coverage percentage, and prints it. After processing all reports, it outputs the total average coverage across all found reports. This is especially useful for CI/CD pipelines to generate coverage badges or enforce coverage thresholds.

Example usage

output-test-coverage <coverage-reports-directory>
  • <coverage-reports-directory>: Path to the directory containing your XML coverage reports.

Use as dotnet tool

You can install this utility as a global .NET tool:

dotnet new tool-manifest # if you don't already have a tool manifest
dotnet tool install OutputTestCoverage

Features

  • Aggregates code coverage from multiple XML reports
  • Outputs both partial and total coverage percentages
  • Useful for CI/CD integration and coverage badge generation
  • Supports .NET 6, .NET 8, and .NET 9

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.1.0 268 8/4/2025