Skip to content

Commit a89879e

Browse files
committed
enable benchmark test for VS
1 parent b8359e8 commit a89879e

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,4 @@ BenchmarkDotNet.Artifacts/
319319
/NuGet.config
320320
nuget.config
321321
*.dmp
322+
test/coverlet.core.benchmark.tests/InstrumentationHelperBenchmarks.cs

Directory.Packages.props

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
2121
<PackageVersion Include="BenchmarkDotNet.TestAdapter" Version="0.14.0" />
2222
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.14.0" />
23+
<!--<PackageVersion Include="Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers" Version="17.13.35606.1" />-->
2324
<PackageVersion Include="DotNetConfig" Version="1.2.0" />
2425
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
2526
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildVersion)" />

test/coverlet.core.benchmark.tests/Program.cs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
// Copyright (c) Toni Solarin-Sodara
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4+
//using System.Diagnostics.Tracing;
45
using BenchmarkDotNet.Configs;
56
using BenchmarkDotNet.Diagnosers;
7+
//using BenchmarkDotNet.Diagnostics.Windows;
68
using BenchmarkDotNet.Exporters;
79
using BenchmarkDotNet.Exporters.Csv;
810
using BenchmarkDotNet.Exporters.Json;
911
using BenchmarkDotNet.Exporters.Xml;
1012
using BenchmarkDotNet.Jobs;
1113
using BenchmarkDotNet.Running;
1214
using BenchmarkDotNet.Toolchains.InProcess.NoEmit;
15+
//using Microsoft.Diagnostics.NETCore.Client;
16+
//using Microsoft.Diagnostics.Tracing.Parsers;
1317

1418
namespace coverlet.core.benchmark.tests
1519
{
@@ -18,25 +22,21 @@ public class Program
1822

1923
public static void Main(string[] args)
2024
{
21-
2225
var config = DefaultConfig.Instance
2326
.WithOptions(ConfigOptions.JoinSummary)
2427
.AddJob(Job
2528
.ShortRun
2629
.WithLaunchCount(1)
2730
.WithToolchain(InProcessNoEmitToolchain.Instance))
28-
.AddExporter(CsvExporter.Default)
29-
.AddExporter(CsvMeasurementsExporter.Default)
30-
.AddExporter(RPlotExporter.Default)
31-
.AddExporter(HtmlExporter.Default)
32-
.AddExporter(MarkdownExporter.GitHub)
33-
.AddExporter(JsonExporter.Default)
34-
.AddExporter(XmlExporter.Default)
35-
.AddDiagnoser(MemoryDiagnoser.Default)
31+
.AddExporter(CsvExporter.Default, CsvMeasurementsExporter.Default, RPlotExporter.Default, HtmlExporter.Default, JsonExporter.Default, MarkdownExporter.GitHub, XmlExporter.Default)
32+
.AddDiagnoser(MemoryDiagnoser.Default, ThreadingDiagnoser.Default, ExceptionDiagnoser.Default)
33+
//.AddDiagnoser(new InliningDiagnoser(), new EtwProfiler()) // only windows platform, requires elevated privileges
34+
//.AddDiagnoser(new EventPipeProfiler(EventPipeProfile.CpuSampling)) // stops collecting results ???
3635
;
3736
var summary = BenchmarkRunner.Run(new[]{
3837
BenchmarkConverter.TypeToBenchmarks( typeof(CoverageBenchmarks), config),
39-
BenchmarkConverter.TypeToBenchmarks( typeof(InstrumenterBenchmarks), config)
38+
BenchmarkConverter.TypeToBenchmarks( typeof(InstrumenterBenchmarks), config),
39+
BenchmarkConverter.TypeToBenchmarks( typeof(InstrumentationHelperBenchmarks), config),
4040
});
4141

4242
// Use this to select benchmarks from the console and execute with additional options e.g. 'coverlet.core.benchmark.tests.exe --profiler EP'

test/coverlet.core.benchmark.tests/coverlet.core.benchmark.tests.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
<PropertyGroup>
33
<TargetFramework>net8.0</TargetFramework>
44
<OutputType>Exe</OutputType>
5-
</PropertyGroup>
6-
<PropertyGroup>
75
<PlatformTarget>AnyCPU</PlatformTarget>
86
<DebugType>pdbonly</DebugType>
97
<DebugSymbols>true</DebugSymbols>
@@ -18,6 +16,7 @@
1816

1917
<ItemGroup>
2018
<PackageReference Include="BenchmarkDotNet" />
19+
<PackageReference Include="BenchmarkDotNet.TestAdapter" />
2120
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
2221
<!--<PackageReference Include="Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers" />-->
2322
<PackageReference Include="Microsoft.NET.Test.Sdk" />
@@ -27,6 +26,7 @@
2726
<ProjectReference Include="$(RepoRoot)src\coverlet.core\coverlet.core.csproj" />
2827
<ProjectReference Include="$(RepoRoot)test\coverlet.tests.utils\coverlet.tests.utils.csproj" />
2928
<ProjectReference Include="$(RepoRoot)test\coverlet.tests.projectsample.excludedbyattribute\coverlet.tests.projectsample.excludedbyattribute.csproj" />
29+
<ProjectReference Include="$(RepoRoot)test\coverlet.testsubject\coverlet.testsubject.csproj" />
3030
</ItemGroup>
3131

3232
<ItemGroup>

0 commit comments

Comments
 (0)