Skip to content

Commit b133a8e

Browse files
committed
use only MicrosoftTestingPlatformRunner
1 parent 5ee541a commit b133a8e

File tree

8 files changed

+18
-15
lines changed

8 files changed

+18
-15
lines changed

eng/build.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ steps:
3030
displayName: Pack
3131

3232
- script: |
33-
dotnet test test/coverlet.core.tests/coverlet.core.tests.csproj -c $(BuildConfiguration) --no-build -bl:test.core.binlog /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.projectsample]*" /p:ExcludeByAttribute="GeneratedCodeAttribute" -- --results-directory "$(Build.SourcesDirectory)/artifacts/reports" --report-xunit-trx --report-xunit-trx-filename "coverlet.core.tests.trx" --diagnostic --diagnostic-output-directory "$(Build.SourcesDirectory)/artifacts/log/$(buildConfiguration)" --diagnostic-output-fileprefix "coverlet.core.tests"
34-
dotnet test test/coverlet.core.coverage.tests/coverlet.core.coverage.tests.csproj -c $(BuildConfiguration) --no-build -bl:test.core.coverage.binlog /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.projectsample]*" /p:ExcludeByAttribute="GeneratedCodeAttribute" -- --results-directory "$(Build.SourcesDirectory)/artifacts/reports" --report-xunit-trx --report-xunit-trx-filename "coverlet.core.coverage.tests.trx" --diagnostic --diagnostic-output-directory "$(Build.SourcesDirectory)/artifacts/log/$(buildConfiguration)" --diagnostic-output-fileprefix "coverlet.core.coverage.tests"
35-
dotnet test test/coverlet.msbuild.tasks.tests/coverlet.msbuild.tasks.tests.csproj -c $(BuildConfiguration) --no-build -bl:test.msbuild.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]*%2c[testgen_]*" /p:ExcludeByAttribute="GeneratedCodeAttribute" --diag:"$(Build.SourcesDirectory)\artifacts\log\$(buildConfiguration)\coverlet.msbuild.test.diag.log;tracelevel=verbose"
36-
dotnet test test/coverlet.collector.tests/coverlet.collector.tests.csproj -c $(BuildConfiguration) --no-build -bl:test.collector.binlog /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.projectsample]*" /p:ExcludeByAttribute="GeneratedCodeAttribute" --diag:"$(Build.SourcesDirectory)/artifacts/log/$(buildConfiguration)/coverlet.collector.test.diag.log;tracelevel=verbose"
37-
dotnet test test/coverlet.integration.tests/coverlet.integration.tests.csproj -c $(BuildConfiguration) -f net8.0 --no-build -bl:test.integration.binlog -- --results-directory "$(Build.SourcesDirectory)/artifacts/reports" --report-xunit-trx --report-xunit-trx-filename "coverlet.integration.tests.trx" --diagnostic --diagnostic-output-directory "$(Build.SourcesDirectory)/artifacts/log/$(buildConfiguration)" --diagnostic-output-fileprefix "coverlet.integration.tests"
38-
dotnet test test/coverlet.integration.tests/coverlet.integration.tests.csproj -c $(BuildConfiguration) -f net9.0 --no-build -bl:test.integration.binlog -- --results-directory "$(Build.SourcesDirectory)/artifacts/reports" --report-xunit-trx --report-xunit-trx-filename "coverlet.integration.tests.trx" --diagnostic --diagnostic-output-directory "$(Build.SourcesDirectory)/artifacts/log/$(buildConfiguration)" --diagnostic-output-fileprefix "coverlet.integration.tests"
39-
33+
dotnet test test/coverlet.core.tests/coverlet.core.tests.csproj -c $(BuildConfiguration) --no-build -bl:test.core.binlog /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.projectsample]*" /p:ExcludeByAttribute="GeneratedCodeAttribute" --diag:"$(Build.SourcesDirectory)/artifacts/log/coverlet.core.test.diag.$(BuildConfiguration.log;tracelevel=verbose"
34+
dotnet test test/coverlet.core.coverage.tests/coverlet.core.coverage.tests.csproj -c $(BuildConfiguration) --no-build -bl:test.core.coverage.binlog /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.projectsample]*" /p:ExcludeByAttribute="GeneratedCodeAttribute" --diag:"$(Build.SourcesDirectory)/artifacts/log/coverlet.core.coverage.test.diag.$(BuildConfiguration.log;tracelevel=verbose"
35+
dotnet test test/coverlet.msbuild.tasks.tests\coverlet.msbuild.tasks.tests.csproj -c $(BuildConfiguration) --no-build -bl:test.msbuild.tasks.binlog /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.projectsample]*" /p:ExcludeByAttribute="GeneratedCodeAttribute" --diag:"$(Build.SourcesDirectory)/artifacts/log/coverlet.collector.tests.diag.$(buildConfiguration).log;tracelevel=verbose"
36+
dotnet test test/coverlet.collector.tests/coverlet.collector.tests.csproj -c $(BuildConfiguration) --no-build -bl:test.collector.binlog /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.projectsample]*" /p:ExcludeByAttribute="GeneratedCodeAttribute" --diag:"$(Build.SourcesDirectory)/artifacts/log/coverlet.collector.test.diag.$(buildConfiguration).log;tracelevel=verbose"
37+
dotnet test test/coverlet.integration.tests/coverlet.integration.tests.csproj -c $(BuildConfiguration) -f net8.0 --no-build -bl:test.integration.binlog --diag:"$(Build.SourcesDirectory)/artifacts/log/coverlet.integration.tests.diag.net8.0.$(buildConfiguration).log;tracelevel=verbose"
38+
dotnet test test/coverlet.integration.tests/coverlet.integration.tests.csproj -c $(BuildConfiguration) -f net9.0 --no-build -bl:test.integration.binlog --diag:"$(Build.SourcesDirectory)/artifacts/log/coverlet.integration.tests.diag.net9.0.$(buildConfiguration).log;tracelevel=verbose"
4039
displayName: Run unit tests with coverage
4140
env:
4241
MSBUILDDISABLENODEREUSE: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!-- buildMultiTargeting/coverlet.msbuild.props -->
2+
<Project>
3+
<Import Project="..\build\coverlet.msbuild.props" />
4+
</Project>

