Merge branch 'upstream'

Former-commit-id: 49fea35ddddb1db9eb75bdc6768d7ca9a852b718
This commit is contained in:
Xamarin Public Jenkins (auto-signing) 2018-02-22 09:17:20 +00:00
commit 534abbca5c
45 changed files with 120 additions and 49 deletions

View File

@ -1 +1 @@
5b02d173c15b509380185dfc6bb06fde914fbde7
0e5069804c3d90814f4f68a89510b58148390a78

View File

@ -1 +1 @@
4b136661d4fc7104dbd8952f3ce47b7fd4919b23
e4efeac42335109229714144733b3091f80ae170

View File

@ -29,9 +29,18 @@ using System.Diagnostics;
using System.Threading;
using NUnit.Framework.Api;
using System.Collections.Generic;
using System.Runtime.Remoting.Messaging;
namespace NUnit.Framework.Internal
{
[Serializable]
class Container : ILogicalThreadAffinative {
public Guid guid;
public Container(Guid guid) {
this.guid = guid;
}
}
public class FinallyDelegate
{
// If our test spawns a thread that throws, we will bubble
@ -49,19 +58,32 @@ namespace NUnit.Framework.Internal
// so we need a stack of finally delegate continuations
Stack<Tuple<TestExecutionContext, long, TestResult>> testStack;
Dictionary<Guid, TestResult> lookupTable;
private static readonly string CONTEXT_KEY = "TestResultName";
public FinallyDelegate () {
this.testStack = new Stack<Tuple<TestExecutionContext, long, TestResult>>();
this.lookupTable = new Dictionary<Guid, TestResult>();
}
public void Set (TestExecutionContext context, long startTicks, TestResult result) {
var frame = new Tuple<TestExecutionContext, long, TestResult>(context, startTicks, result);
/* keep name in LogicalCallContext, because this will be inherited by
* Threads spawned by the test case */
var guid = Guid.NewGuid();
CallContext.SetData(CONTEXT_KEY, new Container(guid));
this.lookupTable.Add(guid, result);
this.testStack.Push(frame);
}
public void HandleUnhandledExc (Exception ex) {
TestExecutionContext context = this.testStack.Peek().Item1;
context.CurrentResult.RecordException(ex);
context.CurrentResult.ThreadCrashFail = true;
Container c = (Container) CallContext.GetData(CONTEXT_KEY);
TestResult result = this.lookupTable [c.guid];
result.RecordException(ex);
result.ThreadCrashFail = true;
}
public void Complete () {

View File

@ -180,6 +180,15 @@ namespace NUnit.Framework.Internal.WorkItems
#endif
private void RunTest()
{
/* using a separate ExecutionContext for every test case,
* guarantees us to have a dedicated "namespace" for the
* LogicalCallContext per testcase */
ExecutionContext ec = ExecutionContext.Capture();
ExecutionContext.Run(ec, DispatchWork, null);
}
private void DispatchWork(object o)
{
_context.CurrentTest = this.Test;
_context.CurrentResult = this.Result;
@ -192,7 +201,7 @@ namespace NUnit.Framework.Internal.WorkItems
long startTicks = Stopwatch.GetTimestamp();
#endif
finD.Set(_context, startTicks, Result);
finD?.Set(_context, startTicks, Result);
PerformWork();
}
@ -211,7 +220,7 @@ namespace NUnit.Framework.Internal.WorkItems
/// </summary>
protected void WorkItemComplete()
{
finD.Complete();
finD?.Complete();
_state = WorkItemState.Complete;
if (Completed != null)
Completed(this, EventArgs.Empty);

View File

@ -34,7 +34,7 @@ static class Consts
// Use these assembly version constants to make code more maintainable.
//
public const string MonoVersion = "5.10.0.130";
public const string MonoVersion = "5.10.0.132";
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";

View File

@ -1 +1 @@
26ea60ec41ad2706e3bae8d3a2064124e86ba579
ce18802ab9fddeab8c3df4d80d4920c0078beb8a

View File

@ -1 +1 @@
eab35ff7cf70feda7b2fe9be9a3f41e44e2fcd16
70bd018a65dbc16d9249e9f89aeb73904e06ae5a

View File

@ -1 +1 @@
22d78d26fdb7091c7fb1aeb34020e5a174443ef1
d66447f952feb4ec5829e5829e3d25dd8af939e4

View File

@ -1 +1 @@
b5dcf3ba8e3d663ac68168bcbaceb0c37ba70470
bc2df173bcd5877ac4b9a0147065291f7090ede0

View File

@ -1 +1 @@
65174aa10ad5127ea9241e44a005688ac56f69a1
5ce5b47ab7ee19494ca4bb2e4d7fe0285165199a

View File

@ -1 +1 @@
526a8bd343958be03f0d9536878f174c176632e6
73f330f118271340beadba9943f025f51326505b

View File

@ -1 +1 @@
eec0952259611a7cdb73f8953f0aa80e1bb28ca1
90445e4b34c276c86330ebdab580339e96320d17

View File

@ -1 +1 @@
26ea60ec41ad2706e3bae8d3a2064124e86ba579
ce18802ab9fddeab8c3df4d80d4920c0078beb8a

View File

@ -1 +1 @@
eab35ff7cf70feda7b2fe9be9a3f41e44e2fcd16
70bd018a65dbc16d9249e9f89aeb73904e06ae5a

View File

@ -1 +1 @@
22d78d26fdb7091c7fb1aeb34020e5a174443ef1
d66447f952feb4ec5829e5829e3d25dd8af939e4

View File

@ -1 +1 @@
b5dcf3ba8e3d663ac68168bcbaceb0c37ba70470
bc2df173bcd5877ac4b9a0147065291f7090ede0

View File

@ -1 +1 @@
65174aa10ad5127ea9241e44a005688ac56f69a1
5ce5b47ab7ee19494ca4bb2e4d7fe0285165199a

View File

@ -1 +1 @@
526a8bd343958be03f0d9536878f174c176632e6
73f330f118271340beadba9943f025f51326505b

View File

@ -1 +1 @@
eec0952259611a7cdb73f8953f0aa80e1bb28ca1
90445e4b34c276c86330ebdab580339e96320d17

View File

@ -1 +1 @@
26ea60ec41ad2706e3bae8d3a2064124e86ba579
ce18802ab9fddeab8c3df4d80d4920c0078beb8a

Some files were not shown because too many files have changed in this diff Show More