diff options
author | Alan McGovern <alan@xamarin.com> | 2014-04-17 01:54:08 +0400 |
---|---|---|
committer | Alan McGovern <alan@xamarin.com> | 2014-04-17 01:54:08 +0400 |
commit | 903eebb644527360cb34195e1106dc94fe91c5e2 (patch) | |
tree | db0adb4a6da6e1a8ebc028bf981debc1a73b990e | |
parent | 8877cb04f6f2486830eb79af0db81a2196bc06ab (diff) |
Disable the context of CallContext as it doesn't work the way we need
We're more than happy with a single static variable. We don't support
multiple appdomains (or want to support it), and our usage of
async/await does not work with CallContext under .NET 4.5. We end up
getting a null value from CallContext.GetData after an await
completes, which is expected behaviour.
-rwxr-xr-x | src/framework/Internal/TestExecutionContext.cs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/framework/Internal/TestExecutionContext.cs b/src/framework/Internal/TestExecutionContext.cs index 9796cdc..340b4f2 100755 --- a/src/framework/Internal/TestExecutionContext.cs +++ b/src/framework/Internal/TestExecutionContext.cs @@ -239,13 +239,8 @@ namespace NUnit.Framework.Internal /// <summary>
/// The current context, head of the list of saved contexts.
/// </summary>
-#if SILVERLIGHT || NETCF
-#if (CLR_2_0 || CLR_4_0) && !NETCF
- [ThreadStatic]
-#endif
- private static TestExecutionContext current;
-#endif
+ private static TestExecutionContext current;
/// <summary>
/// Gets the current context.
/// </summary>
@@ -254,14 +249,10 @@ namespace NUnit.Framework.Internal {
get
{
-#if SILVERLIGHT || NETCF
if (current == null)
current = new TestExecutionContext();
return current;
-#else
- return CallContext.GetData("NUnit.Framework.TestContext") as TestExecutionContext;
-#endif
}
}
@@ -271,11 +262,7 @@ namespace NUnit.Framework.Internal internal static void SetCurrentContext(TestExecutionContext ec)
{
-#if SILVERLIGHT || NETCF
current = ec;
-#else
- CallContext.SetData("NUnit.Framework.TestContext", ec);
-#endif
}
#endregion
|