Skip to content

Commit 1e09a04

Browse files
committed
use Microsoft Testing Plaform for coverlet.msbuild.task.tests
1 parent eca5e8c commit 1e09a04

File tree

11 files changed

+20
-11
lines changed

11 files changed

+20
-11
lines changed

eng/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ steps:
2727
- script: |
2828
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"
2929
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"
30+
dotnet test test/coverlet.msbuild.tasks.tests/coverlet.msbuild.tasks.tests.csproj -c $(BuildConfiguration) --no-build -bl:test.msbuild.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.msbuild.tasks.tests.trx" --diagnostic --diagnostic-output-directory "$(Build.SourcesDirectory)\artifacts\log\$(buildConfiguration)" --diagnostic-output-fileprefix "coverlet.msbuild.tasks.tests"
3031
dotnet test test/coverlet.collector.tests/coverlet.collector.tests.csproj -c $(BuildConfiguration) --no-build -bl:test.collector.binlog --results-directory:"$(Build.SourcesDirectory)\artifacts\Reports" /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"
31-
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.projectsample]*" /p:ExcludeByAttribute="GeneratedCodeAttribute" --diag:"$(Build.SourcesDirectory)\artifacts\log\$(buildConfiguration)\coverlet.msbuild.test.diag.log;tracelevel=verbose"
3232
dotnet test test/coverlet.integration.tests/coverlet.integration.tests.csproj -c $(BuildConfiguration) --no-build -bl:test.integration.binlog --results-directory:"$(Build.SourcesDirectory)\artifacts\Reports" --diag:"$(Build.SourcesDirectory)\artifacts\log\$(buildConfiguration)\coverlet.integration.test.diag.log;tracelevel=verbose"
3333
displayName: Run unit tests with coverage
3434
env:

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
5+
<TargetFramework>netstandard2.0</TargetFramework>
66
<AssemblyTitle>coverlet.msbuild.tasks</AssemblyTitle>
77
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
88
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackBuildOutputs</TargetsForTfmSpecificContentInPackage>
@@ -47,10 +47,6 @@
4747
<ProjectReference Include="$(MSBuildThisFileDirectory)..\coverlet.core\coverlet.core.csproj" PrivateAssets="all" />
4848
</ItemGroup>
4949

50-
<ItemGroup>
51-
<Compile Include="$(MSBuildThisFileDirectory)..\coverlet.console\ConsoleTables\ConsoleTable.cs" Link="ConsoleTables\ConsoleTable.cs" />
52-
</ItemGroup>
53-
5450
<ItemGroup>
5551
<None Include="coverlet.msbuild.props" Pack="true" PackagePath="build\">
5652
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

test/Directory.Build.targets

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
This is required when the coverlet.msbuild imports are made in their src directory
1515
(so that msbuild eval works even before they are built)
1616
so that they can still find the tooling that will be built by the build. -->
17-
<CoverletToolsPath>$(RepoRoot)artifacts\bin\coverlet.msbuild.tasks\$(Configuration.ToLowerInvariant())_netstandard2.0\</CoverletToolsPath>
17+
<!--<CoverletToolsPath>$(RepoRoot)artifacts\bin\coverlet.msbuild.tasks\$(Configuration.ToLowerInvariant())_netstandard2.0\</CoverletToolsPath>-->
18+
<CoverletToolsPath>$(RepoRoot)artifacts\bin\coverlet.msbuild.tasks\$(Configuration)\</CoverletToolsPath>
1819
</PropertyGroup>
1920
</When>
2021
</Choose>

test/coverlet.msbuild.tasks.tests/ConsoleTableTests.cs renamed to test/coverlet.core.tests/ConsoleTable/ConsoleTableTests.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Toni Solarin-Sodara
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4+
using System;
5+
using System.IO;
46
using ConsoleTables;
57
using Xunit;
68

