File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ if ($codecov -eq 'true') {
1717
1818 # Allow toggling of profile to workaround any potential JIT errors caused by code injection.
1919 dotnet clean - c $codecovProfile
20- dotnet test - c $codecovProfile -f $targetFramework / p:codecov = true
20+ dotnet test -- collect " XPlat Code Coverage " -- settings .\tests\coverlet.runsettings - c $codecovProfile -f $targetFramework / p:CodeCov = true
2121}
2222elseif ($platform -eq ' -x86' -and $targetFramework -match $netFxRegex ) {
2323
Original file line number Diff line number Diff line change 2727
2828 <Import Project =" $(MSBuildThisFileDirectory)..\Directory.Build.props" />
2929
30- <ItemGroup >
30+ <ItemGroup Condition = " '$(IsTestProject)' == 'true' " >
3131 <PackageReference Include =" Microsoft.NET.Test.Sdk" IsImplicitlyDefined =" true" />
3232 <PackageReference Include =" xunit" IsImplicitlyDefined =" true" />
3333 <PackageReference Include =" xunit.runner.visualstudio" IsImplicitlyDefined =" true" />
Original file line number Diff line number Diff line change 1717 <Import Project =" $(MSBuildThisFileDirectory)..\Directory.Build.targets" />
1818
1919 <!-- Tool versions for tool references across all projects -->
20- <ItemGroup >
20+ <ItemGroup Condition = " '$(IsTestProject)' == 'true' " >
2121 <!-- dotnet tools does not have an x86 runner. You have to use separate SDKs-->
2222 <!-- https://github.com/actions/setup-dotnet/issues/72-->
2323 <DotNetCliToolReference Update =" dotnet-xunit" Version =" 2.3.1" />
2424 </ItemGroup >
2525
26- <!-- Code coverage specific settings-->
27- <!-- https://github.com/tonerdo/coverlet-->
28- <PropertyGroup Condition =" '$(codecov)' == 'true' AND '$(IsTestProject)' == 'true'" >
29- <CollectCoverage >true</CollectCoverage >
30- <UseSourceLink >true</UseSourceLink >
31- <CoverletOutputFormat >opencover</CoverletOutputFormat >
32- <!-- Output injects target framework into name despite explicit config. See build yml-->
33- <CoverletOutput >$(MSBuildThisFileDirectory)..\coverage.xml</CoverletOutput >
34- <!-- Used by coverlet dues to reference issues with SixLabors.Core-->
35- <!-- https://github.com/tonerdo/coverlet/blob/master/Documentation/KnowIssues.md#4-failed-to-resolve-assembly-during-instrumentation-->
36- <CopyLocalLockFileAssemblies >true</CopyLocalLockFileAssemblies >
37- </PropertyGroup >
38-
3926 <ItemGroup >
4027 <!-- Test Dependencies-->
4128 <PackageReference Update =" BenchmarkDotNet" Version =" 0.12.0" />
You can’t perform that action at this time.
0 commit comments