Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/BenchmarkDotNet/Reports/SummaryTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ internal SummaryTable(Summary summary, SummaryStyle? style = null)
ColumnCount = columns.Length;
FullHeader = columns.Select(c => c.GetColumnTitle(style)).ToArray();

FullContent = summary.Reports.Select(r => columns.Select(c => c.GetValue(summary, r.BenchmarkCase, style)).ToArray()).ToArray();
FullContent = summary.Reports.Select(r => columns.Select(c => c.GetValue(summary, r.BenchmarkCase, style) ?? string.Empty).ToArray()).ToArray();
IsDefault = columns.Select(c => summary.Reports.All(r => c.IsDefault(summary, r.BenchmarkCase))).ToArray();

var highlightGroupKeys = summary.BenchmarksCases.Select(b => b.Config.Orderer.GetHighlightGroupKey(b)).ToArray();
Expand Down Expand Up @@ -141,4 +141,4 @@ public enum TextJustification
}
}
}
}
}
34 changes: 33 additions & 1 deletion tests/BenchmarkDotNet.Tests/Reports/SummaryTableTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ public void TextColumnWithRightJustification()
Assert.Equal(SummaryTable.SummaryTableColumn.TextJustification.Right, table.Columns.First(c => c.Header == "Param").Justify);
}

[Fact] // Issue #2656
public void JoinedSummaryHandlesMissingColumnValues()
{
var taggedSummary = MockFactory.CreateSummary(typeof(TaggedBenchmark));
var otherSummary = MockFactory.CreateSummary(typeof(OtherBenchmark));

var joinedSummary = Summary.Join([taggedSummary, otherSummary], default);

Assert.Equal(["", "tagged"], joinedSummary.Table.Columns.Single(c => c.Header == "Tag").Content);
}

[Fact] // Issue #1070
public void CustomOrdererIsSupported()
{
Expand Down Expand Up @@ -476,6 +487,27 @@ public void DisplayThreadingDiagnoserConfigs_WhenDescriptorValuesAreZero()
Assert.Equal(["-", "-"], lockContentionCount!);
Assert.Equal(["-", "-"], completedWorkItemCount!);
}

[Config(typeof(TagColumnConfig))]
public class TaggedBenchmark
{
[Benchmark]
public void Tagged() { }
}

public class OtherBenchmark
{
[Benchmark]
public void Other() { }
}

public class TagColumnConfig : ManualConfig
{
public TagColumnConfig()
{
AddColumn(new TagColumn("Tag", methodName => methodName == nameof(TaggedBenchmark.Tagged) ? "tagged" : null!));
}
}
#endregion
}
}
}
Loading