Skip to content

Commit

Permalink
support TargetFrameworks net6.0;net7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertk committed Oct 27, 2023
1 parent 9162fa4 commit f7699c3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,5 @@ test/coverlet.integration.determisticbuild/runsettings

coverage.cobertura.xml
coverage.opencover.xml
coverage.*.cobertura.xml
coverage.*.opencover.xml
4 changes: 2 additions & 2 deletions eng/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ steps:
**/coverlet.core.tests.csproj
**/coverlet.integration.tests.csproj
**/coverlet.msbuild.tasks.tests.csproj
arguments: -c $(BuildConfiguration) --no-build -bl:test.binlog /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.xunit.extensions]*%2c[coverlet.tests.projectsample]*" --diag:"$(Build.SourcesDirectory)\artifacts\log\$(Configuration)\coverlet.test.diag.log;tracelevel=verbose"
arguments: -c $(BuildConfiguration) --no-build -bl:test.binlog --results-directory:"$(Build.SourcesDirectory)\artifacts\Reports" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.xunit.extensions]*%2c[coverlet.tests.projectsample]*" --diag:"$(Build.SourcesDirectory)\artifacts\log\$(Configuration)\coverlet.test.diag.log;tracelevel=verbose"
testRunTitle: $(Agent.JobName)

- template: publish-coverlet-result-files.yml

- template: publish-coverage-results.yml
parameters:
reports: $(Build.SourcesDirectory)/**/coverage.opencover.xml
reports: $(Build.SourcesDirectory)/**/*.opencover.xml
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Debug'))
assemblyfilters: '-xunit;-coverlet.testsubject;-Coverlet.Tests.ProjectSample.*'
classfilters: '-[coverlet.core.tests.samples.netstandard]*;-[coverlet.tests.xunit.extensions]*'
6 changes: 3 additions & 3 deletions eng/publish-coverlet-result-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ steps:
Contents: |
**/*.trx
**/*.html
**/coverage.opencover.xml
**/coverage.cobertura.xml
**/coverage.json
**/*.opencover.xml
**/*.cobertura.xml
**/*.coverage.json
**/log.txt
**/log.datacollector.*.txt
**/log.host.*.txt
Expand Down
4 changes: 2 additions & 2 deletions src/coverlet.msbuild.tasks/coverlet.msbuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</ItemGroup>
</Target>

<Target Name="InstrumentModules">
<Target Name="InstrumentModules" Condition="'$(TargetPath)' != ''">
<Coverlet.MSbuild.Tasks.InstrumentationTask
Path="$(TargetPath)"
Include="$(Include)"
Expand Down Expand Up @@ -65,7 +65,7 @@
DependsOnTargets="InstrumentModules"
Condition="'$(VSTestNoBuild)' != 'true' and '$(CollectCoverage)' == 'true'" />

<Target Name="GenerateCoverageResult">
<Target Name="GenerateCoverageResult" Condition="'$(InstrumenterState)' != ''">
<PropertyGroup>
<_coverletMultiTargetFrameworksCurrentTFM Condition="'$(TargetFrameworks)' != ''" >$(TargetFramework)</_coverletMultiTargetFrameworksCurrentTFM>
</PropertyGroup>
Expand Down

0 comments on commit f7699c3

Please sign in to comment.