You've already forked linux-packaging-mono
Imported Upstream version 4.8.0.309
Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
parent
ee1447783b
commit
94b2861243
4
external/cecil/symbols/mdb/Test/.gitignore
vendored
4
external/cecil/symbols/mdb/Test/.gitignore
vendored
@@ -1,4 +0,0 @@
|
||||
bin
|
||||
obj
|
||||
*.xml
|
||||
*.user
|
||||
@@ -1,77 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">net_4_0_Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{AC71DF9C-99FA-4A63-990A-66C8010355A6}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Mono.Cecil.Mdb.Tests</RootNamespace>
|
||||
<AssemblyName>Mono.Cecil.Mdb.Tests</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0_Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\net_2_0_Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0_Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\net_2_0_Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_3_5_Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\net_3_5_Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NET_3_5</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_3_5_Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\net_3_5_Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NET_3_5</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_4_0_Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\net_4_0_Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NET_3_5;NET_4_0</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_4_0_Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\net_4_0_Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NET_3_5;NET_4_0</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(TargetFrameworkVersion)' != 'v2.0' ">
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Mono.Cecil.csproj">
|
||||
<Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project>
|
||||
@@ -87,33 +20,11 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Mono.Cecil.Tests\Addin.cs" />
|
||||
<Compile Include="Mono.Cecil.Tests\MdbTests.cs" />
|
||||
<Compile Include="Mono.Cecil.Tests\*.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Resources\assemblies\hello.exe" />
|
||||
<Content Include="Resources\assemblies\hello.exe.mdb" />
|
||||
<None Include="Resources\**\*" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="nunit.core">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\Test\libs\nunit-2.6.2\nunit.core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.core.interfaces">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\Test\libs\nunit-2.6.2\nunit.core.interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\Test\libs\nunit-2.6.2\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<Import Project="..\..\..\Mono.Cecil.Tests.props" />
|
||||
<Import Project="$(MSBuildCSharpTargets)" />
|
||||
</Project>
|
||||
@@ -1,8 +0,0 @@
|
||||
using NUnit.Core.Extensibility;
|
||||
|
||||
namespace Mono.Cecil.Tests {
|
||||
|
||||
[NUnitAddin]
|
||||
public class CecilMdbAddin : CecilTestAddin {
|
||||
}
|
||||
}
|
||||
@@ -8,25 +8,26 @@ namespace Mono.Cecil.Tests {
|
||||
[TestFixture]
|
||||
public class MdbTests : BaseTestFixture {
|
||||
|
||||
[TestModule ("hello.exe", SymbolReaderProvider = typeof (MdbReaderProvider), SymbolWriterProvider = typeof (MdbWriterProvider))]
|
||||
public void Main (ModuleDefinition module)
|
||||
[Test]
|
||||
public void MdbWithJustLineInfo ()
|
||||
{
|
||||
var type = module.GetType ("Program");
|
||||
var main = type.GetMethod ("Main");
|
||||
TestModule ("hello.exe", module => {
|
||||
var type = module.GetType ("Program");
|
||||
var main = type.GetMethod ("Main");
|
||||
|
||||
AssertCode (@"
|
||||
AssertCode (@"
|
||||
.locals init (System.Int32 i)
|
||||
.line 7,7:0,0 'C:\sources\cecil\symbols\Mono.Cecil.Mdb\Test\Resources\assemblies\hello.cs'
|
||||
.line 6,-1:-1,-1 'C:\sources\cecil\symbols\Mono.Cecil.Mdb\Test\Resources\assemblies\hello.cs'
|
||||
IL_0000: ldc.i4.0
|
||||
IL_0001: stloc.0
|
||||
.line 7,7:0,0 'C:\sources\cecil\symbols\Mono.Cecil.Mdb\Test\Resources\assemblies\hello.cs'
|
||||
.line 7,-1:-1,-1 'C:\sources\cecil\symbols\Mono.Cecil.Mdb\Test\Resources\assemblies\hello.cs'
|
||||
IL_0002: br IL_0013
|
||||
.line 8,8:0,0 'C:\sources\cecil\symbols\Mono.Cecil.Mdb\Test\Resources\assemblies\hello.cs'
|
||||
.line 8,-1:-1,-1 'C:\sources\cecil\symbols\Mono.Cecil.Mdb\Test\Resources\assemblies\hello.cs'
|
||||
IL_0007: ldarg.0
|
||||
IL_0008: ldloc.0
|
||||
IL_0009: ldelem.ref
|
||||
IL_000a: call System.Void Program::Print(System.String)
|
||||
.line 7,7:0,0 'C:\sources\cecil\symbols\Mono.Cecil.Mdb\Test\Resources\assemblies\hello.cs'
|
||||
.line 7,-1:-1,-1 'C:\sources\cecil\symbols\Mono.Cecil.Mdb\Test\Resources\assemblies\hello.cs'
|
||||
IL_000f: ldloc.0
|
||||
IL_0010: ldc.i4.1
|
||||
IL_0011: add
|
||||
@@ -36,23 +37,50 @@ namespace Mono.Cecil.Tests {
|
||||
IL_0015: ldlen
|
||||
IL_0016: conv.i4
|
||||
IL_0017: blt IL_0007
|
||||
.line 10,10:0,0 'C:\sources\cecil\symbols\Mono.Cecil.Mdb\Test\Resources\assemblies\hello.cs'
|
||||
.line 10,-1:-1,-1 'C:\sources\cecil\symbols\Mono.Cecil.Mdb\Test\Resources\assemblies\hello.cs'
|
||||
IL_001c: ldc.i4.0
|
||||
IL_001d: ret
|
||||
", main);
|
||||
}, symbolReaderProvider: typeof(MdbReaderProvider), symbolWriterProvider: typeof(MdbWriterProvider));
|
||||
}
|
||||
|
||||
static void AssertCode (string expected, MethodDefinition method)
|
||||
[Test]
|
||||
public void RoundTripCoreLib ()
|
||||
{
|
||||
Assert.IsTrue (method.HasBody);
|
||||
Assert.IsNotNull (method.Body);
|
||||
TestModule ("mscorlib.dll", module => {
|
||||
var type = module.GetType ("System.IO.__Error");
|
||||
var method = type.GetMethod ("WinIOError");
|
||||
|
||||
Assert.AreEqual (Normalize (expected), Normalize (Formatter.FormatMethodBody (method)));
|
||||
Assert.IsNotNull (method.Body);
|
||||
}, verify: !Platform.OnMono, symbolReaderProvider: typeof(MdbReaderProvider), symbolWriterProvider: typeof(MdbWriterProvider));
|
||||
}
|
||||
|
||||
static string Normalize (string str)
|
||||
[Test]
|
||||
public void PartialClass ()
|
||||
{
|
||||
return str.Trim ().Replace ("\r\n", "\n");
|
||||
TestModule ("BreakpointTest.Portable.dll", module => {
|
||||
var type = module.GetType ("BreakpointTest.Portable.TestService/<MyAsyncAction1>c__async3");
|
||||
var method = type.GetMethod ("MoveNext");
|
||||
|
||||
Assert.IsNotNull (method);
|
||||
|
||||
var info = method.DebugInformation;
|
||||
Assert.AreEqual (5, info.SequencePoints.Count);
|
||||
foreach (var sp in info.SequencePoints)
|
||||
Assert.AreEqual(@"C:\tmp\repropartial\BreakpointTest.Portable\TestService.Actions.cs", sp.Document.Url);
|
||||
|
||||
type = module.GetType("BreakpointTest.Portable.TestService/<MyAsyncAction2>c__async2");
|
||||
method = type.GetMethod("MoveNext");
|
||||
|
||||
Assert.IsNotNull(method);
|
||||
|
||||
info = method.DebugInformation;
|
||||
Assert.AreEqual(5, info.SequencePoints.Count);
|
||||
foreach (var sp in info.SequencePoints)
|
||||
Assert.AreEqual(@"C:\tmp\repropartial\BreakpointTest.Portable\TestService.cs", sp.Document.Url);
|
||||
|
||||
|
||||
}, symbolReaderProvider: typeof(MdbReaderProvider), symbolWriterProvider: typeof(MdbWriterProvider));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
external/cecil/symbols/mdb/Test/Resources/assemblies/BreakpointTest.Portable.dll.mdb
vendored
Normal file
BIN
external/cecil/symbols/mdb/Test/Resources/assemblies/BreakpointTest.Portable.dll.mdb
vendored
Normal file
Binary file not shown.
1
external/cecil/symbols/mdb/Test/Resources/assemblies/mscorlib.dll.mdb.REMOVED.git-id
vendored
Normal file
1
external/cecil/symbols/mdb/Test/Resources/assemblies/mscorlib.dll.mdb.REMOVED.git-id
vendored
Normal file
@@ -0,0 +1 @@
|
||||
f997a8c39889b310ac6995842263f24ef6d94396
|
||||
Reference in New Issue
Block a user