Browse Source

Merge pull request #643 from lvv83/nunit_ex

pull/676/head
Andreas Weizel 10 years ago
parent
commit
caff9dbb8d
  1. 2
      src/AddIns/Analysis/UnitTesting/Model/TestProjectBase.cs
  2. 1
      src/AddIns/Analysis/UnitTesting/Test/NUnit/NUnitTestResultFailureTestFixture.cs
  3. 24
      src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/OutputTextLineParser.cs

2
src/AddIns/Analysis/UnitTesting/Model/TestProjectBase.cs

@ -42,7 +42,7 @@ namespace ICSharpCode.UnitTesting @@ -42,7 +42,7 @@ namespace ICSharpCode.UnitTesting
IProject project;
Dictionary<TopLevelTypeName, ITest> topLevelTestClasses = new Dictionary<TopLevelTypeName, ITest>();
public TestProjectBase(IProject project)
protected TestProjectBase(IProject project)
{
if (project == null)
throw new ArgumentNullException("project");

1
src/AddIns/Analysis/UnitTesting/Test/NUnit/NUnitTestResultFailureTestFixture.cs

@ -18,7 +18,6 @@ @@ -18,7 +18,6 @@
using System;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop;
using ICSharpCode.UnitTesting;
using NUnit.Framework;

24
src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/OutputTextLineParser.cs

@ -95,7 +95,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -95,7 +95,7 @@ namespace ICSharpCode.SharpDevelop.Gui
FileLineReference result = null;
if (lineText != null) {
Match match = Regex.Match(lineText, GetStackFrameRegex(), regexOptions);
Match match = CreateStackTraceMatch(lineText, regexOptions);
while (match.Success) {
try {
int line = Convert.ToInt32(match.Groups[2].Value);
@ -115,15 +115,25 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -115,15 +115,25 @@ namespace ICSharpCode.SharpDevelop.Gui
.GetMethod("GetResourceString", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic,
null, new[] { typeof(string) }, null);
static string GetStackFrameRegex()
static Match CreateStackTraceMatch(string lineText, RegexOptions regexOptions)
{
string line = "in {0}:line {1}";
string line = "in {0}:line {1}", pattern;
bool useResourceString = false;
Match match;
if (GetResourceString != null) {
do
{
pattern = line.Replace("{0}", @"(\w:[/\\].*?)").Replace("{1}", @"(\d+)");
match = Regex.Match(lineText, pattern, regexOptions);
if (useResourceString || match.Success || GetResourceString == null)
break;
line = (string)GetResourceString.Invoke(null, new[] { "StackTrace_InFileLineNumber" });
}
return line.Replace("{0}", @"(\w:[/\\].*?)").Replace("{1}", @"(\d+)");
useResourceString = true;
} while (true);
return match;
}
/// <summary>

Loading…
Cancel
Save