Skip to content

Sign collector and update visibility #566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/coverlet.collector/DataCollection/CoverletLogger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;

using Coverlet.Collector.Utilities;
using Coverlet.Core.Abstracts;

Expand Down
8 changes: 0 additions & 8 deletions src/coverlet.collector/Friends.cs

This file was deleted.

8 changes: 8 additions & 0 deletions src/coverlet.collector/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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")]
Binary file added src/coverlet.collector/coverlet.collector.snk
Binary file not shown.
3 changes: 1 addition & 2 deletions src/coverlet.console/ConsoleTables/ConsoleTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;

namespace ConsoleTables
{
public class ConsoleTable
class ConsoleTable
{
public IList<object> Columns { get; set; }
public IList<object[]> Rows { get; protected set; }
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.console/coverlet.console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\coverlet.core\coverlet.core.csproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\coverlet.core\coverlet.core.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/coverlet.core/Abstracts/IFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Coverlet.Core.Abstracts
{
public interface IFileSystem
internal interface IFileSystem
{
bool Exists(string path);

Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Abstracts/IInstrumentationHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Coverlet.Core.Abstracts
{
public interface IInstrumentationHelper
internal interface IInstrumentationHelper
{
void BackupOriginalModule(string module, string identifier);
void DeleteHitsFile(string path);
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Abstracts/ILogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Coverlet.Core.Abstracts
{
public interface ILogger
internal interface ILogger
{
void LogVerbose(string message);
void LogInformation(string message, bool important = false);
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Attributes/ExcludeFromCoverage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
namespace Coverlet.Core.Attributes
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class)]
public sealed class ExcludeFromCoverageAttribute : Attribute { }
internal sealed class ExcludeFromCoverageAttribute : Attribute { }
}
2 changes: 1 addition & 1 deletion src/coverlet.core/Coverage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Coverlet.Core
{
public class Coverage
internal class Coverage
{
private string _module;
private string _identifier;
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/CoverageDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Coverlet.Core
{
public class CoverageDetails
internal class CoverageDetails
{
private double _averageModulePercent;
public double Covered { get; internal set; }
Expand Down
6 changes: 2 additions & 4 deletions src/coverlet.core/CoveragePrepareResult.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.IO;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using Coverlet.Core.Instrumentation;

namespace Coverlet.Core
Expand All @@ -10,7 +8,7 @@ namespace Coverlet.Core
// https://docs.microsoft.com/en-us/visualstudio/code-quality/ca2300-do-not-use-insecure-deserializer-binaryformatter?view=vs-2019
// https://docs.microsoft.com/en-us/visualstudio/code-quality/ca2301-do-not-call-binaryformatter-deserialize-without-first-setting-binaryformatter-binder?view=vs-2019
[DataContract]
public class CoveragePrepareResult
internal class CoveragePrepareResult
{
[DataMember]
public string Identifier { get; set; }
Expand Down
18 changes: 9 additions & 9 deletions src/coverlet.core/CoverageResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Coverlet.Core
{
public class BranchInfo
internal class BranchInfo
{
public int Line { get; set; }
public int Offset { get; set; }
Expand All @@ -18,11 +18,11 @@ public class BranchInfo
public int Hits { get; set; }
}

public class Lines : SortedDictionary<int, int> { }
internal class Lines : SortedDictionary<int, int> { }

public class Branches : List<BranchInfo> { }
internal class Branches : List<BranchInfo> { }

public class Method
internal class Method
{
internal Method()
{
Expand All @@ -32,12 +32,12 @@ internal Method()
public Lines Lines;
public Branches Branches;
}
public class Methods : Dictionary<string, Method> { }
public class Classes : Dictionary<string, Methods> { }
public class Documents : Dictionary<string, Classes> { }
public class Modules : Dictionary<string, Documents> { }
internal class Methods : Dictionary<string, Method> { }
internal class Classes : Dictionary<string, Methods> { }
internal class Documents : Dictionary<string, Classes> { }
internal class Modules : Dictionary<string, Documents> { }

public class CoverageResult
internal class CoverageResult
{
public string Identifier;
public Modules Modules;
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/CoverageSummary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Coverlet.Core
{
public class CoverageSummary
internal class CoverageSummary
{
public CoverageDetails CalculateLineCoverage(Lines lines)
{
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/DependencyInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Coverlet.Core
{
public static class DependencyInjection
internal static class DependencyInjection
{
private static Lazy<IServiceProvider> _serviceProvider = new Lazy<IServiceProvider>(() => InitDefaultServices(), true);

Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Enums/ThresholdStatistic.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Coverlet.Core.Enums
{
public enum ThresholdStatistic
internal enum ThresholdStatistic
{
Minimum,
Average,
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Enums/ThresholdTypeFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Coverlet.Core.Enums
{
[Flags]
public enum ThresholdTypeFlags
internal enum ThresholdTypeFlags
{
None = 0,
Line = 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Coverlet.Core.Extensions
{
public static class DependencyInjectionExtensions
internal static class DependencyInjectionExtensions
{
public static T GetService<T>(this IServiceProvider serviceProvider)
{
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Helpers/FileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Coverlet.Core.Helpers
{
public class FileSystem : IFileSystem
internal class FileSystem : IFileSystem
{
// We need to partial mock this method on tests
public virtual bool Exists(string path)
Expand Down
1 change: 1 addition & 0 deletions src/coverlet.core/Helpers/InstrumentationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Reflection.Metadata;
using System.Reflection.PortableExecutable;
using System.Text.RegularExpressions;

using Coverlet.Core.Abstracts;

namespace Coverlet.Core.Helpers
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Helpers/RetryHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Coverlet.Core.Helpers
{
// A slightly amended version of the code found here: https://stackoverflow.com/a/1563234/186184
// This code allows for varying backoff strategies through the use of Func<TimeSpan>.
public class RetryHelper : IRetryHelper
internal class RetryHelper : IRetryHelper
{
/// <summary>
/// Retry a void method.
Expand Down
12 changes: 6 additions & 6 deletions src/coverlet.core/Instrumentation/InstrumenterResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Coverlet.Core.Instrumentation
{
[DebuggerDisplay("Number = {Number} Hits = {Hits} Class = {Class} Method = {Method}")]
[DataContract]
public class Line
internal class Line
{
[DataMember]
public int Number;
Expand All @@ -21,7 +21,7 @@ public class Line

[DebuggerDisplay("Line = {Number} Offset = {Offset} EndOffset = {EndOffset} Path = {Path} Ordinal = {Ordinal} Hits = {Hits}")]
[DataContract]
public class Branch : Line
internal class Branch : Line
{
[DataMember]
public int Offset;
Expand All @@ -36,7 +36,7 @@ public class Branch : Line
[DebuggerDisplay("line = {Line} Ordinal = {Ordinal}")]
// Implements IEquatable because is used by dictionary key https://docs.microsoft.com/en-us/dotnet/api/system.iequatable-1?view=netcore-2.2#remarks
[DataContract]
public class BranchKey : IEquatable<BranchKey>
internal class BranchKey : IEquatable<BranchKey>
{
public BranchKey(int line, int ordinal) => (Line, Ordinal) = (line, ordinal);

Expand All @@ -56,7 +56,7 @@ public override int GetHashCode()
}

[DataContract]
public class Document
internal class Document
{
public Document()
{
Expand All @@ -76,7 +76,7 @@ public Document()

[DebuggerDisplay("isBranch = {isBranch} docIndex = {docIndex} start = {start} end = {end}")]
[DataContract]
public class HitCandidate
internal class HitCandidate
{
public HitCandidate(bool isBranch, int docIndex, int start, int end) => (this.isBranch, this.docIndex, this.start, this.end) = (isBranch, docIndex, start, end);

Expand All @@ -91,7 +91,7 @@ public class HitCandidate
}

[DataContract]
public class InstrumenterResult
internal class InstrumenterResult
{
public InstrumenterResult()
{
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Instrumentation/ModuleTrackerTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Coverlet.Core.Instrumentation
/// regarding visibility of members, etc.
/// </remarks>
[ExcludeFromCodeCoverage]
public static class ModuleTrackerTemplate
internal static class ModuleTrackerTemplate
{
public static string HitsFilePath;
public static int[] HitsArray;
Expand Down
20 changes: 12 additions & 8 deletions src/coverlet.core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[assembly: System.Reflection.AssemblyKeyFileAttribute("coverlet.core.snk")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Coverlet.Core.Tests,PublicKey=" +
"0024000004800000940000000602000000240000525341310004000001000100757cf9291d78a8" +
"2e5bb58a827a3c46c2f959318327ad30d1b52e918321ffbd847fb21565b8576d2a3a24562a93e8" +
"6c77a298b564a0f1b98f63d7a1441a3a8bcc206da3ed09d5dacc76e122a109a9d3ac608e21a054" +
"d667a2bae98510a1f0f653c0e6f58f42b4b3934f6012f5ec4a09b3dfd3e14d437ede1424bdb722" +
"aead64ad")]
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")]
// Needed to mock internal type https://github.com/Moq/moq4/wiki/Quickstart#advanced-features
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
2 changes: 1 addition & 1 deletion src/coverlet.core/Reporters/CoberturaReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Coverlet.Core.Reporters
{
public class CoberturaReporter : IReporter
internal class CoberturaReporter : IReporter
{
public ReporterOutputType OutputType => ReporterOutputType.File;

Expand Down
4 changes: 2 additions & 2 deletions src/coverlet.core/Reporters/IReporter.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Coverlet.Core.Reporters
{
public interface IReporter
internal interface IReporter
{
ReporterOutputType OutputType { get; }
string Format { get; }
string Extension { get; }
string Report(CoverageResult result);
}

public enum ReporterOutputType
internal enum ReporterOutputType
{
File,
Console,
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Reporters/JsonReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Coverlet.Core.Reporters
{
public class JsonReporter : IReporter
internal class JsonReporter : IReporter
{
public ReporterOutputType OutputType => ReporterOutputType.File;

Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Reporters/LcovReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Coverlet.Core.Reporters
{
public class LcovReporter : IReporter
internal class LcovReporter : IReporter
{
public ReporterOutputType OutputType => ReporterOutputType.File;

Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Reporters/OpenCoverReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Coverlet.Core.Reporters
{
public class OpenCoverReporter : IReporter
internal class OpenCoverReporter : IReporter
{
public ReporterOutputType OutputType => ReporterOutputType.File;

Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Reporters/ReporterFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Coverlet.Core.Reporters
{
public class ReporterFactory
internal class ReporterFactory
{
private string _format;
private IReporter[] _reporters;
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Reporters/TeamCityReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Coverlet.Core.Reporters
{
public class TeamCityReporter : IReporter
internal class TeamCityReporter : IReporter
{
public ReporterOutputType OutputType => ReporterOutputType.Console;

Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.core/Symbols/BranchPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Coverlet.Core.Symbols
/// a branch point
/// </summary>
[DebuggerDisplay("StartLine = {StartLine}")]
public class BranchPoint
internal class BranchPoint
{
/// <summary>
/// Line of the branching instruction
Expand Down
Loading