From 7ee10f2a2b1a641410762eee37cd1f1332200995 Mon Sep 17 00:00:00 2001 From: Bert Date: Thu, 15 Dec 2022 18:19:22 +0100 Subject: [PATCH 01/11] use only supported .NET LTS and STS versions (see https://github.com/dotnet/core/blob/main/releases.md) --- Directory.Build.props | 6 +- Directory.Build.targets | 27 --------- Directory.Packages.props | 58 +++++++++++++++++++ .../XUnitTestProject1.csproj | 18 ++++-- .../XUnitTestProject1.csproj | 15 +++-- .../XUnitTestProject2.csproj | 13 +++-- .../XUnitTestProject3.csproj | 15 +++-- .../XUnitTestProject1.csproj | 13 +++-- .../XUnitTestProject1.csproj | 13 +++-- README.md | 36 ++++++------ coverlet.sln | 1 + eng/build.yml | 8 +-- .../Properties/AssemblyInfo.cs | 11 ---- .../coverlet.collector.targets | 2 +- .../coverlet.collector.csproj | 18 ++++-- .../Properties/AssemblyInfo.cs | 4 -- .../Instrumentation/Instrumenter.cs | 2 +- src/coverlet.core/Properties/AssemblyInfo.cs | 17 ------ src/coverlet.core/coverlet.core.csproj | 22 +++++-- .../Properties/AssemblyInfo.cs | 8 --- .../coverlet.msbuild.targets | 2 +- .../coverlet.msbuild.tasks.csproj | 10 +++- .../coverlet.collector.tests.csproj | 2 +- .../coverlet.core.performancetest.csproj | 4 +- ...rlet.core.tests.samples.netstandard.csproj | 4 +- .../coverlet.core.tests.csproj | 13 +++-- ...verlet.integration.determisticbuild.csproj | 6 +- .../coverlet.integration.template.csproj | 10 +++- test/coverlet.integration.tests/Collectors.cs | 14 ++--- test/coverlet.integration.tests/DotnetTool.cs | 2 + .../coverlet.integration.tests.csproj | 1 + ...coverlet.tests.projectsample.fsharp.fsproj | 1 + ...et.tests.projectsample.netframework.csproj | 7 ++- .../coverlet.tests.remoteexecutor.csproj | 4 +- .../coverlet.tests.xunit.extensions.csproj | 1 + 35 files changed, 223 insertions(+), 165 deletions(-) create mode 100644 Directory.Packages.props delete mode 100644 src/coverlet.collector/Properties/AssemblyInfo.cs rename src/coverlet.collector/build/{netstandard1.0 => netstandard2.0}/coverlet.collector.targets (98%) delete mode 100644 src/coverlet.console/Properties/AssemblyInfo.cs delete mode 100644 src/coverlet.core/Properties/AssemblyInfo.cs delete mode 100644 src/coverlet.msbuild.tasks/Properties/AssemblyInfo.cs diff --git a/Directory.Build.props b/Directory.Build.props index a075f6f8b..3f15462d6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -10,6 +10,7 @@ snupkg true true + AllEnabledByDefault preview true preview @@ -17,6 +18,7 @@ https://api.nuget.org/v3/index.json; + true @@ -24,8 +26,4 @@ true - - - - diff --git a/Directory.Build.targets b/Directory.Build.targets index d970b1531..7d8e8e785 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,31 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 000000000..8da7b434d --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,58 @@ + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Documentation/Examples/MSBuild/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj b/Documentation/Examples/MSBuild/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj index de3e88f32..651ed56cf 100644 --- a/Documentation/Examples/MSBuild/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj +++ b/Documentation/Examples/MSBuild/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj @@ -1,15 +1,21 @@ - + - netcoreapp3.1 + net6.0 false - - - - + + + + all + runtime; build; native; contentfiles; analyzers + + + all + runtime; build; native; contentfiles; analyzers + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject1/XUnitTestProject1.csproj b/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject1/XUnitTestProject1.csproj index 76ecf3d44..043a48b1d 100644 --- a/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject1/XUnitTestProject1.csproj +++ b/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject1/XUnitTestProject1.csproj @@ -1,18 +1,21 @@ - + - netcoreapp3.1 + net6.0 false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject2/XUnitTestProject2.csproj b/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject2/XUnitTestProject2.csproj index 6c938c759..ce20ab140 100644 --- a/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject2/XUnitTestProject2.csproj +++ b/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject2/XUnitTestProject2.csproj @@ -1,18 +1,21 @@ - + - netcoreapp3.1 + net6.0 false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + + all + runtime; build; native; contentfiles; analyzers + diff --git a/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject3/XUnitTestProject3.csproj b/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject3/XUnitTestProject3.csproj index d5267e6a2..d8fc74eb8 100644 --- a/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject3/XUnitTestProject3.csproj +++ b/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject3/XUnitTestProject3.csproj @@ -1,18 +1,21 @@ - + - netcoreapp3.1 + net6.0 false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/Documentation/Examples/VSTest/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj b/Documentation/Examples/VSTest/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj index ea3c58201..b68136fde 100644 --- a/Documentation/Examples/VSTest/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj +++ b/Documentation/Examples/VSTest/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj @@ -1,14 +1,17 @@ - + - netcoreapp3.1 + net6.0 false - - - + + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/Documentation/Examples/VSTest/HelloWorld/XUnitTestProject1/XUnitTestProject1.csproj b/Documentation/Examples/VSTest/HelloWorld/XUnitTestProject1/XUnitTestProject1.csproj index 3000c34e8..163f18bd9 100644 --- a/Documentation/Examples/VSTest/HelloWorld/XUnitTestProject1/XUnitTestProject1.csproj +++ b/Documentation/Examples/VSTest/HelloWorld/XUnitTestProject1/XUnitTestProject1.csproj @@ -1,15 +1,18 @@ - netcoreapp3.1 + net6.0 false - - - - + + + + all + runtime; build; native; contentfiles; analyzers + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/README.md b/README.md index c60b9d37c..18d1fc9dc 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ # Coverlet -[![Build Status](https://dev.azure.com/tonerdo/coverlet/_apis/build/status/coverlet-coverage.coverlet?branchName=master)](https://dev.azure.com/tonerdo/coverlet/_build/latest?definitionId=5&branchName=master) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/coverlet-coverage/coverlet/blob/master/LICENSE) +[![Build Status](https://dev.azure.com/tonerdo/coverlet/_apis/build/status/coverlet-coverage.coverlet?branchName=master)](https://dev.azure.com/tonerdo/coverlet/_build/latest?definitionId=5&branchName=master) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/coverlet-coverage/coverlet/blob/master/LICENSE) | Driver | Current version | Downloads | |---|---|---| -| coverlet.collector | [![NuGet](https://img.shields.io/nuget/v/coverlet.collector.svg)](https://www.nuget.org/packages/coverlet.collector/) | [![NuGet](https://img.shields.io/nuget/dt/coverlet.collector.svg)](https://www.nuget.org/packages/coverlet.collector/) +| coverlet.collector | [![NuGet](https://img.shields.io/nuget/v/coverlet.collector.svg)](https://www.nuget.org/packages/coverlet.collector/) | [![NuGet](https://img.shields.io/nuget/dt/coverlet.collector.svg)](https://www.nuget.org/packages/coverlet.collector/) | coverlet.msbuild | [![NuGet](https://img.shields.io/nuget/v/coverlet.msbuild.svg)](https://www.nuget.org/packages/coverlet.msbuild/) | [![NuGet](https://img.shields.io/nuget/dt/coverlet.msbuild.svg)](https://www.nuget.org/packages/coverlet.msbuild/) | | coverlet.console | [![NuGet](https://img.shields.io/nuget/v/coverlet.console.svg)](https://www.nuget.org/packages/coverlet.console/) | [![NuGet](https://img.shields.io/nuget/dt/coverlet.console.svg)](https://www.nuget.org/packages/coverlet.console/) | Coverlet is a cross platform code coverage framework for .NET, with support for line, branch and method coverage. It works with .NET Framework on Windows and .NET Core on all supported platforms. -**Coverlet documentation reflect the current repository state of the features, not the released ones.** +**Coverlet documentation reflect the current repository state of the features, not the released ones.** **Check the [changelog](Documentation/Changelog.md) to understand if the documented feature you want to use has been officially released.** # Main contents @@ -28,13 +28,13 @@ Coverlet is a cross platform code coverage framework for .NET, with support for ## Quick Start -Coverlet can be used through three different *drivers* +Coverlet can be used through three different *drivers* * VSTest engine integration * MSBuild task integration * As a .NET Global tool (supports standalone integration tests) -Coverlet supports only SDK-style projects https://docs.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2019 +Coverlet supports only SDK-style projects https://docs.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2019 ### VSTest Integration (preferred due to [known issue](https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/KnownIssues.md#1-vstest-stops-process-execution-earlydotnet-test)) @@ -43,7 +43,7 @@ Coverlet supports only SDK-style projects https://docs.microsoft.com/en-us/visua ```bash dotnet add package coverlet.collector ``` -N.B. You **MUST** add package only to test projects and if you create xunit test projects (`dotnet new xunit`) you'll find the reference already present in `csproj` file because Coverlet is the default coverage tool for every .NET Core and >= .NET 5 applications, you've only to update to last version if needed. +N.B. You **MUST** add package only to test projects and if you create xunit test projects (`dotnet new xunit`) you'll find the reference already present in `csproj` file because Coverlet is the default coverage tool for every .NET Core and >= .NET 6 applications, you've only to update to last version if needed. ### Usage Coverlet is integrated into the Visual Studio Test Platform as a [data collector](https://github.com/Microsoft/vstest-docs/blob/master/docs/extensions/datacollector.md). To get coverage simply run the following command: @@ -57,10 +57,10 @@ After the above command is run, a `coverage.cobertura.xml` file containing the r See [documentation](Documentation/VSTestIntegration.md) for advanced usage. #### Requirements -* _You need to be running .NET Core SDK v2.2.401 or newer_ -* _You need to reference version 16.5.0 and above of Microsoft.NET.Test.Sdk_ +* _You need to be running .NET 6.0 SDK v6.0.404 or newer_ +* _You need to reference version 17.4.0 and above of Microsoft.NET.Test.Sdk_ ``` - + ``` ### MSBuild Integration (suffers of possible [known issue](https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/KnownIssues.md#1-vstest-stops-process-execution-earlydotnet-test)) @@ -69,7 +69,7 @@ See [documentation](Documentation/VSTestIntegration.md) for advanced usage. ```bash dotnet add package coverlet.msbuild ``` -N.B. You **MUST** add package only to test projects +N.B. You **MUST** add package only to test projects ### Usage @@ -111,7 +111,7 @@ See [documentation](Documentation/GlobalTool.md) for advanced usage. #### Requirements .NET global tools rely on a .NET Core runtime installed on your machine https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools#what-could-go-wrong -.NET Coverlet global tool requires _.NET Core 2.2 and above_ +.NET Coverlet global tool requires _.NET 6.0 and above_ ## How It Works @@ -131,14 +131,14 @@ Coverlet generates code coverage information by going through the following proc ## Deterministic build support -Coverlet supports coverage for deterministic builds. The solution at the moment is not optimal and need a workaround. +Coverlet supports coverage for deterministic builds. The solution at the moment is not optimal and need a workaround. Take a look at [documentation](Documentation/DeterministicBuild.md). ## Are you in trouble with some feature? Check on [examples](Documentation/Examples.md)! ## Known Issues -Unfortunately we have some known issues, check it [here](Documentation/KnownIssues.md) +Unfortunately we have some known issues, check it [here](Documentation/KnownIssues.md) ## Cake Add-In @@ -166,12 +166,12 @@ If you find a bug or have a feature request, please report them at this reposito ## Coverlet Team -Author and owner -* [Toni Solarin-Sodara](https://github.com/tonerdo) +Author and owner +* [Toni Solarin-Sodara](https://github.com/tonerdo) Co-maintainers -* [Peter Liljenberg](https://github.com/petli) +* [Peter Liljenberg](https://github.com/petli) * [David Müller](https://github.com/daveMueller) * [Marco Rossignoli](https://github.com/MarcoRossignoli) @@ -188,6 +188,6 @@ Part of the code is based on work done by OpenCover team https://github.com/Open ## License -This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info. - +This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info. + ## Supported by the [.NET Foundation](https://dotnetfoundation.org/) diff --git a/coverlet.sln b/coverlet.sln index efccfa31f..6541b0030 100644 --- a/coverlet.sln +++ b/coverlet.sln @@ -35,6 +35,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution DeterministicBuild.targets = DeterministicBuild.targets Directory.Build.props = Directory.Build.props Directory.Build.targets = Directory.Build.targets + Directory.Packages.props = Directory.Packages.props global.json = global.json EndProjectSection EndProject diff --git a/eng/build.yml b/eng/build.yml index e4db0b0a6..97daac095 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -1,13 +1,13 @@ steps: - task: UseDotNet@2 inputs: - version: 3.1.404 - displayName: Install .NET Core SDK 3.1.404 + version: 6.0.404 + displayName: Install .NET 6.0 SDK 6.0.404 - task: UseDotNet@2 inputs: - version: 5.0.401 - displayName: Install .NET Core SDK 5.0.401 + version: 7.0.101 + displayName: Install .NET 7.0 SDK 7.0.101 - task: UseDotNet@2 inputs: diff --git a/src/coverlet.collector/Properties/AssemblyInfo.cs b/src/coverlet.collector/Properties/AssemblyInfo.cs deleted file mode 100644 index 4d4a63712..000000000 --- a/src/coverlet.collector/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Toni Solarin-Sodara -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyKeyFile("coverlet.collector.snk")] -[assembly: InternalsVisibleTo("coverlet.core.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100757cf9291d78a82e5bb58a827a3c46c2f959318327ad30d1b52e918321ffbd847fb21565b8576d2a3a24562a93e86c77a298b564a0f1b98f63d7a1441a3a8bcc206da3ed09d5dacc76e122a109a9d3ac608e21a054d667a2bae98510a1f0f653c0e6f58f42b4b3934f6012f5ec4a09b3dfd3e14d437ede1424bdb722aead64ad")] -[assembly: InternalsVisibleTo("coverlet.collector.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed0ed6af9693182615b8dcadc83c918b8d36312f86cefc69539d67d4189cd1b89420e7c3871802ffef7f5ca7816c68ad856c77bf7c230cc07824d96aa5d1237eebd30e246b9a14e22695fb26b40c800f74ea96619092cbd3a5d430d6c003fc7a82e8ccd1e315b935105d9232fe9e99e8d7ff54bba6f191959338d4a3169df9b3")] -// Needed to mock internal type https://github.com/Moq/moq4/wiki/Quickstart#advanced-features -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] \ No newline at end of file diff --git a/src/coverlet.collector/build/netstandard1.0/coverlet.collector.targets b/src/coverlet.collector/build/netstandard2.0/coverlet.collector.targets similarity index 98% rename from src/coverlet.collector/build/netstandard1.0/coverlet.collector.targets rename to src/coverlet.collector/build/netstandard2.0/coverlet.collector.targets index 7bd7b28e7..d677b68e8 100644 --- a/src/coverlet.collector/build/netstandard1.0/coverlet.collector.targets +++ b/src/coverlet.collector/build/netstandard2.0/coverlet.collector.targets @@ -26,7 +26,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and <_CoverletSdkNETCoreSdkVersion>$(NETCoreSdkVersion) <_CoverletSdkNETCoreSdkVersion Condition="$(_CoverletSdkNETCoreSdkVersion.Contains('-'))">$(_CoverletSdkNETCoreSdkVersion.Split('-')[0]) - <_CoverletSdkMinVersionWithDependencyTarget>3.1.300 + <_CoverletSdkMinVersionWithDependencyTarget>6.0.404 <_CoverletSourceRootTargetName>CoverletGetPathMap <_CoverletSourceRootTargetName Condition="'$([System.Version]::Parse($(_CoverletSdkNETCoreSdkVersion)).CompareTo($([System.Version]::Parse($(_CoverletSdkMinVersionWithDependencyTarget)))))' >= '0' ">InitializeSourceRootMappedPaths diff --git a/src/coverlet.collector/coverlet.collector.csproj b/src/coverlet.collector/coverlet.collector.csproj index ba206705c..307555ffb 100644 --- a/src/coverlet.collector/coverlet.collector.csproj +++ b/src/coverlet.collector/coverlet.collector.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 coverlet.collector @@ -15,6 +15,8 @@ $(TargetsForTfmSpecificContentInPackage);PackBuildOutputs $(NoWarn);NU5127 + true + true @@ -30,8 +32,16 @@ Coverlet is a cross platform code coverage library for .NET, with support for line, branch and method coverage. coverage testing unit-test lcov opencover quality git + True + coverlet.collector.snk + + + + + + @@ -79,9 +89,9 @@ - - - + + + diff --git a/src/coverlet.console/Properties/AssemblyInfo.cs b/src/coverlet.console/Properties/AssemblyInfo.cs deleted file mode 100644 index 59db2a82f..000000000 --- a/src/coverlet.console/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) Toni Solarin-Sodara -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -[assembly: System.Reflection.AssemblyKeyFileAttribute("coverlet.console.snk")] \ No newline at end of file diff --git a/src/coverlet.core/Instrumentation/Instrumenter.cs b/src/coverlet.core/Instrumentation/Instrumenter.cs index df43496c9..8c2d2400f 100644 --- a/src/coverlet.core/Instrumentation/Instrumenter.cs +++ b/src/coverlet.core/Instrumentation/Instrumenter.cs @@ -110,7 +110,7 @@ public bool CanInstrument() { return true; } - + if (embeddedPdb) { return _instrumentationHelper.EmbeddedPortablePdbHasLocalSource(_module, _excludeAssembliesWithoutSources); diff --git a/src/coverlet.core/Properties/AssemblyInfo.cs b/src/coverlet.core/Properties/AssemblyInfo.cs deleted file mode 100644 index 7e65be514..000000000 --- a/src/coverlet.core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Toni Solarin-Sodara -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyKeyFile("coverlet.core.snk")] - -[assembly: InternalsVisibleTo("coverlet.msbuild.tasks, PublicKey=0024000004800000940000000602000000240000525341310004000001000100e5f154a600df71cbdc8a8e69af077379c00889b9a597fbcac536c114911641809ef03b34a33dbe7befe8ea76535889175098bda0710bce04e321689e4458fc7515ca4a074b8618ad61489ec4d71171352e73ed04baeb1d8b8e4855342ef217968da2eebdfc53e119cdd93500a973974a3aed57c400f9bb187f784b0a0924099b")] -[assembly: InternalsVisibleTo("coverlet.console, PublicKey=00240000048000009400000006020000002400005253413100040000010001002515029761c695320036d518d74cc27defddd346afbfb4f16152ae3f4f0e779ae2fe048671a4ac3af595625db8e59fa3b5eeac22c06eacaebb54137ee8973449b68c5da8bbef903c2ac2d0b54143faf82f1b813fd24facfd5b6c7041ae5955ec63ba17cc57037b98eecbe44c7d2833c3aeabcc4e23109763f580067a74adacae")] -[assembly: InternalsVisibleTo("coverlet.collector, PublicKey=00240000048000009400000006020000002400005253413100040000010001003d23b9ef372215da7c81af920b919db5799fd021a1ca10b2e9e0ddac71237a29f8f6361a805a747457e561a7d616417f1870cda099486df25d580a4e11a0738293342881566254d7840e42f42fb9bfd8e8dca354df7dc68db14b2d0cd79bb2bf7afdbd62bd948d81b534cba7a326cf6ee840a1aee5dba0a1c660b30813ca99e5")] - -[assembly: InternalsVisibleTo("coverlet.core.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100757cf9291d78a82e5bb58a827a3c46c2f959318327ad30d1b52e918321ffbd847fb21565b8576d2a3a24562a93e86c77a298b564a0f1b98f63d7a1441a3a8bcc206da3ed09d5dacc76e122a109a9d3ac608e21a054d667a2bae98510a1f0f653c0e6f58f42b4b3934f6012f5ec4a09b3dfd3e14d437ede1424bdb722aead64ad")] -[assembly: InternalsVisibleTo("coverlet.collector.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed0ed6af9693182615b8dcadc83c918b8d36312f86cefc69539d67d4189cd1b89420e7c3871802ffef7f5ca7816c68ad856c77bf7c230cc07824d96aa5d1237eebd30e246b9a14e22695fb26b40c800f74ea96619092cbd3a5d430d6c003fc7a82e8ccd1e315b935105d9232fe9e99e8d7ff54bba6f191959338d4a3169df9b3")] -[assembly: InternalsVisibleTo("coverlet.integration.tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010001d24efbe9cbc2dc49b7a3d2ae34ca37cfb69b4f450acd768a22ce5cd021c8a38ae7dc68b2809a1ac606ad531b578f192a5690b2986990cbda4dd84ec65a3a4c1c36f6d7bb18f08592b93091535eaee2f0c8e48763ed7f190db2008e1f9e0facd5c0df5aaab74febd3430e09a428a72e5e6b88357f92d78e47512d46ebdc3cbb")] -// Needed to mock internal type https://github.com/Moq/moq4/wiki/Quickstart#advanced-features -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] \ No newline at end of file diff --git a/src/coverlet.core/coverlet.core.csproj b/src/coverlet.core/coverlet.core.csproj index 93a6c972d..33e810c8a 100644 --- a/src/coverlet.core/coverlet.core.csproj +++ b/src/coverlet.core/coverlet.core.csproj @@ -1,18 +1,32 @@ - + Library netstandard2.0 false + True + coverlet.core.snk + + + + + + + + + + + + + + + - - - diff --git a/src/coverlet.msbuild.tasks/Properties/AssemblyInfo.cs b/src/coverlet.msbuild.tasks/Properties/AssemblyInfo.cs deleted file mode 100644 index 4ff5754c3..000000000 --- a/src/coverlet.msbuild.tasks/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Toni Solarin-Sodara -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyKeyFile("coverlet.msbuild.tasks.snk")] -[assembly: InternalsVisibleTo("coverlet.core.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100757cf9291d78a82e5bb58a827a3c46c2f959318327ad30d1b52e918321ffbd847fb21565b8576d2a3a24562a93e86c77a298b564a0f1b98f63d7a1441a3a8bcc206da3ed09d5dacc76e122a109a9d3ac608e21a054d667a2bae98510a1f0f653c0e6f58f42b4b3934f6012f5ec4a09b3dfd3e14d437ede1424bdb722aead64ad")] \ No newline at end of file diff --git a/src/coverlet.msbuild.tasks/coverlet.msbuild.targets b/src/coverlet.msbuild.tasks/coverlet.msbuild.targets index ed288de59..d001f8af9 100644 --- a/src/coverlet.msbuild.tasks/coverlet.msbuild.targets +++ b/src/coverlet.msbuild.tasks/coverlet.msbuild.targets @@ -6,7 +6,7 @@ <_CoverletSdkNETCoreSdkVersion>$(NETCoreSdkVersion) <_CoverletSdkNETCoreSdkVersion Condition="$(_CoverletSdkNETCoreSdkVersion.Contains('-'))">$(_CoverletSdkNETCoreSdkVersion.Split('-')[0]) - <_CoverletSdkMinVersionWithDependencyTarget>3.1.300 + <_CoverletSdkMinVersionWithDependencyTarget>6.0.404 <_CoverletSourceRootTargetName>CoverletGetPathMap <_CoverletSourceRootTargetName Condition="'$([System.Version]::Parse($(_CoverletSdkNETCoreSdkVersion)).CompareTo($([System.Version]::Parse($(_CoverletSdkMinVersionWithDependencyTarget)))))' >= '0' ">InitializeSourceRootMappedPaths diff --git a/src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj b/src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj index 80cbb6b21..5d7667cf1 100644 --- a/src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj +++ b/src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj @@ -1,4 +1,4 @@ - + Library @@ -8,6 +8,8 @@ $(TargetsForTfmSpecificContentInPackage);PackBuildOutputs build false + True + coverlet.msbuild.tasks.snk true + true + true @@ -32,6 +36,10 @@ coverage testing unit-test lcov opencover quality git + + + + diff --git a/test/coverlet.collector.tests/coverlet.collector.tests.csproj b/test/coverlet.collector.tests/coverlet.collector.tests.csproj index fa828394a..87826ac9d 100644 --- a/test/coverlet.collector.tests/coverlet.collector.tests.csproj +++ b/test/coverlet.collector.tests/coverlet.collector.tests.csproj @@ -1,4 +1,4 @@ - + diff --git a/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj b/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj index 41f8d5bd3..dc8096405 100644 --- a/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj +++ b/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj @@ -1,4 +1,4 @@ - + @@ -7,7 +7,9 @@ + + diff --git a/test/coverlet.core.tests.samples.netstandard/coverlet.core.tests.samples.netstandard.csproj b/test/coverlet.core.tests.samples.netstandard/coverlet.core.tests.samples.netstandard.csproj index 783e0d0c3..369fbc165 100644 --- a/test/coverlet.core.tests.samples.netstandard/coverlet.core.tests.samples.netstandard.csproj +++ b/test/coverlet.core.tests.samples.netstandard/coverlet.core.tests.samples.netstandard.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 false @@ -6,7 +6,7 @@ - + diff --git a/test/coverlet.core.tests/coverlet.core.tests.csproj b/test/coverlet.core.tests/coverlet.core.tests.csproj index f040aa9c3..52683c064 100644 --- a/test/coverlet.core.tests/coverlet.core.tests.csproj +++ b/test/coverlet.core.tests/coverlet.core.tests.csproj @@ -1,4 +1,4 @@ - + @@ -34,12 +34,15 @@ - + - + - - + + + + + diff --git a/test/coverlet.integration.determisticbuild/coverlet.integration.determisticbuild.csproj b/test/coverlet.integration.determisticbuild/coverlet.integration.determisticbuild.csproj index b79d89433..7b9374b28 100644 --- a/test/coverlet.integration.determisticbuild/coverlet.integration.determisticbuild.csproj +++ b/test/coverlet.integration.determisticbuild/coverlet.integration.determisticbuild.csproj @@ -1,4 +1,4 @@ - + @@ -13,11 +13,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/coverlet.integration.template/coverlet.integration.template.csproj b/test/coverlet.integration.template/coverlet.integration.template.csproj index d1639d96f..267fdd54c 100644 --- a/test/coverlet.integration.template/coverlet.integration.template.csproj +++ b/test/coverlet.integration.template/coverlet.integration.template.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -7,11 +7,15 @@ false Exe false + false - - + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/test/coverlet.integration.tests/Collectors.cs b/test/coverlet.integration.tests/Collectors.cs index 262f29d58..6f1bff995 100644 --- a/test/coverlet.integration.tests/Collectors.cs +++ b/test/coverlet.integration.tests/Collectors.cs @@ -8,11 +8,11 @@ namespace Coverlet.Integration.Tests { - public class TestSDK_16_2_0 : Collectors + public class TestSDK_17_3_2 : Collectors { - public TestSDK_16_2_0() + public TestSDK_17_3_2() { - TestSDKVersion = "16.2.0"; + TestSDKVersion = "17.3.2"; } private protected override void AssertCollectorsInjection(ClonedTemplateProject clonedTemplateProject) @@ -26,11 +26,11 @@ private protected override void AssertCollectorsInjection(ClonedTemplateProject } } - public class TestSDK_16_5_0 : Collectors + public class TestSDK_17_4_0 : Collectors { - public TestSDK_16_5_0() + public TestSDK_17_4_0() { - TestSDKVersion = "16.5.0"; + TestSDKVersion = "17.4.0"; } } @@ -38,7 +38,7 @@ public class TestSDK_Preview : Collectors { public TestSDK_Preview() { - TestSDKVersion = "16.5.0-preview-20200203-01"; + TestSDKVersion = "17.5.0-preview-20221003-04"; } } diff --git a/test/coverlet.integration.tests/DotnetTool.cs b/test/coverlet.integration.tests/DotnetTool.cs index 58f2521ac..0cd54b04e 100644 --- a/test/coverlet.integration.tests/DotnetTool.cs +++ b/test/coverlet.integration.tests/DotnetTool.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Coverlet.Tests.Xunit.Extensions; +using System.Diagnostics; using System.IO; using System.Linq; using Xunit; @@ -14,6 +15,7 @@ private string InstallTool(string projectPath) { _ = DotnetCli($"tool install coverlet.console --version {GetPackageVersion("*console*.nupkg")} --tool-path \"{Path.Combine(projectPath, "coverletTool")}\"", out string standardOutput, out _, projectPath); Assert.Contains("was successfully installed.", standardOutput); + Debug.WriteLine($"dotnet tool installed - toolpath: {projectPath}\\coverletTool"); return Path.Combine(projectPath, "coverletTool", "coverlet "); } diff --git a/test/coverlet.integration.tests/coverlet.integration.tests.csproj b/test/coverlet.integration.tests/coverlet.integration.tests.csproj index 6de30285a..da1519d69 100644 --- a/test/coverlet.integration.tests/coverlet.integration.tests.csproj +++ b/test/coverlet.integration.tests/coverlet.integration.tests.csproj @@ -4,6 +4,7 @@ net6.0 false enable + win-x64;linux-x64;osx-x64 diff --git a/test/coverlet.tests.projectsample.fsharp/coverlet.tests.projectsample.fsharp.fsproj b/test/coverlet.tests.projectsample.fsharp/coverlet.tests.projectsample.fsharp.fsproj index cd7a95969..14224c9a0 100644 --- a/test/coverlet.tests.projectsample.fsharp/coverlet.tests.projectsample.fsharp.fsproj +++ b/test/coverlet.tests.projectsample.fsharp/coverlet.tests.projectsample.fsharp.fsproj @@ -5,6 +5,7 @@ true false false + false diff --git a/test/coverlet.tests.projectsample.netframework/coverlet.tests.projectsample.netframework.csproj b/test/coverlet.tests.projectsample.netframework/coverlet.tests.projectsample.netframework.csproj index 822b965de..5d0f32c22 100644 --- a/test/coverlet.tests.projectsample.netframework/coverlet.tests.projectsample.netframework.csproj +++ b/test/coverlet.tests.projectsample.netframework/coverlet.tests.projectsample.netframework.csproj @@ -7,8 +7,9 @@ - - all - + + all + runtime; build; native; contentfiles; analyzers + \ No newline at end of file diff --git a/test/coverlet.tests.remoteexecutor/coverlet.tests.remoteexecutor.csproj b/test/coverlet.tests.remoteexecutor/coverlet.tests.remoteexecutor.csproj index 5167d6c7e..e1088dcfb 100644 --- a/test/coverlet.tests.remoteexecutor/coverlet.tests.remoteexecutor.csproj +++ b/test/coverlet.tests.remoteexecutor/coverlet.tests.remoteexecutor.csproj @@ -1,8 +1,8 @@ - + Exe - netcoreapp3.1 + net6.0;net7.0 Coverlet.Tests.RemoteExecutor false false diff --git a/test/coverlet.tests.xunit.extensions/coverlet.tests.xunit.extensions.csproj b/test/coverlet.tests.xunit.extensions/coverlet.tests.xunit.extensions.csproj index 3003d7511..1daa0c2fe 100644 --- a/test/coverlet.tests.xunit.extensions/coverlet.tests.xunit.extensions.csproj +++ b/test/coverlet.tests.xunit.extensions/coverlet.tests.xunit.extensions.csproj @@ -8,5 +8,6 @@ + From a7282216ec50a3eea5bda7a0579ca47ca8a89c11 Mon Sep 17 00:00:00 2001 From: Bert Date: Sat, 7 Jan 2023 10:07:28 +0100 Subject: [PATCH 02/11] update McMaster.Extensions.CommandLineUtils version use .NET SDK 7.0.200 check null value for coverage --- Directory.Packages.props | 32 +++++++++---------- eng/azure-pipelines-nightly.yml | 8 ++--- eng/build.yml | 8 ++--- .../coverlet.collector.csproj | 11 +++++-- src/coverlet.console/Program.cs | 4 +-- src/coverlet.core/coverlet.core.csproj | 3 +- .../coverlet.msbuild.tasks.csproj | 1 - .../coverlet.collector.tests.csproj | 3 +- .../coverlet.core.performancetest.csproj | 2 +- .../ModuleTrackerTemplateTests.cs | 26 +++++++-------- .../coverlet.core.tests.csproj | 3 +- ...verlet.integration.determisticbuild.csproj | 3 +- .../coverlet.integration.template.csproj | 3 +- test/coverlet.integration.tests/Collectors.cs | 8 ++--- .../coverlet.integration.tests.csproj | 2 +- .../coverlet.tests.projectsample.empty.csproj | 1 + ...s.projectsample.excludedbyattribute.csproj | 1 + ...coverlet.tests.projectsample.fsharp.fsproj | 1 + ...t.tests.projectsample.vbmynamespace.vbproj | 3 +- .../coverlet.tests.xunit.extensions.csproj | 3 +- .../coverlet.testsubject.csproj | 1 + 21 files changed, 69 insertions(+), 58 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 8da7b434d..0c3a22d2a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,6 +1,6 @@ - true + false @@ -9,9 +9,11 @@ + - + + @@ -20,39 +22,35 @@ - + - - + + - - - - + + + + - - - + - - - + + + - - diff --git a/eng/azure-pipelines-nightly.yml b/eng/azure-pipelines-nightly.yml index 3535bd2bc..3c3bd6ea1 100644 --- a/eng/azure-pipelines-nightly.yml +++ b/eng/azure-pipelines-nightly.yml @@ -4,13 +4,13 @@ pool: steps: - task: UseDotNet@2 inputs: - version: 3.1.404 - displayName: Install .NET Core SDK 3.1.404 + version: 6.0.406 + displayName: Install .NET Core SDK 6.0.406 - task: UseDotNet@2 inputs: - version: 5.0.401 - displayName: Install .NET Core SDK 5.0.401 + version: 7.0.200 + displayName: Install .NET Core SDK 7.0.200 - task: NuGetAuthenticate@0 displayName: Authenticate with NuGet feeds diff --git a/eng/build.yml b/eng/build.yml index 97daac095..232a7a56f 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -1,13 +1,13 @@ steps: - task: UseDotNet@2 inputs: - version: 6.0.404 - displayName: Install .NET 6.0 SDK 6.0.404 + version: 6.0.406 + displayName: Install .NET 6.0 SDK 6.0.406 - task: UseDotNet@2 inputs: - version: 7.0.101 - displayName: Install .NET 7.0 SDK 7.0.101 + version: 7.0.200 + displayName: Install .NET 7.0 SDK 7.0.200 - task: UseDotNet@2 inputs: diff --git a/src/coverlet.collector/coverlet.collector.csproj b/src/coverlet.collector/coverlet.collector.csproj index 307555ffb..aa26a3a08 100644 --- a/src/coverlet.collector/coverlet.collector.csproj +++ b/src/coverlet.collector/coverlet.collector.csproj @@ -15,7 +15,6 @@ $(TargetsForTfmSpecificContentInPackage);PackBuildOutputs $(NoWarn);NU5127 - true true @@ -44,6 +43,8 @@ + + @@ -89,9 +90,13 @@ - + + + + + - + diff --git a/src/coverlet.console/Program.cs b/src/coverlet.console/Program.cs index d967f90d6..91ee525de 100644 --- a/src/coverlet.console/Program.cs +++ b/src/coverlet.console/Program.cs @@ -47,7 +47,7 @@ static int Main(string[] args) FullName = "Cross platform .NET Core code coverage tool" }; app.HelpOption("-h|--help"); - app.VersionOption("-v|--version", GetAssemblyVersion()); + app.VersionOption("--version", GetAssemblyVersion()); int exitCode = (int)CommandExitCodes.Success; CommandArgument moduleOrAppDirectory = app.Argument("", "Path to the test assembly or application directory."); @@ -139,7 +139,7 @@ static int Main(string[] args) process.WaitForExit(); string dOutput = output.HasValue() ? output.Value() : Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar.ToString(); - List dThresholdTypes = thresholdTypes.HasValue() ? thresholdTypes.Values : new List(new string[] { "line", "branch", "method" }); + List dThresholdTypes = (List)(thresholdTypes.HasValue() ? thresholdTypes.Values : new List(new string[] { "line", "branch", "method" })); ThresholdStatistic dThresholdStat = thresholdStat.HasValue() ? Enum.Parse(thresholdStat.Value(), true) : Enum.Parse("minimum", true); logger.LogInformation("\nCalculating coverage result..."); diff --git a/src/coverlet.core/coverlet.core.csproj b/src/coverlet.core/coverlet.core.csproj index 33e810c8a..22e06b04d 100644 --- a/src/coverlet.core/coverlet.core.csproj +++ b/src/coverlet.core/coverlet.core.csproj @@ -12,7 +12,7 @@ - + @@ -27,6 +27,7 @@ + diff --git a/src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj b/src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj index 5d7667cf1..721478ba2 100644 --- a/src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj +++ b/src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj @@ -17,7 +17,6 @@ If you are packing with NuGet's MSBuild Pack target, you can set true in any PropertyGroup in your project file. --> true - true true diff --git a/test/coverlet.collector.tests/coverlet.collector.tests.csproj b/test/coverlet.collector.tests/coverlet.collector.tests.csproj index 87826ac9d..2224683ab 100644 --- a/test/coverlet.collector.tests/coverlet.collector.tests.csproj +++ b/test/coverlet.collector.tests/coverlet.collector.tests.csproj @@ -9,7 +9,8 @@ - + + all runtime; build; native; contentfiles; analyzers diff --git a/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj b/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj index dc8096405..4582069a0 100644 --- a/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj +++ b/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/coverlet.core.tests/Instrumentation/ModuleTrackerTemplateTests.cs b/test/coverlet.core.tests/Instrumentation/ModuleTrackerTemplateTests.cs index 7cd5f2943..74957858e 100644 --- a/test/coverlet.core.tests/Instrumentation/ModuleTrackerTemplateTests.cs +++ b/test/coverlet.core.tests/Instrumentation/ModuleTrackerTemplateTests.cs @@ -123,26 +123,24 @@ public void MutexBlocksMultipleWriters() FunctionExecutor.Run(async () => { using var ctx = new TrackerContext(); - using (var mutex = new Mutex( - true, Path.GetFileNameWithoutExtension(ModuleTrackerTemplate.HitsFilePath) + "_Mutex", out bool createdNew)) - { - Assert.True(createdNew); + using var mutex = new Mutex( + true, Path.GetFileNameWithoutExtension(ModuleTrackerTemplate.HitsFilePath) + "_Mutex", out bool createdNew); + Assert.True(createdNew); - ModuleTrackerTemplate.HitsArray = new[] { 0, 1, 2, 3 }; - var unloadTask = Task.Run(() => ModuleTrackerTemplate.UnloadModule(null, null)); + ModuleTrackerTemplate.HitsArray = new[] { 0, 1, 2, 3 }; + var unloadTask = Task.Run(() => ModuleTrackerTemplate.UnloadModule(null, null)); - Assert.False(unloadTask.Wait(5)); + Assert.False(unloadTask.Wait(5)); - WriteHitsFile(new[] { 0, 3, 2, 1 }); + WriteHitsFile(new[] { 0, 3, 2, 1 }); - Assert.False(unloadTask.Wait(5)); + Assert.False(unloadTask.Wait(5)); - mutex.ReleaseMutex(); - await unloadTask; + mutex.ReleaseMutex(); + await unloadTask; - int[] expectedHitsArray = new[] { 0, 4, 4, 4 }; - Assert.Equal(expectedHitsArray, ReadHitsFile()); - } + int[] expectedHitsArray = new[] { 0, 4, 4, 4 }; + Assert.Equal(expectedHitsArray, ReadHitsFile()); return 0; }); diff --git a/test/coverlet.core.tests/coverlet.core.tests.csproj b/test/coverlet.core.tests/coverlet.core.tests.csproj index 52683c064..c0f77ba13 100644 --- a/test/coverlet.core.tests/coverlet.core.tests.csproj +++ b/test/coverlet.core.tests/coverlet.core.tests.csproj @@ -15,7 +15,8 @@ - + + diff --git a/test/coverlet.integration.determisticbuild/coverlet.integration.determisticbuild.csproj b/test/coverlet.integration.determisticbuild/coverlet.integration.determisticbuild.csproj index 7b9374b28..31593dfd8 100644 --- a/test/coverlet.integration.determisticbuild/coverlet.integration.determisticbuild.csproj +++ b/test/coverlet.integration.determisticbuild/coverlet.integration.determisticbuild.csproj @@ -21,7 +21,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + + diff --git a/test/coverlet.integration.template/coverlet.integration.template.csproj b/test/coverlet.integration.template/coverlet.integration.template.csproj index 267fdd54c..78d9954f5 100644 --- a/test/coverlet.integration.template/coverlet.integration.template.csproj +++ b/test/coverlet.integration.template/coverlet.integration.template.csproj @@ -11,7 +11,8 @@ - + + all runtime; build; native; contentfiles; analyzers diff --git a/test/coverlet.integration.tests/Collectors.cs b/test/coverlet.integration.tests/Collectors.cs index 6f1bff995..72265507f 100644 --- a/test/coverlet.integration.tests/Collectors.cs +++ b/test/coverlet.integration.tests/Collectors.cs @@ -26,11 +26,11 @@ private protected override void AssertCollectorsInjection(ClonedTemplateProject } } - public class TestSDK_17_4_0 : Collectors + public class TestSDK_17_5_0 : Collectors { - public TestSDK_17_4_0() + public TestSDK_17_5_0() { - TestSDKVersion = "17.4.0"; + TestSDKVersion = "17.5.0"; } } @@ -38,7 +38,7 @@ public class TestSDK_Preview : Collectors { public TestSDK_Preview() { - TestSDKVersion = "17.5.0-preview-20221003-04"; + TestSDKVersion = "17.5.0-preview-20221221-03"; } } diff --git a/test/coverlet.integration.tests/coverlet.integration.tests.csproj b/test/coverlet.integration.tests/coverlet.integration.tests.csproj index da1519d69..6669fa2bf 100644 --- a/test/coverlet.integration.tests/coverlet.integration.tests.csproj +++ b/test/coverlet.integration.tests/coverlet.integration.tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/test/coverlet.tests.projectsample.empty/coverlet.tests.projectsample.empty.csproj b/test/coverlet.tests.projectsample.empty/coverlet.tests.projectsample.empty.csproj index 5d4323320..9fc7ec2fc 100644 --- a/test/coverlet.tests.projectsample.empty/coverlet.tests.projectsample.empty.csproj +++ b/test/coverlet.tests.projectsample.empty/coverlet.tests.projectsample.empty.csproj @@ -4,6 +4,7 @@ netstandard2.0 false false + PackageReference diff --git a/test/coverlet.tests.projectsample.excludedbyattribute/coverlet.tests.projectsample.excludedbyattribute.csproj b/test/coverlet.tests.projectsample.excludedbyattribute/coverlet.tests.projectsample.excludedbyattribute.csproj index 3020bf383..80a9c5172 100644 --- a/test/coverlet.tests.projectsample.excludedbyattribute/coverlet.tests.projectsample.excludedbyattribute.csproj +++ b/test/coverlet.tests.projectsample.excludedbyattribute/coverlet.tests.projectsample.excludedbyattribute.csproj @@ -4,6 +4,7 @@ net6.0 false false + PackageReference diff --git a/test/coverlet.tests.projectsample.fsharp/coverlet.tests.projectsample.fsharp.fsproj b/test/coverlet.tests.projectsample.fsharp/coverlet.tests.projectsample.fsharp.fsproj index 14224c9a0..a13aee542 100644 --- a/test/coverlet.tests.projectsample.fsharp/coverlet.tests.projectsample.fsharp.fsproj +++ b/test/coverlet.tests.projectsample.fsharp/coverlet.tests.projectsample.fsharp.fsproj @@ -6,6 +6,7 @@ false false false + PackageReference diff --git a/test/coverlet.tests.projectsample.vbmynamespace/coverlet.tests.projectsample.vbmynamespace.vbproj b/test/coverlet.tests.projectsample.vbmynamespace/coverlet.tests.projectsample.vbmynamespace.vbproj index 3b626df5a..35ac6bc19 100644 --- a/test/coverlet.tests.projectsample.vbmynamespace/coverlet.tests.projectsample.vbmynamespace.vbproj +++ b/test/coverlet.tests.projectsample.vbmynamespace/coverlet.tests.projectsample.vbmynamespace.vbproj @@ -1,9 +1,10 @@ - + coverlet.tests.projectsample.vbmynamespace net48 latest + false \ No newline at end of file diff --git a/test/coverlet.tests.xunit.extensions/coverlet.tests.xunit.extensions.csproj b/test/coverlet.tests.xunit.extensions/coverlet.tests.xunit.extensions.csproj index 1daa0c2fe..1299e6ddf 100644 --- a/test/coverlet.tests.xunit.extensions/coverlet.tests.xunit.extensions.csproj +++ b/test/coverlet.tests.xunit.extensions/coverlet.tests.xunit.extensions.csproj @@ -7,7 +7,8 @@ - + + diff --git a/test/coverlet.testsubject/coverlet.testsubject.csproj b/test/coverlet.testsubject/coverlet.testsubject.csproj index 3020bf383..80a9c5172 100644 --- a/test/coverlet.testsubject/coverlet.testsubject.csproj +++ b/test/coverlet.testsubject/coverlet.testsubject.csproj @@ -4,6 +4,7 @@ net6.0 false false + PackageReference From fc1b0736296b410e464cb272e056aadbd424d005 Mon Sep 17 00:00:00 2001 From: Bert Date: Fri, 24 Feb 2023 09:08:12 +0100 Subject: [PATCH 03/11] update documentation and build pipeline update pipeline update contents parameter --- .../XUnitTestProject1.csproj | 2 +- .../XUnitTestProject1.csproj | 2 +- .../XUnitTestProject2.csproj | 2 +- .../XUnitTestProject3.csproj | 2 +- .../XUnitTestProject1.csproj | 2 +- .../XUnitTestProject1.csproj | 2 +- README.md | 6 +-- eng/build.yml | 44 +++++++++++++++++++ 8 files changed, 53 insertions(+), 9 deletions(-) diff --git a/Documentation/Examples/MSBuild/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj b/Documentation/Examples/MSBuild/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj index 651ed56cf..8b116fc0e 100644 --- a/Documentation/Examples/MSBuild/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj +++ b/Documentation/Examples/MSBuild/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj @@ -6,7 +6,7 @@ - + all diff --git a/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject1/XUnitTestProject1.csproj b/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject1/XUnitTestProject1.csproj index 043a48b1d..aafd82b4e 100644 --- a/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject1/XUnitTestProject1.csproj +++ b/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject1/XUnitTestProject1.csproj @@ -10,7 +10,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject2/XUnitTestProject2.csproj b/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject2/XUnitTestProject2.csproj index ce20ab140..c748ceae9 100644 --- a/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject2/XUnitTestProject2.csproj +++ b/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject2/XUnitTestProject2.csproj @@ -10,7 +10,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject3/XUnitTestProject3.csproj b/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject3/XUnitTestProject3.csproj index d8fc74eb8..9da421b4c 100644 --- a/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject3/XUnitTestProject3.csproj +++ b/Documentation/Examples/MSBuild/MergeWith/XUnitTestProject3/XUnitTestProject3.csproj @@ -10,7 +10,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Documentation/Examples/VSTest/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj b/Documentation/Examples/VSTest/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj index b68136fde..ba56bb3de 100644 --- a/Documentation/Examples/VSTest/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj +++ b/Documentation/Examples/VSTest/DeterministicBuild/XUnitTestProject1/XUnitTestProject1.csproj @@ -6,7 +6,7 @@ - + all diff --git a/Documentation/Examples/VSTest/HelloWorld/XUnitTestProject1/XUnitTestProject1.csproj b/Documentation/Examples/VSTest/HelloWorld/XUnitTestProject1/XUnitTestProject1.csproj index 163f18bd9..0294d0721 100644 --- a/Documentation/Examples/VSTest/HelloWorld/XUnitTestProject1/XUnitTestProject1.csproj +++ b/Documentation/Examples/VSTest/HelloWorld/XUnitTestProject1/XUnitTestProject1.csproj @@ -6,7 +6,7 @@ - + all diff --git a/README.md b/README.md index 18d1fc9dc..1287d9127 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,10 @@ After the above command is run, a `coverage.cobertura.xml` file containing the r See [documentation](Documentation/VSTestIntegration.md) for advanced usage. #### Requirements -* _You need to be running .NET 6.0 SDK v6.0.404 or newer_ -* _You need to reference version 17.4.0 and above of Microsoft.NET.Test.Sdk_ +* _You need to be running .NET 6.0 SDK v6.0.406 or newer e.g. v7.0.200_ +* _You need to reference version 17.5.0 and above of Microsoft.NET.Test.Sdk_ ``` - + ``` ### MSBuild Integration (suffers of possible [known issue](https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/KnownIssues.md#1-vstest-stops-process-execution-earlydotnet-test)) diff --git a/eng/build.yml b/eng/build.yml index 232a7a56f..98ed4b124 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -34,3 +34,47 @@ steps: command: test arguments: -c $(BuildConfiguration) --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[coverlet.collector]*%2c[coverlet.core]*%2c[coverlet.msbuild.tasks]*" /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.xunit.extensions]*" testRunTitle: $(Agent.JobName) + +- task: CopyFiles@2 + displayName: Copy Test Logs + inputs: + SourceFolder: '$(Build.SourcesDirectory)/test/coverlet.integration.tests/bin' + contents: '**/log.*' + targetFolder: $(Build.ArtifactStagingDirectory)/logs + continueOnError: true + condition: always() + +- task: CopyFiles@2 + displayName: Copy Test Results + inputs: + SourceFolder: '$(Agent.TempDirectory)' + contents: '**/*.trx' + targetFolder: $(Build.ArtifactStagingDirectory) + continueOnError: true + condition: always() + +- task: PublishBuildArtifacts@1 + displayName: Publish Test Logs + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + PublishLocation: Container + ArtifactName: 'TestLogs_$(Agent.OS)_$(BuildConfiguration)' + continueOnError: true + condition: always() + +- task: reportgenerator@5 + displayName: ReportGenerator + condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Debug')) + inputs: + reports: $(Build.SourcesDirectory)/**/coverage.opencover.xml + targetdir: $(Build.SourcesDirectory)/CoverageReport + reporttypes: Html;HtmlInline_AzurePipelines_Dark;Cobertura + verbosity: 'Verbose' + assemblyfilters: ${{parameters.assemblyfilters}} + +- task: PublishCodeCoverageResults@1 + displayName: 'Publish code coverage' + condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Debug')) + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(Build.SourcesDirectory)/CoverageReport/Cobertura.xml' From 736325bc0cf38388a954ced4d969e7492b415214 Mon Sep 17 00:00:00 2001 From: Bert Date: Fri, 24 Feb 2023 14:56:26 +0100 Subject: [PATCH 04/11] comment coverage report - task for organization is missing --- Directory.Packages.props | 11 ++++--- eng/build.yml | 30 +++++++++---------- .../Utilities/Interfaces/IDirectoryHelper.cs | 4 +-- .../CoverageTests.SelectionStatements.cs | 2 +- .../coverlet.core.tests.csproj | 1 + 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 0c3a22d2a..682ec26e8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,6 +1,6 @@ - false + true @@ -12,11 +12,9 @@ - + - - - + @@ -31,9 +29,10 @@ - + + - - - - + - From 76346f54ead91bfcda8f58fb579894315ab04524 Mon Sep 17 00:00:00 2001 From: Bert Date: Wed, 15 Mar 2023 09:54:12 +0100 Subject: [PATCH 06/11] update dependencies --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 682ec26e8..e2f85eac7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -26,10 +26,10 @@ - + - + From b52275f2e5e69425dbda9f7e0062eb5fb50c293f Mon Sep 17 00:00:00 2001 From: Bert Date: Sat, 7 Jan 2023 10:07:28 +0100 Subject: [PATCH 07/11] update McMaster.Extensions.CommandLineUtils version use .NET SDK 7.0.200 check null value for coverage --- eng/build.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/eng/build.yml b/eng/build.yml index 8c96db77b..b765540a9 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -1,14 +1,4 @@ steps: -- task: UseDotNet@2 - inputs: - version: 6.0.406 - displayName: Install .NET 6.0 SDK 6.0.406 - -- task: UseDotNet@2 - inputs: - version: 7.0.200 - displayName: Install .NET 7.0 SDK 7.0.200 - - task: UseDotNet@2 inputs: version: 6.0.408 From 13abfc29eaca237ff28f39a8ff18a07ecab79d98 Mon Sep 17 00:00:00 2001 From: Bert Date: Tue, 16 May 2023 10:14:33 +0200 Subject: [PATCH 08/11] Update dotnet SDK and avoid deprecated transitive dependencies --- Directory.Packages.props | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Directory.Packages.props b/Directory.Packages.props index e2f85eac7..c0af0a4df 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -39,7 +39,9 @@ We need to load assembly version 1.6.0 to properly work We can check minimum supported package version here https://github.com/Microsoft/vstest/blob/master/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj#L29 --> + + From d55e0975a1d751b0e3f950b167a08ddaf8f1bee9 Mon Sep 17 00:00:00 2001 From: Bert Date: Tue, 16 May 2023 10:43:54 +0200 Subject: [PATCH 09/11] update build pipeline and package versions --- Directory.Packages.props | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c0af0a4df..c372c177a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,12 +5,12 @@ - + - + @@ -24,12 +24,12 @@ - + - + @@ -44,7 +44,7 @@ - + From 625d13d71fb5b8cff25f7162a7b2819c52465ded Mon Sep 17 00:00:00 2001 From: Bert Date: Tue, 16 May 2023 10:57:54 +0200 Subject: [PATCH 10/11] start CI again From bd4717cd2e7413dfa1ca09001e5c5c711ef33a83 Mon Sep 17 00:00:00 2001 From: Bert Date: Mon, 22 May 2023 12:36:23 +0200 Subject: [PATCH 11/11] fix merge issues --- src/coverlet.console/coverlet.console.csproj | 2 ++ .../coverlet.core.performancetest.csproj | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coverlet.console/coverlet.console.csproj b/src/coverlet.console/coverlet.console.csproj index b44e05dff..a3a609c19 100644 --- a/src/coverlet.console/coverlet.console.csproj +++ b/src/coverlet.console/coverlet.console.csproj @@ -6,6 +6,8 @@ coverlet true coverlet.console + True + coverlet.console.snk diff --git a/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj b/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj index 4582069a0..979209cd1 100644 --- a/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj +++ b/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj @@ -11,7 +11,6 @@ -