diff options
Diffstat (limited to 'src/libraries/Common/tests/TestUtilities/System/TestEnvironment.cs')
-rw-r--r-- | src/libraries/Common/tests/TestUtilities/System/TestEnvironment.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libraries/Common/tests/TestUtilities/System/TestEnvironment.cs b/src/libraries/Common/tests/TestUtilities/System/TestEnvironment.cs new file mode 100644 index 00000000000..0729b8d2578 --- /dev/null +++ b/src/libraries/Common/tests/TestUtilities/System/TestEnvironment.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System +{ + public static class TestEnvironment + { + /// <summary> + /// Check if the stress mode is enabled. + /// </summary> + /// <value> true if the environment variable DOTNET_TEST_STRESS set to '1' or 'true'. returns false otherwise</value> + public static bool IsStressModeEnabled + { + get + { + string value = Environment.GetEnvironmentVariable("DOTNET_TEST_STRESS"); + return value != null && (value == "1" || value.Equals("true", StringComparison.OrdinalIgnoreCase)); + } + } + } +} |