Disable CoreRtToolchain.Core50 in ThreadingDiagnoserTests.GetToolchai… · dotnet/BenchmarkDotNet@a79339c (original) (raw)
`@@ -10,11 +10,11 @@
`
10
10
`using BenchmarkDotNet.Tests.Loggers;
`
11
11
`using BenchmarkDotNet.Toolchains;
`
12
12
`using BenchmarkDotNet.Toolchains.CoreRt;
`
13
``
`-
using BenchmarkDotNet.Toolchains.InProcess.Emit;
`
14
13
`using System;
`
15
14
`using System.Collections.Generic;
`
16
15
`using System.Linq;
`
17
16
`using System.Threading;
`
``
17
`+
using BenchmarkDotNet.Portability;
`
18
18
`using Xunit;
`
19
19
`using Xunit.Abstractions;
`
20
20
``
`@@ -26,15 +26,23 @@ public class ThreadingDiagnoserTests
`
26
26
``
27
27
`public ThreadingDiagnoserTests(ITestOutputHelper outputHelper) => output = outputHelper;
`
28
28
``
29
``
`-
public static IEnumerable<object[]> GetToolchains() => new[]
`
``
29
`+
public static IEnumerable<object[]> GetToolchains()
`
30
30
`{
`
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
`+
}
`
35
43
``
36
44
`[Theory, MemberData(nameof(GetToolchains))]
`
37
``
`-
public void CompletedWorkItemCounIsAccurate(IToolchain toolchain)
`
``
45
`+
public void CompletedWorkItemCountIsAccurate(IToolchain toolchain)
`
38
46
`{
`
39
47
`var config = CreateConfig(toolchain);
`
40
48
``
`@@ -135,7 +143,9 @@ private IConfig CreateConfig(IToolchain toolchain)
`
135
143
`.WithToolchain(toolchain))
`
136
144
`.AddColumnProvider(DefaultColumnProviders.Instance)
`
137
145
`.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
`
139
149
``
140
150
`private void AssertStats(Summary summary, Dictionary<string, (string metricName, double expectedValue)> assertions)
`
141
151
`{
`