src/coverlet.msbuild.tasks/coverlet.msbuild.props

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
<ExcludeAssembliesWithoutSources Condition="$(ExcludeAssembliesWithoutSources) == ''"></ExcludeAssembliesWithoutSources>
2020
</PropertyGroup>
2121
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
22-
<CoverletToolsPath Condition=" '$(CoverletToolsPath)' == '' ">$(MSBuildThisFileDirectory)..\tasks\netstandard2.0\</CoverletToolsPath>
22+
<CoverletToolsPath Condition="'$(CoverletToolsPath)' == '' and '$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tasks\net8.0\</CoverletToolsPath>
23+
<CoverletToolsPath Condition="'$(CoverletToolsPath)' == '' and '$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tasks\netstandard2.0\</CoverletToolsPath>
2324
</PropertyGroup>
2425
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT' ">
25-
<CoverletToolsPath Condition=" '$(CoverletToolsPath)' == '' ">$(MSBuildThisFileDirectory)../tasks/netstandard2.0/</CoverletToolsPath>
26+
<CoverletToolsPath Condition="'$(CoverletToolsPath)' == '' and '$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)../tasks/net8.0/</CoverletToolsPath>
27+
<CoverletToolsPath Condition="'$(CoverletToolsPath)' == '' and '$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)../tasks/netstandard2.0/</CoverletToolsPath>
2628
</PropertyGroup>
2729
</Project>

src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
<None Include="coverlet.msbuild.props" Pack="true" PackagePath="build\">
5353
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
5454
</None>
55+
<None Include="buildMultiTargeting\coverlet.msbuild.props" Pack="true" PackagePath="buildMultiTargeting\">
56+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
57+
</None>
5558
<None Include="coverlet.msbuild.targets" Pack="true" PackagePath="build\">
5659
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
5760
</None>

test/coverlet.core.coverage.tests/coverlet.core.coverage.tests.csproj

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33

44
<PropertyGroup>
55
<TargetFramework>net8.0</TargetFramework>
6-
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
76
<OutputType>Exe</OutputType>
8-
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
7+
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
98
<IsPackable>false</IsPackable>
109
<IsTestProject>true</IsTestProject>
1110
<NoWarn>$(NoWarn);CS8002</NoWarn>

test/coverlet.core.tests/coverlet.core.tests.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<TargetFramework>net8.0</TargetFramework>
66
<OutputType>Exe</OutputType>
77
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
8-
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
98
<IsTestProject>true</IsTestProject>
109
<IsPackable>false</IsPackable>
1110
<NoWarn>$(NoWarn);CS8002</NoWarn>

test/coverlet.integration.tests/coverlet.integration.tests.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<TargetFrameworks>$(NetCurrent);$(NetMinimum)</TargetFrameworks>
44
<OutputType>Exe</OutputType>
55
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
6-
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
76
<IsPackable>false</IsPackable>
87
<Nullable>enable</Nullable>
98
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>

test/coverlet.msbuild.tasks.tests/coverlet.msbuild.tasks.tests.csproj

-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
<Import Project="$(RepoRoot)src\coverlet.msbuild.tasks\coverlet.msbuild.props" />
33
<PropertyGroup>
44
<TargetFrameworks>$(NetMinimum)</TargetFrameworks>
5-
<!-- This section should be enabled after using SDK 8.0.0 requirement (Microsoft.Bcl.AsyncInterfaces) -->
65
<OutputType>Exe</OutputType>
76
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
8-
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
97
<Nullable>enable</Nullable>
108
<IsTestProject>true</IsTestProject>
119
<IsPackable>false</IsPackable>

0 commit comments

Comments
 (0)