Skip to content

Different output format results in different coverage percentage #1519

@cremor

Description

@cremor

I would have assumed that the code coverage output format ist just that - a file format. But it seems like using a different output format also affects code coverage percentage. Is this by design?

Example:
I use a .NET regular expression source generator in my code.
When I use dotnet test with the argument --collect:"XPlat Code Coverage;Format=cobertura" then it does count the generated code in the namespace System.Text.RegularExpressions.Generated.
When I use dotnet test with the argument --collect:"XPlat Code Coverage;Format=opencover" then it does not count the generated code.

Package: coverlet.collector 6.0.0
.NET 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    tracking-external-issueThe issue is caused by external problem - nothing we can do to fix it directlywaiting for customerWaiting for customer action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions