Skip to content
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
6 changes: 5 additions & 1 deletion src/BenchmarkDotNet.TestAdapter/BenchmarkExecutor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Loggers;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.TestAdapter.Remoting;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
Expand Down Expand Up @@ -67,7 +68,10 @@ public void RunBenchmarks(string assemblyPath, TestExecutionRecorderWrapper reco
.Select(b => new BenchmarkRunInfo(
b.BenchmarksCases,
b.Type,
b.Config.AddEventProcessor(eventProcessor).AddLogger(logger).CreateImmutableConfig()))
b.Config.AddEventProcessor(eventProcessor)
.AddLogger(logger)
.RemoveLoggersOfType<ConsoleLogger>() // Console logs are also outputted by VSTestLogger.
.CreateImmutableConfig()))
.ToArray();

// Run all the benchmarks, and ensure that any tests that don't have a result yet are sent.
Expand Down
6 changes: 6 additions & 0 deletions src/BenchmarkDotNet/Configs/ManualConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ public static ManualConfig Union(IConfig globalConfig, IConfig localConfig)
return manualConfig;
}

internal ManualConfig RemoveLoggersOfType<T>()
{
loggers.RemoveAll(logger => logger is T);
return this;
}

internal void RemoveAllJobs() => jobs.Clear();

internal void RemoveAllDiagnosers() => diagnosers.Clear();
Expand Down
Loading