coverlet
coverlet copied to clipboard
Is it possible to write exclusion expressions in a file and feed it to coverlet coverage counting?
I just need to cherry-pick a bunch of classes and methods that are inappropriate for unit testing out of a big solution consisting of a number of projects. As these units are distributed to a lot of files, it would be ugly to attach a super long arguments to set them all out of the testing. So is there a way to create a file of certain format that allows input of the expressions via argument all at once?
We don't have that feature at the moment, isn't enough glob patterns like https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/MSBuildIntegration.md#source-files? I don't know if rsp file can be useful in this case https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-response-files?view=vs-2022
This issue is stale because it has been open for 3 months with no activity.
You can use a props file which should be imported for test projects.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CollectCoverage Condition="$(CollectCoverage) == ''">false</CollectCoverage>
<Include Condition="$(Include) == ''"></Include>
<IncludeDirectory Condition="$(IncludeDirectory) == ''"></IncludeDirectory>
<Exclude Condition="$(Exclude) == ''"></Exclude>
<ExcludeByFile Condition="$(ExcludeByFile) == ''"></ExcludeByFile>
<ExcludeByAttribute Condition="$(ExcludeByAttribute) == ''"></ExcludeByAttribute>
<IncludeTestAssembly Condition="'$(IncludeTestAssembly)' == ''">false</IncludeTestAssembly>
<SingleHit Condition="'$(SingleHit)' == ''">false</SingleHit>
<MergeWith Condition="$(MergeWith) == ''"></MergeWith>
<UseSourceLink Condition="$(UseSourceLink) == ''">false</UseSourceLink>
<DeterministicReport Condition="$(DeterministicReport) == ''">false</DeterministicReport>
<CoverletOutputFormat Condition="$(CoverletOutputFormat) == ''">json</CoverletOutputFormat>
<CoverletOutput Condition="$(CoverletOutput) == ''">$([MSBuild]::EnsureTrailingSlash('$(MSBuildProjectDirectory)'))</CoverletOutput>
<Threshold Condition="$(Threshold) == ''">0</Threshold>
<ThresholdType Condition="$(ThresholdType) == ''">line,branch,method</ThresholdType>
<ThresholdStat Condition="$(ThresholdStat) == ''">minimum</ThresholdStat>
<ExcludeAssembliesWithoutSources Condition="$(ExcludeAssembliesWithoutSources) == ''"></ExcludeAssembliesWithoutSources>
</PropertyGroup>
</Project>
This issue is stale because it has been open for 3 months with no activity.