Skip to content

Difference in coverage results between Windows and Linux  #37

@ArturDorochowicz

Description

@ArturDorochowicz

I'm getting different coverage results between Windows and Linux.

In a .net solution with references: Test Project -> ProjectA -> Project B, if tests in Test Project don't exercise anything from Project B, then on Linux Project B is not included in coverage results, but it is included (with 0 coverage as expected) when run on Windows.

I've checked this with .Net 7 and Microsoft.NET.Test.Sdk 17.5.0, as well as with .Net 6 and Microsoft.NET.Test.Sdk 17.6.3.

I'm attaching a tiny solution (projects: Tests -> Console -> Library) that shows the problem Project.zip. For this solution I get (note missing library.dll in Linux results):
on Linux:
linux
on Windows:
windows

In both cases the coverage was obtained with: dotnet test --collect "Code Coverage"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions