~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/addins/NUnit/Services/ExternalTestRunner.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
                
119
119
                public void SuiteFinished (TestSuiteResult result)
120
120
                {
121
 
                        wrapped.SuiteFinished (GetTestName (result.Test.TestName), GetLocalTestResult (result));
 
121
                        testSuites.Pop ();
 
122
                        wrapped.SuiteFinished (GetTestName (result.Test), GetLocalTestResult (result));
122
123
                }
123
 
                
 
124
                Stack<string> testSuites = new Stack<string>();
124
125
                public void SuiteStarted (TestName suite)
125
126
                {
 
127
                        testSuites.Push (suite.FullName);
126
128
                        wrapped.SuiteStarted (GetTestName (suite));
127
129
                }
128
130
                
129
131
                public void TestFinished (TestCaseResult result)
130
132
                {
131
 
                        wrapped.TestFinished (GetTestName (result.Test.TestName), GetLocalTestResult (result));
 
133
                        wrapped.TestFinished (GetTestName (result.Test), GetLocalTestResult (result));
132
134
                }
133
135
                
134
136
                public void TestOutput (TestOutput testOutput)
155
157
                        return null;
156
158
                }
157
159
                
 
160
                string GetTestName (ITest t)
 
161
                {
 
162
                        if (t == null)
 
163
                                return null;
 
164
                        // Theoretically t.TestName.FullName should work, but when a test class inherits from a base
 
165
                        // class that contains tests the full name is that one of the base class, which is wrong.
 
166
                        // I suspect that is a NUnit bug, when this is fixed this code should be overworked and the testSuites stack be removed.
 
167
                        // see: Bug 677228 - RemotingException isn't counted as failure
 
168
                        if (t.TestType != "Test Case" || testSuites.Count == 0)
 
169
                                return t.TestName.FullName;
 
170
                        return testSuites.Peek () + "." + t.TestName.Name;
 
171
                }
 
172
                
158
173
                public string GetTestName (TestName t)
159
174
                {
160
175
                        if (t == null)