Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public static partial class PlatformDetection
public static bool IsNetCore => Environment.Version.Major >= 5 || RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.OrdinalIgnoreCase);
public static bool IsMonoRuntime => Type.GetType("Mono.RuntimeStructs") != null;
public static bool IsNotMonoRuntime => !IsMonoRuntime;
public static bool IsInterpreter => IsMonoInterpreter || IsCoreClrInterpreter;
public static bool IsNotInterpreter => !IsInterpreter;
public static bool IsMonoInterpreter => GetIsRunningOnMonoInterpreter();
public static bool IsNotMonoInterpreter => !IsMonoInterpreter;
public static bool IsMonoAOT => Environment.GetEnvironmentVariable("MONO_AOT_MODE") == "aot";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void JitInfoIsPopulated()
long afterCompiledILBytes = System.Runtime.JitInfo.GetCompiledILBytes();
long afterCompiledMethodCount = System.Runtime.JitInfo.GetCompiledMethodCount();

if (PlatformDetection.IsMonoInterpreter || PlatformDetection.IsMonoAOT || PlatformDetection.IsReadyToRunCompiled)
if (PlatformDetection.IsMonoInterpreter || PlatformDetection.IsCoreClrInterpreter || PlatformDetection.IsMonoAOT || PlatformDetection.IsReadyToRunCompiled)
Comment thread
pavelsavara marked this conversation as resolved.
Outdated
Comment thread
pavelsavara marked this conversation as resolved.
Outdated
{
// JitInfo metrics may be 0 in AOT scenarios
Assert.True(beforeCompilationTime >= TimeSpan.Zero, $"Compilation time not greater or equal to 0! ({beforeCompilationTime})");
Expand All @@ -65,7 +65,7 @@ public void JitInfoIsPopulated()
Assert.True(beforeCompiledMethodCount > 0, $"Compiled method count not greater than 0! ({beforeCompiledMethodCount})");
}

if (PlatformDetection.IsMonoInterpreter)
if (PlatformDetection.IsMonoInterpreter || PlatformDetection.IsCoreClrInterpreter)
Comment thread
pavelsavara marked this conversation as resolved.
Outdated
Comment thread
pavelsavara marked this conversation as resolved.
Outdated
{
// Before and after will most likely be the same with the interpreter
Assert.True(afterCompilationTime >= beforeCompilationTime, $"CompilationTime: after not greater than before! (after: {afterCompilationTime}, before: {beforeCompilationTime})");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
using System;
using Xunit;

[assembly: ActiveIssue("Interpreter with debug runtime can be very slow", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter), nameof(PlatformDetection.IsDebugRuntime))]
[assembly: ActiveIssue("Interpreter with debug runtime can be very slow", typeof(PlatformDetection), nameof(PlatformDetection.IsInterpreter), nameof(PlatformDetection.IsDebugRuntime))]
Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,7 @@ public static void TestPartialJsonReaderSlicesSpecialNumbers(TestCaseType type,
[InlineData(512)]
public static void TestDepth(int depth)
{
if (PlatformDetection.IsMonoInterpreter && depth >= 256)
if (PlatformDetection.IsInterpreter && depth >= 256)
{
throw new SkipTestException("Takes very long to run on interpreter.");
}
Expand Down