Skip to content

Commit 02b41f9

Browse files
committed
Update tests to xUnit v3, enable MTP integration
- Expanded MTP integration docs and added usage ToDo - Enabled package generation in coverlet.MTP.csproj - Added strong name signing for validation tests - Updated validation test project: new dependencies, utility refs, and test project copying - Updated InternalsVisibleTo for new test assemblies
1 parent 4608ccb commit 02b41f9

File tree

9 files changed

+43
-81
lines changed

9 files changed

+43
-81
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<NugetPackageVersion>7.0.1</NugetPackageVersion>
1414
<!-- Test Platform, .NET Test SDK and Object Model -->
1515
<MicrosoftNETTestSdkVersion>18.0.1</MicrosoftNETTestSdkVersion>
16-
<XunitV3Version>3.0.0</XunitV3Version>
16+
<XunitV3Version>3.2.1</XunitV3Version>
1717
<XunitRunnerVisualstudioVersion>3.1.5</XunitRunnerVisualstudioVersion>
1818
<MicrosoftTestingPlatformVersion>1.9.1</MicrosoftTestingPlatformVersion>
1919
</PropertyGroup>
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
### ToDo Description
1+
# Coverlet Microsoft Testing Platform Integration
2+
3+
[Microsoft.Testing.Platform and Microsoft Test Framework](https://github.com/microsoft/testfx) is a lightweight alternativ for VSTest.
4+
5+
More information is available here:
6+
7+
- [Microsoft.Testing.Platform overview](https://learn.microsoft.com/en-us/dotnet/core/testing/microsoft-testing-platform-intro?tabs=dotnetcli)
8+
- [Microsoft.Testing.Platform extensibility](https://learn.microsoft.com/en-us/dotnet/core/testing/microsoft-testing-platform-architecture-extensions)
9+
10+
coverlet.MTP uses MTP interface and implement coverlet.collector functionality.
11+
12+
December 2025: [Microsoft coverage can be used for xunit](https://xunit.net/docs/getting-started/v3/code-coverage-with-mtp) as well.
13+
14+
15+
ToDo: Usage details

src/coverlet.MTP/coverlet.MTP.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<IsTestProject>true</IsTestProject>
1313
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
1414
<IsPackable>true</IsPackable>
15-
<!--<GeneratePackageOnBuild>true</GeneratePackageOnBuild>-->
15+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1616
</PropertyGroup>
1717

1818
<PropertyGroup>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright (c) Toni Solarin-Sodara
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System.Reflection;
5+
6+
[assembly: AssemblyKeyFile("coverlet.MTP.validation.tests.snk")]

test/coverlet.MTP.validation.tests/Tests.cs

Lines changed: 0 additions & 43 deletions
This file was deleted.

test/coverlet.MTP.validation.tests/Tests2.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

test/coverlet.MTP.validation.tests/coverlet.MTP.validation.tests.csproj

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<Nullable>enable</Nullable>
66
<OutputType>Exe</OutputType>
77
<TargetFramework>net8.0</TargetFramework>
8+
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
9+
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
810
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
911
<!--
1012
<RestoreSources>
@@ -17,12 +19,9 @@
1719
</PropertyGroup>
1820

1921
<ItemGroup>
20-
<PackageReference Include="TUnit" Version="0.23.0"/>
21-
<!--<PackageReference Include="coverlet.MTP" Version="8.0.0-preview.33.ga9274247b6" />-->
22-
</ItemGroup>
23-
24-
<ItemGroup>
25-
<ProjectReference Include="$(RepoRoot)src\coverlet.MTP\coverlet.MTP.csproj" />
22+
<PackageReference Include="xunit.v3" Version="$(XunitV3Version)" />
23+
<!--<PackageReference Include="coverlet.MTP" Version="8.0.0-preview.28.g4608ccb7ad" />-->
24+
<PackageReference Include="NuGet.Packaging" Version="$(NugetPackageVersion)" />
2625
</ItemGroup>
2726

2827
<ItemGroup>
@@ -33,4 +32,17 @@
3332
<ItemGroup>
3433
<PackageReference Remove="Microsoft.CodeAnalysis.BannedApiAnalyzers" />
3534
</ItemGroup>
35+
36+
<ItemGroup>
37+
<ProjectReference Include="$(RepoRoot)test\coverlet.tests.utils\coverlet.tests.utils.csproj" />
38+
</ItemGroup>
39+
40+
<ItemGroup>
41+
<None Include="TestProjects\BasicTestProject\BasicTestProject.csproj">
42+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
43+
</None>
44+
<None Include="TestProjects\CalculateSampleTests\CalculateSampleTests.csproj">
45+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
46+
</None>
47+
</ItemGroup>
3648
</Project>
Binary file not shown.

test/coverlet.tests.utils/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
[assembly: InternalsVisibleTo("coverlet.core.coverage.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100094aad8eb75c06c9f2443dda84573b8db55cd6678452a60010db2643467ac28928db3a06b0b1ac3016645b448937d5e671b36504bcfc0fda27e996c5e1b0ee49747145cda6d47508d1e3c60b144634d95e33d4efe49536372df8139f48d3d897ae6931c2876d4f5d00215fd991cbcecde2705e53e19309e21c8b59d19eb925b1")]
1010
[assembly: InternalsVisibleTo("coverlet.integration.tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010001d24efbe9cbc2dc49b7a3d2ae34ca37cfb69b4f450acd768a22ce5cd021c8a38ae7dc68b2809a1ac606ad531b578f192a5690b2986990cbda4dd84ec65a3a4c1c36f6d7bb18f08592b93091535eaee2f0c8e48763ed7f190db2008e1f9e0facd5c0df5aaab74febd3430e09a428a72e5e6b88357f92d78e47512d46ebdc3cbb")]
1111
[assembly: InternalsVisibleTo("coverlet.msbuild.tasks.tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010071b1583d63637a225f3f640252fee7130f0f3f2127d75025c1c3ee2d6dfc79a4950919268e0784d7ff54b0eadd8e4762e3e150da422e20e091eb0811d9d84e1779d5b95e349d5428aebb16e82e081bdf805926c5a9eb2094aaed9d36442de024264976a8835c7d6923047cf2f745e8f0ded2332f8980acd390f725224d976ed8")]
12-
12+
[assembly: InternalsVisibleTo("coverlet.MTP.validation.tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001001575e172562f7b3ca4e105ef1539802ddf92de5f3d3a76937f99c73b1c64f46ec6ed1c5de46f2d39bc8916050376f749507bb5082958890e6e3ba9c68b4c6e4a56f16c1401f21f908c437a2b0b4dc263ef3bc1bc15d6a02a8e6cbf26a077f1590f91e248cf5ccd4642b7493b31cfa2bd9f921b662cd2cb8bcc66fc2cb533e2a8")]
13+
[assembly: InternalsVisibleTo("coverlet.MTP.unit.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d568d35e41a0829ae24628d27cc43572aa77a3d2f5ac0a6b7554a92d979a72ec0e084c38f83f1ccfc3d26bbeca74131f611a7600a6f218ffc0cbb5758c4e6da50b07fd499d96bdc4e8eb1e10a38231aefd3cde5a69cbade511129588352843950b489b9295a9fb7259b00f18f3a571bdca19b13ccda89cc2a4690f69ee2367b8")]

0 commit comments

Comments
 (0)