test/coverlet.msbuild.tasks.tests/CoverageResultTaskTests.cs

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Copyright (c) Toni Solarin-Sodara
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4+
using System;
5+
using System.Collections.Generic;
6+
using System.IO;
7+
using System.Linq;
48
using coverlet.msbuild.tasks.tests;
59
using Coverlet.Core.Abstractions;
610
using Coverlet.Core.Helpers;

test/coverlet.msbuild.tasks.tests/InstrumentationTaskTests.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Toni Solarin-Sodara
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4+
using System.Collections.Generic;
5+
using System.IO;
46
using Coverlet.Core.Abstractions;
57
using Coverlet.Core.Helpers;
68
using Coverlet.Core.Symbols;

test/coverlet.msbuild.tasks.tests/Reporters.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Toni Solarin-Sodara
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4+
using System.IO;
45
using Coverlet.Core;
56
using Coverlet.Core.Abstractions;
67
using Coverlet.Core.Reporters;
@@ -13,7 +14,7 @@ public class Reporters
1314
{
1415
// we use lcov with extension .info and cobertura with extension .cobertura.xml
1516
// to have all possible extension format
16-
// empty coverletOutput is not possible thank's to props default
17+
// empty coverletOutput is not possible thanks to props default
1718
[Theory]
1819
// single tfm
1920
[InlineData("", "/folder/reportFolder/", "lcov", "/folder/reportFolder/coverage.info")]

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="$(RepoRoot)src\coverlet.msbuild.tasks\coverlet.msbuild.props" />
33
<PropertyGroup>
4-
<TargetFrameworks>net8.0</TargetFrameworks>
5-
<ImplicitUsings>enable</ImplicitUsings>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<OutputType>Exe</OutputType>
6+
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
7+
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
68
<Nullable>enable</Nullable>
79
<IsTestProject>true</IsTestProject>
810
<IsPackable>false</IsPackable>

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

+1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
[assembly: InternalsVisibleTo("coverlet.core.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100757cf9291d78a82e5bb58a827a3c46c2f959318327ad30d1b52e918321ffbd847fb21565b8576d2a3a24562a93e86c77a298b564a0f1b98f63d7a1441a3a8bcc206da3ed09d5dacc76e122a109a9d3ac608e21a054d667a2bae98510a1f0f653c0e6f58f42b4b3934f6012f5ec4a09b3dfd3e14d437ede1424bdb722aead64ad")]
99
[assembly: InternalsVisibleTo("coverlet.core.coverage.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100094aad8eb75c06c9f2443dda84573b8db55cd6678452a60010db2643467ac28928db3a06b0b1ac3016645b448937d5e671b36504bcfc0fda27e996c5e1b0ee49747145cda6d47508d1e3c60b144634d95e33d4efe49536372df8139f48d3d897ae6931c2876d4f5d00215fd991cbcecde2705e53e19309e21c8b59d19eb925b1")]
1010
[assembly: InternalsVisibleTo("coverlet.integration.tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010001d24efbe9cbc2dc49b7a3d2ae34ca37cfb69b4f450acd768a22ce5cd021c8a38ae7dc68b2809a1ac606ad531b578f192a5690b2986990cbda4dd84ec65a3a4c1c36f6d7bb18f08592b93091535eaee2f0c8e48763ed7f190db2008e1f9e0facd5c0df5aaab74febd3430e09a428a72e5e6b88357f92d78e47512d46ebdc3cbb")]
11+
[assembly: InternalsVisibleTo("coverlet.msbuild.tasks.tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010071b1583d63637a225f3f640252fee7130f0f3f2127d75025c1c3ee2d6dfc79a4950919268e0784d7ff54b0eadd8e4762e3e150da422e20e091eb0811d9d84e1779d5b95e349d5428aebb16e82e081bdf805926c5a9eb2094aaed9d36442de024264976a8835c7d6923047cf2f745e8f0ded2332f8980acd390f725224d976ed8")]
1112

0 commit comments

Comments
 (0)