@@ -13,20 +13,13 @@ namespace Microsoft.DotNet.XUnitExtensions
1313{
1414 public class SkipOnCoreClrDiscoverer : ITraitDiscoverer
1515 {
16- private static readonly Lazy < bool > s_isJitStress = new Lazy < bool > ( ( ) => ! string . Equals ( GetEnvironmentVariableValue ( "COMPlus_JitStress" ) , "0" , StringComparison . InvariantCulture ) &&
17- ! string . Equals ( GetEnvironmentVariableValue ( "DOTNET_JitStress" ) , "0" , StringComparison . InvariantCulture ) ) ;
18- private static readonly Lazy < bool > s_isJitStressRegs = new Lazy < bool > ( ( ) => ! string . Equals ( GetEnvironmentVariableValue ( "COMPlus_JitStressRegs" ) , "0" , StringComparison . InvariantCulture ) &&
19- ! string . Equals ( GetEnvironmentVariableValue ( "DOTNET_JitStressRegs" ) , "0" , StringComparison . InvariantCulture ) ) ;
20- private static readonly Lazy < bool > s_isJitMinOpts = new Lazy < bool > ( ( ) => string . Equals ( GetEnvironmentVariableValue ( "COMPlus_JITMinOpts" ) , "1" , StringComparison . InvariantCulture ) ||
21- string . Equals ( GetEnvironmentVariableValue ( "DOTNET_JITMinOpts" ) , "1" , StringComparison . InvariantCulture ) ) ;
22- private static readonly Lazy < bool > s_isTailCallStress = new Lazy < bool > ( ( ) => string . Equals ( GetEnvironmentVariableValue ( "COMPlus_TailcallStress" ) , "1" , StringComparison . InvariantCulture ) ||
23- string . Equals ( GetEnvironmentVariableValue ( "DOTNET_TailcallStress" ) , "1" , StringComparison . InvariantCulture ) ) ;
24- private static readonly Lazy < bool > s_isZapDisable = new Lazy < bool > ( ( ) => string . Equals ( GetEnvironmentVariableValue ( "COMPlus_ZapDisable" ) , "1" , StringComparison . InvariantCulture ) ||
25- string . Equals ( GetEnvironmentVariableValue ( "DOTNET_ZapDisable" ) , "1" , StringComparison . InvariantCulture ) ) ;
26- private static readonly Lazy < bool > s_isGCStress3 = new Lazy < bool > ( ( ) => CompareGCStressModeAsLower ( GetEnvironmentVariableValue ( "COMPlus_GCStress" ) , "0x3" , "3" ) ||
27- CompareGCStressModeAsLower ( GetEnvironmentVariableValue ( "DOTNET_GCStress" ) , "0x3" , "3" ) ) ;
28- private static readonly Lazy < bool > s_isGCStressC = new Lazy < bool > ( ( ) => CompareGCStressModeAsLower ( GetEnvironmentVariableValue ( "COMPlus_GCStress" ) , "0xC" , "C" ) ||
29- CompareGCStressModeAsLower ( GetEnvironmentVariableValue ( "DOTNET_GCStress" ) , "0xC" , "C" ) ) ;
16+ private static readonly Lazy < bool > s_isJitStress = new Lazy < bool > ( ( ) => ! string . Equals ( GetEnvironmentVariableValue ( "JitStress" ) , "0" , StringComparison . InvariantCulture ) ) ;
17+ private static readonly Lazy < bool > s_isJitStressRegs = new Lazy < bool > ( ( ) => ! string . Equals ( GetEnvironmentVariableValue ( "JitStressRegs" ) , "0" , StringComparison . InvariantCulture ) ) ;
18+ private static readonly Lazy < bool > s_isJitMinOpts = new Lazy < bool > ( ( ) => string . Equals ( GetEnvironmentVariableValue ( "JITMinOpts" ) , "1" , StringComparison . InvariantCulture ) ) ;
19+ private static readonly Lazy < bool > s_isTailCallStress = new Lazy < bool > ( ( ) => string . Equals ( GetEnvironmentVariableValue ( "TailcallStress" ) , "1" , StringComparison . InvariantCulture ) ) ;
20+ private static readonly Lazy < bool > s_isZapDisable = new Lazy < bool > ( ( ) => string . Equals ( GetEnvironmentVariableValue ( "ZapDisable" ) , "1" , StringComparison . InvariantCulture ) ) ;
21+ private static readonly Lazy < bool > s_isGCStress3 = new Lazy < bool > ( ( ) => CompareGCStressModeAsLower ( GetEnvironmentVariableValue ( "GCStress" ) , "0x3" , "3" ) ) ;
22+ private static readonly Lazy < bool > s_isGCStressC = new Lazy < bool > ( ( ) => CompareGCStressModeAsLower ( GetEnvironmentVariableValue ( "GCStress" ) , "0xC" , "C" ) ) ;
3023 private static readonly Lazy < bool > s_isCheckedRuntime = new Lazy < bool > ( ( ) => IsCheckedRuntime ( ) ) ;
3124 private static readonly Lazy < bool > s_isReleaseRuntime = new Lazy < bool > ( ( ) => IsReleaseRuntime ( ) ) ;
3225 private static readonly Lazy < bool > s_isDebugRuntime = new Lazy < bool > ( ( ) => IsDebugRuntime ( ) ) ;
@@ -88,7 +81,8 @@ private static bool StressModeApplies(RuntimeTestModes stressMode) =>
8881 s_isJitStress . Value ||
8982 s_isJitMinOpts . Value ;
9083
91- private static string GetEnvironmentVariableValue ( string name ) => Environment . GetEnvironmentVariable ( name ) ?? "0" ;
84+ private static string GetEnvironmentVariableValue ( string name ) =>
85+ Environment . GetEnvironmentVariable ( "DOTNET_" + name ) ?? Environment . GetEnvironmentVariable ( "COMPlus_" + name ) ?? "0" ;
9286
9387 private static bool IsCheckedRuntime ( ) => AssemblyConfigurationEquals ( "Checked" ) ;
9488
0 commit comments