diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-09-26 13:23:26 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-09-26 13:24:07 +0400 |
commit | db0427eafdace2fe6efb031e897970c34af76e0b (patch) | |
tree | 037dafd697bd3ffc879ab8b0183f5abdd84c366b /main/src/addins/NUnit | |
parent | 7deebee280f4c702fc466a08b304b5ab2add7f82 (diff) |
Fixed 'Bug 1026 - Test hierarchies are not colored correctly during
testing (using Generics'.
Diffstat (limited to 'main/src/addins/NUnit')
-rw-r--r-- | main/src/addins/NUnit/Services/ExternalTestRunner.cs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/main/src/addins/NUnit/Services/ExternalTestRunner.cs b/main/src/addins/NUnit/Services/ExternalTestRunner.cs index 658d02866e..021ad15937 100644 --- a/main/src/addins/NUnit/Services/ExternalTestRunner.cs +++ b/main/src/addins/NUnit/Services/ExternalTestRunner.cs @@ -118,13 +118,14 @@ namespace MonoDevelop.NUnit.External public void SuiteFinished (TestSuiteResult result) { -// testSuites.Pop (); + testSuites.Pop (); wrapped.SuiteFinished (GetTestName (result.Test), GetLocalTestResult (result)); } -// Stack<string> testSuites = new Stack<string>(); + Stack<string> testSuites = new Stack<string>(); public void SuiteStarted (TestName suite) { -// testSuites.Push (suite.FullName); + Console.WriteLine ("start:"+suite.Name +"/"+suite.GetType ()); + testSuites.Push (suite.FullName); wrapped.SuiteStarted (GetTestName (suite)); } @@ -161,10 +162,18 @@ namespace MonoDevelop.NUnit.External { if (t == null) return null; -// if (t.TestType != "Test Case" || testSuites.Count == 0) + if (t.TestType != "Test Case" || testSuites.Count == 0) return t.TestName.FullName; -// return testSuites.Peek () + "." + t.TestName.Name; + // This is a work around for a nunit bug. + // see Bug 1026 - Test hierarchies are not colored correctly during testing (using Generics) for details + // Either t.TestName.FullName is wrong or t.TestName.Name (but not both at the same time) depending on + // the base class is generic or not. + string name = t.TestName.Name; + int idx = name.LastIndexOf ('.'); + if (idx >= 0) + name = name.Substring (idx + 1); + return testSuites.Peek () + "." + name; } public string GetTestName (TestName t) |