Full coverage of Solution #1498
-
Is there any way to include in coverage even the projects that are not reference but they are in the solution?? The given example: https://github.com/AlbertoMonteiro/CoverageSample Its generates 100% coverage, but I have 2 class lib projects and one test project, the test project only reference one of class lib, and whe I run But I wanted that the other project that doesnt have any test to be showed as well, so for that sample would be 50% code coverage instead 100%. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes you can with the include filters. For instance if you use the "D:\Repos\CoverageSample1498\test\CoverageSample.TestProject\bin\Debug\net7.0\CoverageSample.TestProject.dll" --target "dotnet" --targetargs "test D:\Repos\CoverageSample1498\test\CoverageSample.TestProject --no-build" --include-directory "D:\Repos\CoverageSample1498\src\CoverageSample.ProjectB\bin\Debug\net7.0" you get the following result: The same also works with the collector. For instance like: dotnet test --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.IncludeDirectory="D:\Repos\CoverageSample1498\src\CoverageSample.ProjectB\bin\Debug\net7.0" you get a result like You can find some more infos about the filters here: |
Beta Was this translation helpful? Give feedback.
Yes you can with the include filters. For instance if you use the
--include-directory
filter with the global tool like this:you get the following result:
The same also works with the collector. For instance like: