Skip to content

Commit

Permalink
Disable CoreRtToolchain.Core50 in ThreadingDiagnoserTests.GetToolchai…
Browse files Browse the repository at this point in the history
…ns on Unix
  • Loading branch information
AndreyAkinshin committed May 19, 2021
1 parent 2f4b794 commit a79339c
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions tests/BenchmarkDotNet.IntegrationTests/ThreadingDiagnoserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
using BenchmarkDotNet.Tests.Loggers;
using BenchmarkDotNet.Toolchains;
using BenchmarkDotNet.Toolchains.CoreRt;
using BenchmarkDotNet.Toolchains.InProcess.Emit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using BenchmarkDotNet.Portability;
using Xunit;
using Xunit.Abstractions;

Expand All @@ -26,15 +26,23 @@ public class ThreadingDiagnoserTests

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

public static IEnumerable<object[]> GetToolchains() => new[]
public static IEnumerable<object[]> GetToolchains()
{
new object[] { Job.Default.GetToolchain() },
new object[] { CoreRtToolchain.Core50 },
// new object[] { InProcessEmitToolchain.Instance },
};
yield return new object[] { Job.Default.GetToolchain() };

// Currently, CoreRtToolchain.Core50 produces the following error on Unix without installed clang:
// Standard error:
// ~/.nuget/packages/microsoft.dotnet.ilcompiler/6.0.0-preview.5.21269.1/build/Microsoft.NETCore.Native.Unix.props(99,5):
// error : Platform linker ('clang') not found. Try installing clang or the appropriate package for your platform to resolve the problem.
if (RuntimeInformation.IsWindows())
yield return new object[] { CoreRtToolchain.Core50 };

// TODO: Support InProcessEmitToolchain.Instance
// yield return new object[] { InProcessEmitToolchain.Instance };
}

[Theory, MemberData(nameof(GetToolchains))]
public void CompletedWorkItemCounIsAccurate(IToolchain toolchain)
public void CompletedWorkItemCountIsAccurate(IToolchain toolchain)
{
var config = CreateConfig(toolchain);

Expand Down Expand Up @@ -135,7 +143,9 @@ private IConfig CreateConfig(IToolchain toolchain)
.WithToolchain(toolchain))
.AddColumnProvider(DefaultColumnProviders.Instance)
.AddDiagnoser(ThreadingDiagnoser.Default)
.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
.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

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

0 comments on commit a79339c

Please sign in to comment.