Browse Source

fix debugger unit tests for .NET 4.6 RC

pull/637/merge
Siegfried Pammer 10 years ago
parent
commit
b34492abe0
  1. 3
      src/AddIns/Debugger/Debugger.Tests/Debugger.Tests.csproj
  2. 13
      src/AddIns/Debugger/Debugger.Tests/DebuggerTestsBase.cs
  3. 1
      src/AddIns/Debugger/Debugger.Tests/Tests/Breakpoint_Tests.cs
  4. 1
      src/AddIns/Debugger/Debugger.Tests/Tests/Process_MemoryReadWrite.cs
  5. 1
      src/AddIns/Debugger/Debugger.Tests/Tests/StackFrame_SetIP.cs
  6. 3
      src/AddIns/Debugger/Debugger.Tests/Tests/_HelloWorldTest.cs
  7. 6
      src/Main/Base/Project/Util/DotnetDetection.cs

3
src/AddIns/Debugger/Debugger.Tests/Debugger.Tests.csproj

@ -44,6 +44,9 @@ @@ -44,6 +44,9 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\Main\Base\Project\Util\DotnetDetection.cs">
<Link>DotnetDetection.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="DebuggerTestsBase.cs" />
<Compile Include="Tests\AppDomain_Tests.cs" />

13
src/AddIns/Debugger/Debugger.Tests/DebuggerTestsBase.cs

@ -28,6 +28,7 @@ using System.Security.Cryptography; @@ -28,6 +28,7 @@ using System.Security.Cryptography;
using System.Text;
using System.Xml;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop;
using Microsoft.CSharp;
using NUnit.Framework;
@ -209,6 +210,10 @@ namespace Debugger.Tests @@ -209,6 +210,10 @@ namespace Debugger.Tests
void StartTest(string testName, bool wait)
{
if (!IsRuntimeCompatible()) {
Assert.Ignore();
return;
}
this.testName = testName;
string exeFilename = CompileTest(testName);
@ -595,5 +600,13 @@ namespace Debugger.Tests @@ -595,5 +600,13 @@ namespace Debugger.Tests
// (see https://github.com/icsharpcode/SharpDevelop/issues/581)
return true;
}
/// <summary>
/// Debugger Tests currently require .NET 4.6
/// </summary>
protected static bool IsRuntimeCompatible()
{
return DotnetDetection.IsDotnet46Installed();
}
}
}

1
src/AddIns/Debugger/Debugger.Tests/Tests/Breakpoint_Tests.cs

@ -92,6 +92,7 @@ namespace Debugger.Tests { @@ -92,6 +92,7 @@ namespace Debugger.Tests {
Line="30" />
</Breakpoint2>
<ModuleLoaded>System.Configuration.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>System.Core.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>System.Xml.dll (No symbols)</ModuleLoaded>
<LogMessage>Main 1\r\n</LogMessage>
<Paused>Breakpoint_Tests.cs:29,4-29,49</Paused>

1
src/AddIns/Debugger/Debugger.Tests/Tests/Process_MemoryReadWrite.cs

@ -88,6 +88,7 @@ namespace Debugger.Tests { @@ -88,6 +88,7 @@ namespace Debugger.Tests {
<hello>5 0 0 0 48 0 65 0 6C 0 6C 0 6F 0 </hello>
<world>6 0 0 0 20 0 20 0 20 0 20 0 20 0 21 0 </world>
<ModuleLoaded>System.Configuration.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>System.Core.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>System.Xml.dll (No symbols)</ModuleLoaded>
<LogMessage>Hello world!\r\n</LogMessage>
<Exited />

1
src/AddIns/Debugger/Debugger.Tests/Tests/StackFrame_SetIP.cs

@ -65,6 +65,7 @@ namespace Debugger.Tests { @@ -65,6 +65,7 @@ namespace Debugger.Tests {
<ModuleLoaded>StackFrame_SetIP.exe (Has symbols)</ModuleLoaded>
<ModuleLoaded>System.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>System.Configuration.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>System.Core.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>System.Xml.dll (No symbols)</ModuleLoaded>
<LogMessage>1\r\n</LogMessage>
<Paused>StackFrame_SetIP.cs:28,4-28,40</Paused>

3
src/AddIns/Debugger/Debugger.Tests/Tests/_HelloWorldTest.cs

@ -38,6 +38,8 @@ namespace Debugger.Tests { @@ -38,6 +38,8 @@ namespace Debugger.Tests {
[NUnit.Framework.Test]
public void _HelloWorldTest()
{
if (!IsRuntimeCompatible())
NUnit.Framework.Assert.Ignore();
StartTest();
EndTest();
@ -56,6 +58,7 @@ namespace Debugger.Tests { @@ -56,6 +58,7 @@ namespace Debugger.Tests {
<ModuleLoaded>_HelloWorldTest.exe (Has symbols)</ModuleLoaded>
<ModuleLoaded>System.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>System.Configuration.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>System.Core.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>System.Xml.dll (No symbols)</ModuleLoaded>
<LogMessage>Hello world!\r\n</LogMessage>
<Paused>_HelloWorldTest.cs:29,4-29,40</Paused>

6
src/Main/Base/Project/Util/DotnetDetection.cs

@ -66,6 +66,12 @@ namespace ICSharpCode.SharpDevelop @@ -66,6 +66,12 @@ namespace ICSharpCode.SharpDevelop
return GetDotnet4Release() >= 379893;
}
public static bool IsDotnet46Installed()
{
// 393273 is .NET 4.6 on my Win7 machine with VS 2015 RC installed
return GetDotnet4Release() >= 393273;
}
/// <summary>
/// Gets the .NET 4.x release number.
/// The numbers are documented on http://msdn.microsoft.com/en-us/library/hh925568.aspx

Loading…
Cancel
Save