Skip to content

Commit

Permalink
Enable EnC and PDB tests on Core (#37750)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed Sep 10, 2019
1 parent ccd59ac commit 798885c
Show file tree
Hide file tree
Showing 29 changed files with 1,159 additions and 1,172 deletions.
4 changes: 2 additions & 2 deletions eng/Versions.props
Expand Up @@ -68,8 +68,8 @@
<MicrosoftDiagnosticsRuntimeVersion>0.8.31-beta</MicrosoftDiagnosticsRuntimeVersion>
<MicrosoftDiagnosticsTracingTraceEventVersion>1.0.35</MicrosoftDiagnosticsTracingTraceEventVersion>
<MicrosoftDiaSymReaderVersion>1.3.0</MicrosoftDiaSymReaderVersion>
<MicrosoftDiaSymReaderConverterVersion>1.1.0-beta1-63314-01</MicrosoftDiaSymReaderConverterVersion>
<MicrosoftDiaSymReaderConverterXmlVersion>1.1.0-beta1-63314-01</MicrosoftDiaSymReaderConverterXmlVersion>
<MicrosoftDiaSymReaderConverterVersion>1.1.0-beta2-19409-01</MicrosoftDiaSymReaderConverterVersion>
<MicrosoftDiaSymReaderConverterXmlVersion>1.1.0-beta2-19409-01</MicrosoftDiaSymReaderConverterXmlVersion>
<MicrosoftDiaSymReaderNativeVersion>1.7.0</MicrosoftDiaSymReaderNativeVersion>
<MicrosoftDiaSymReaderPortablePdbVersion>1.5.0</MicrosoftDiaSymReaderPortablePdbVersion>
<MicrosoftDotNetVersionToolsVersion>3.0.0-preview1-03617-02</MicrosoftDotNetVersionToolsVersion>
Expand Down
Expand Up @@ -15,12 +15,11 @@ namespace Microsoft.CodeAnalysis.CSharp.EditAndContinue.UnitTests
{
public class EditAndContinuePdbTests : EditAndContinueTestBase
{
[ConditionalTheory(typeof(WindowsOnly), Reason = ConditionalSkipReason.NativePdbRequiresDesktop)]
[InlineData(DebugInformationFormat.Pdb)]
[InlineData(DebugInformationFormat.PortablePdb)]
[Theory]
[MemberData(nameof(ExternalPdbFormats))]
public void MethodExtents(DebugInformationFormat format)
{
var source0 = MarkedSource(@"#pragma checksum ""C:\Enc1.cs"" ""{ff1816ec-aa5e-4d10-87f7-6f4963833460}"" ""1111111111111111111111111111111111111111""
var source0 = MarkedSource(WithWindowsLineBreaks(@"#pragma checksum ""C:\Enc1.cs"" ""{ff1816ec-aa5e-4d10-87f7-6f4963833460}"" ""1111111111111111111111111111111111111111""
using System;
public class C
Expand Down Expand Up @@ -49,9 +48,9 @@ void G()
}</N:1>;
}
}
", fileName: @"C:\Enc1.cs");
"), fileName: @"C:\Enc1.cs");

var source1 = MarkedSource(@"#pragma checksum ""C:\Enc1.cs"" ""{ff1816ec-aa5e-4d10-87f7-6f4963833460}"" ""2222222222222222222222222222222222222222""
var source1 = MarkedSource(WithWindowsLineBreaks(@"#pragma checksum ""C:\Enc1.cs"" ""{ff1816ec-aa5e-4d10-87f7-6f4963833460}"" ""2222222222222222222222222222222222222222""
using System;
public class C
Expand Down Expand Up @@ -80,9 +79,9 @@ void G()
int E() => 1;
}
", fileName: @"C:\Enc1.cs");
"), fileName: @"C:\Enc1.cs");

var source2 = MarkedSource(@"#pragma checksum ""C:\Enc1.cs"" ""{ff1816ec-aa5e-4d10-87f7-6f4963833460}"" ""3333333333333333333333333333333333333333""
var source2 = MarkedSource(WithWindowsLineBreaks(@"#pragma checksum ""C:\Enc1.cs"" ""{ff1816ec-aa5e-4d10-87f7-6f4963833460}"" ""3333333333333333333333333333333333333333""
using System;
public class C
Expand Down Expand Up @@ -113,7 +112,7 @@ void G()
int B() => 4;
}
", fileName: @"C:\Enc1.cs");
"), fileName: @"C:\Enc1.cs");

var compilation0 = CreateCompilation(source0.Tree, options: ComSafeDebugDll.WithMetadataImportOptions(MetadataImportOptions.All), assemblyName: "EncMethodExtents");
var compilation1 = compilation0.WithSource(source1.Tree);
Expand Down Expand Up @@ -169,16 +168,15 @@ void G()

if (format == DebugInformationFormat.PortablePdb)
{
using (var pdbProvider = MetadataReaderProvider.FromPortablePdbImage(diff1.PdbDelta))
{
CheckEncMap(pdbProvider.GetMetadataReader(),
Handle(2, TableIndex.MethodDebugInformation),
Handle(4, TableIndex.MethodDebugInformation),
Handle(8, TableIndex.MethodDebugInformation),
Handle(9, TableIndex.MethodDebugInformation),
Handle(10, TableIndex.MethodDebugInformation),
Handle(11, TableIndex.MethodDebugInformation));
}
using var pdbProvider = MetadataReaderProvider.FromPortablePdbImage(diff1.PdbDelta);

CheckEncMap(pdbProvider.GetMetadataReader(),
Handle(2, TableIndex.MethodDebugInformation),
Handle(4, TableIndex.MethodDebugInformation),
Handle(8, TableIndex.MethodDebugInformation),
Handle(9, TableIndex.MethodDebugInformation),
Handle(10, TableIndex.MethodDebugInformation),
Handle(11, TableIndex.MethodDebugInformation));
}

diff1.VerifyPdb(Enumerable.Range(0x06000001, 20), @"
Expand Down Expand Up @@ -290,16 +288,15 @@ void G()

if (format == DebugInformationFormat.PortablePdb)
{
using (var pdbProvider = MetadataReaderProvider.FromPortablePdbImage(diff2.PdbDelta))
{
CheckEncMap(pdbProvider.GetMetadataReader(),
Handle(1, TableIndex.MethodDebugInformation),
Handle(2, TableIndex.MethodDebugInformation),
Handle(4, TableIndex.MethodDebugInformation),
Handle(9, TableIndex.MethodDebugInformation),
Handle(11, TableIndex.MethodDebugInformation),
Handle(12, TableIndex.MethodDebugInformation));
}
using var pdbProvider = MetadataReaderProvider.FromPortablePdbImage(diff2.PdbDelta);

CheckEncMap(pdbProvider.GetMetadataReader(),
Handle(1, TableIndex.MethodDebugInformation),
Handle(2, TableIndex.MethodDebugInformation),
Handle(4, TableIndex.MethodDebugInformation),
Handle(9, TableIndex.MethodDebugInformation),
Handle(11, TableIndex.MethodDebugInformation),
Handle(12, TableIndex.MethodDebugInformation));
}

diff2.VerifyPdb(Enumerable.Range(0x06000001, 20), @"
Expand Down

0 comments on commit 798885c

Please sign in to comment.