Skip to content

Commit d20c117

Browse files
committed
Issue #1024: Correct configuration
1 parent fd9f34f commit d20c117

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/BenchmarkDotNet/Configs/ManualConfig.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,10 @@ public void Add(IConfig config)
261261
columnHidingRules.AddRange(config.GetColumnHidingRules());
262262
Options |= config.Options;
263263
BuildTimeout = GetBuildTimeout(BuildTimeout, config.BuildTimeout);
264-
AutomaticBaselineMode = config.AutomaticBaselineMode;
264+
if (config.AutomaticBaselineMode != AutomaticBaselineMode.None)
265+
{
266+
AutomaticBaselineMode = config.AutomaticBaselineMode;
267+
}
265268
}
266269

267270
/// <summary>

src/BenchmarkDotNet/Reports/Summary.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ public Summary(
7373

7474
private static BenchmarkCase GetFastestBenchmarkCase(ImmutableArray<BenchmarkReport> reports)
7575
{
76-
if (reports.Any() && reports.All(r => r.BenchmarkCase.Config.AutomaticBaselineMode == AutomaticBaselineMode.Fastest))
76+
var baselineReport = reports.Where(r => r.BenchmarkCase.Config.AutomaticBaselineMode != AutomaticBaselineMode.None).LastOrDefault();
77+
if (baselineReport != null && baselineReport.BenchmarkCase.Config.AutomaticBaselineMode == AutomaticBaselineMode.Fastest)
7778
{
7879
var fastestReport = reports.First();
7980
if (fastestReport.ResultStatistics != null)

0 commit comments

Comments
 (0)