Skip to content

Commit

Permalink
fix: exclude test logger assemblies from code coverage. (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
codito authored Feb 10, 2024
1 parent 0217749 commit d5babee
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased (v3.1.x)

## v3.1.x - 2024/02/10

- Update core testlogger to 3.1.140.
- Fix: exclude code coverage instrumentation for test loggers. See
https://github.com/spekt/junit.testlogger/issues/64 and
https://github.com/spekt/junit.testlogger/issues/72.

## v3.1.17 - 2023/09/17

- Fix for reporting nested test classes. See #48 and
Expand Down
2 changes: 1 addition & 1 deletion scripts/dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<MSTestVersion>3.0.4</MSTestVersion>
<NETTestSdkVersion>17.3.2</NETTestSdkVersion>
<MoqVersion>4.18.4</MoqVersion>
<TestLoggerVersion>3.1.138</TestLoggerVersion>
<TestLoggerVersion>3.1.140</TestLoggerVersion>

<!-- Test Assets use the minimum supported versions -->
<NETTestSdkMinimumVersion>15.5.0</NETTestSdkMinimumVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Xunit.Xml.TestLogger\Assembly.cs" Link="Assembly.cs" />
<Compile Include="..\Xunit.Xml.TestLogger\XunitXmlTestLogger.cs">
<Link>XunitXmlTestLogger.cs</Link>
</Compile>
Expand Down
16 changes: 16 additions & 0 deletions src/Xunit.Xml.TestLogger/Assembly.cs
Original file line number Diff line number Diff line change
@@ -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.

// <auto-generated>
// Skip code analysis errors.
// </auto-generated>

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 { }
}

0 comments on commit d5babee

Please sign in to comment.