Skip to content

Commit bfbcec6

Browse files
Fix ConfigCompatibilityValidatorTests on Linux
1 parent 8626172 commit bfbcec6

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace BenchmarkDotNet.Tests
2+
{
3+
public class KnownIssue
4+
{
5+
public static KnownIssue Issue2299 => new (2299, "Non-supported Mono on Linux", false);
6+
7+
public int Number { get; }
8+
public string Description { get; }
9+
public bool IsFixed { get; }
10+
11+
public KnownIssue(int number, string description, bool isFixed)
12+
{
13+
Number = number;
14+
Description = description;
15+
IsFixed = isFixed;
16+
}
17+
18+
public string IgnoreMessage => $"This test is ignored because of the issue #{Number} '{Description}'";
19+
}
20+
}

tests/BenchmarkDotNet.Tests/Validators/ConfigCompatibilityValidatorTests.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
using BenchmarkDotNet.Reports;
77
using BenchmarkDotNet.Tests.Loggers;
88
using BenchmarkDotNet.Validators;
9-
using System.Collections.Generic;
109
using System.Linq;
10+
using BenchmarkDotNet.Portability;
1111
using Xunit;
1212
using Xunit.Abstractions;
1313

@@ -22,6 +22,12 @@ public class ConfigCompatibilityValidatorTests
2222
[Fact]
2323
public void RunningBenchmarksWithIncompatibleConfigsMustFailWithCriticalError()
2424
{
25+
if (!KnownIssue.Issue2299.IsFixed && RuntimeInformation.IsMono && RuntimeInformation.IsLinux())
26+
{
27+
Output.WriteLine(KnownIssue.Issue2299.IgnoreMessage);
28+
return;
29+
}
30+
2531
var logger = new OutputLogger(Output);
2632
var config = ManualConfig.CreateEmpty().AddLogger(logger);
2733
var summary =

0 commit comments

Comments
 (0)