Skip to content

Commit a79339c

Browse files
Disable CoreRtToolchain.Core50 in ThreadingDiagnoserTests.GetToolchains on Unix
1 parent 2f4b794 commit a79339c

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

tests/BenchmarkDotNet.IntegrationTests/ThreadingDiagnoserTests.cs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
using BenchmarkDotNet.Tests.Loggers;
1111
using BenchmarkDotNet.Toolchains;
1212
using BenchmarkDotNet.Toolchains.CoreRt;
13-
using BenchmarkDotNet.Toolchains.InProcess.Emit;
1413
using System;
1514
using System.Collections.Generic;
1615
using System.Linq;
1716
using System.Threading;
17+
using BenchmarkDotNet.Portability;
1818
using Xunit;
1919
using Xunit.Abstractions;
2020

@@ -26,15 +26,23 @@ public class ThreadingDiagnoserTests
2626

2727
public ThreadingDiagnoserTests(ITestOutputHelper outputHelper) => output = outputHelper;
2828

29-
public static IEnumerable<object[]> GetToolchains() => new[]
29+
public static IEnumerable<object[]> GetToolchains()
3030
{
31-
new object[] { Job.Default.GetToolchain() },
32-
new object[] { CoreRtToolchain.Core50 },
33-
// new object[] { InProcessEmitToolchain.Instance },
34-
};
31+
yield return new object[] { Job.Default.GetToolchain() };
32+
33+
// Currently, CoreRtToolchain.Core50 produces the following error on Unix without installed clang:
34+
// Standard error:
35+
// ~/.nuget/packages/microsoft.dotnet.ilcompiler/6.0.0-preview.5.21269.1/build/Microsoft.NETCore.Native.Unix.props(99,5):
36+
// error : Platform linker ('clang') not found. Try installing clang or the appropriate package for your platform to resolve the problem.
37+
if (RuntimeInformation.IsWindows())
38+
yield return new object[] { CoreRtToolchain.Core50 };
39+
40+
// TODO: Support InProcessEmitToolchain.Instance
41+
// yield return new object[] { InProcessEmitToolchain.Instance };
42+
}
3543

3644
[Theory, MemberData(nameof(GetToolchains))]
37-
public void CompletedWorkItemCounIsAccurate(IToolchain toolchain)
45+
public void CompletedWorkItemCountIsAccurate(IToolchain toolchain)
3846
{
3947
var config = CreateConfig(toolchain);
4048

@@ -135,7 +143,9 @@ private IConfig CreateConfig(IToolchain toolchain)
135143
.WithToolchain(toolchain))
136144
.AddColumnProvider(DefaultColumnProviders.Instance)
137145
.AddDiagnoser(ThreadingDiagnoser.Default)
138-
.AddLogger(toolchain.IsInProcess ? ConsoleLogger.Default : new OutputLogger(output)); // we can't use OutputLogger for the InProcess toolchains because it allocates memory on the same thread
146+
.AddLogger(toolchain.IsInProcess
147+
? ConsoleLogger.Default
148+
: new OutputLogger(output)); // we can't use OutputLogger for the InProcess toolchains because it allocates memory on the same thread
139149

140150
private void AssertStats(Summary summary, Dictionary<string, (string metricName, double expectedValue)> assertions)
141151
{

0 commit comments

Comments
 (0)