forked from coverlet-coverage/coverlet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from tonerdo/master
update fork
- Loading branch information
Showing
31 changed files
with
1,011 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<Project> | ||
<ItemGroup> | ||
<PackageReference Update="McMaster.Extensions.CommandLineUtils" Version="2.3.4" /> | ||
<PackageReference Update="Microsoft.Build.Utilities.Core" Version="15.5.180"/> | ||
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="2.10.0" /> | ||
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="2.2.0" /> | ||
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.2.0" /> | ||
<PackageReference Update="Microsoft.Extensions.FileSystemGlobbing" Version="2.0.1" /> | ||
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="15.9.0" /> | ||
<PackageReference Update="Microsoft.TestPlatform.ObjectModel" Version="16.1.0" /> | ||
<PackageReference Update="Mono.Cecil" Version="0.10.4" /> | ||
<PackageReference Update="Moq" Version="4.10.1" /> | ||
<!-- Do not upgrade this version or we won't support old SDK --> | ||
<PackageReference Update="Newtonsoft.Json" Version="9.0.1" /> | ||
<PackageReference Update="ReportGenerator.Core" Version="4.2.15" /> | ||
<!-- | ||
Do not change System.Reflection.Metadata version since we need to support VSTest DataCollectors. Goto https://www.nuget.org/packages/System.Reflection.Metadata to check versions. | ||
We need to load assembly version 1.4.2.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#L37 | ||
--> | ||
<PackageReference Update="System.Reflection.Metadata" Version="1.5.0" /> | ||
<PackageReference Update="xunit" Version="2.4.1" /> | ||
<PackageReference Update="xunit.assert" Version="2.4.1" /> | ||
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.1"/> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System; | ||
|
||
namespace Coverlet.Core.Abstracts | ||
{ | ||
internal interface IProcessExitHandler | ||
{ | ||
void Add(EventHandler handler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
|
||
namespace Coverlet.Core.Abstracts | ||
{ | ||
internal interface IRetryHelper | ||
{ | ||
void Retry(Action action, Func<TimeSpan> backoffStrategy, int maxAttemptCount = 3); | ||
T Do<T>(Func<T> action, Func<TimeSpan> backoffStrategy, int maxAttemptCount = 3); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
|
||
using Coverlet.Core.Abstracts; | ||
using Coverlet.Core.Helpers; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Coverlet.Core | ||
{ | ||
internal static class DependencyInjection | ||
{ | ||
private static Lazy<IServiceProvider> _serviceProvider = new Lazy<IServiceProvider>(() => InitDefaultServices(), true); | ||
|
||
public static IServiceProvider Current | ||
{ | ||
get | ||
{ | ||
return _serviceProvider.Value; | ||
} | ||
} | ||
|
||
public static void Set(IServiceProvider serviceProvider) | ||
{ | ||
_serviceProvider = new Lazy<IServiceProvider>(() => serviceProvider); | ||
} | ||
|
||
private static IServiceProvider InitDefaultServices() | ||
{ | ||
IServiceCollection serviceCollection = new ServiceCollection(); | ||
serviceCollection.AddTransient<IRetryHelper, RetryHelper>(); | ||
serviceCollection.AddTransient<IProcessExitHandler, ProcessExitHandler>(); | ||
return serviceCollection.BuildServiceProvider(); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using Coverlet.Core.Abstracts; | ||
|
||
namespace Coverlet.Core.Helpers | ||
{ | ||
internal class ProcessExitHandler : IProcessExitHandler | ||
{ | ||
public void Add(EventHandler handler) | ||
{ | ||
AppDomain.CurrentDomain.ProcessExit += handler; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.