From eb34e3c8830d8f0e1758991059fcd57f74cfb92b Mon Sep 17 00:00:00 2001 From: codito Date: Sat, 10 Feb 2024 07:01:09 +0530 Subject: [PATCH] fix: exclude testlogger assemblies from code coverage. (#104) --- CHANGELOG.md | 9 ++++++++- scripts/dependencies.props | 2 +- .../NUnit.Xml.TestLogger.TestAdapter.csproj | 1 + src/NUnit.Xml.TestLogger/Assembly.cs | 16 ++++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 src/NUnit.Xml.TestLogger/Assembly.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 92ac1f9..fd2d9c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,14 @@ ## Unreleased (v3.1.x) -- Update core testlogger to 3.1.138. +## v3.1.16 - 2024/02/10 + +- Update core testlogger to 3.1.140. +- Fix: exclude testlogger assemblies from code coverage. See + https://github.com/spekt/junit.testlogger/issues/72 and + https://github.com/spekt/junit.testlogger/issues/64. +- Fix: unknown namespace reporting for + nested classes. See https://github.com/spekt/testlogger/pull/41. ## v3.1.15 - 2023/07/06 diff --git a/scripts/dependencies.props b/scripts/dependencies.props index 63687f7..dddfc9c 100644 --- a/scripts/dependencies.props +++ b/scripts/dependencies.props @@ -4,7 +4,7 @@ 3.0.4 17.3.2 4.18.4 - 3.1.138 + 3.1.140 15.0.0 diff --git a/src/NUnit.Xml.TestLogger.TestAdapter/NUnit.Xml.TestLogger.TestAdapter.csproj b/src/NUnit.Xml.TestLogger.TestAdapter/NUnit.Xml.TestLogger.TestAdapter.csproj index 4f771d2..a1a8788 100644 --- a/src/NUnit.Xml.TestLogger.TestAdapter/NUnit.Xml.TestLogger.TestAdapter.csproj +++ b/src/NUnit.Xml.TestLogger.TestAdapter/NUnit.Xml.TestLogger.TestAdapter.csproj @@ -14,6 +14,7 @@ + NUnitXmlTestLogger.cs diff --git a/src/NUnit.Xml.TestLogger/Assembly.cs b/src/NUnit.Xml.TestLogger/Assembly.cs new file mode 100644 index 0000000..a003450 --- /dev/null +++ b/src/NUnit.Xml.TestLogger/Assembly.cs @@ -0,0 +1,16 @@ +// Copyright (c) Spekt Contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// +// Skip code analysis errors. +// + +using System.Diagnostics.CodeAnalysis; + +[assembly: ExcludeFromCodeCoverage] + +namespace System.Diagnostics.CodeAnalysis +{ + [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Event | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)] + internal sealed class ExcludeFromCodeCoverageAttribute : Attribute { } +}