Skip to content

Commit dbc4dce

Browse files
authored
Add RuntimeTestMode for the coreclr interpreter (#16152)
This runtimetestmode will be used to disable tests in dotnet/runtime when the interpreter is enabled.
2 parents 9c673b0 + 00c1d79 commit dbc4dce

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Microsoft.DotNet.XUnitExtensions.Shared/CoreClrConfigurationDetection.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ public static class CoreClrConfigurationDetection
2222
public static bool IsTieredCompilation => string.Equals(GetEnvironmentVariableValue("TieredCompilation", "1"), "1", StringComparison.InvariantCulture);
2323
public static bool IsHeapVerify => string.Equals(GetEnvironmentVariableValue("HeapVerify"), "1", StringComparison.InvariantCulture);
2424

25+
public static bool IsInterpreterActive {
26+
get {
27+
if (!string.IsNullOrWhiteSpace(GetEnvironmentVariableValue("Interpreter", "")))
28+
return true;
29+
if (int.TryParse(GetEnvironmentVariableValue("InterpMode", "0"), out int mode) && (mode > 0))
30+
return true;
31+
return false;
32+
}
33+
}
34+
2535
public static bool IsGCStress => !string.Equals(GetEnvironmentVariableValue("GCStress"), "0", StringComparison.InvariantCulture);
2636

2737
public static bool IsAnyJitStress => IsJitStress || IsJitStressRegs || IsJitMinOpts || IsTailCallStress;

src/Microsoft.DotNet.XUnitExtensions.Shared/RuntimeTestModes.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ public enum RuntimeTestModes
4444
AnyJitOptimizationStress = AnyJitStress | TieredCompilation, // Disable when any JIT non-full optimization stress mode is exercised.
4545

4646
HeapVerify = 1 << 9, // DOTNET_HeapVerify (or COMPlus_HeapVerify) is set.
47+
48+
InterpreterActive = 1 << 10, // DOTNET_Interpreter != "" or DOTNET_InterpMode != 0
4749
}
4850
}

0 commit comments

Comments
 (0)