Browse Source

Fix file locking issue in tests

pull/2678/head
Andrew Crawley (US - DIAGNOSTICS) 3 years ago committed by Siegfried Pammer
parent
commit
071ca33561
  1. 1
      ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
  2. 2
      ICSharpCode.Decompiler.Tests/PdbGenerationTestRunner.cs
  3. 19
      ICSharpCode.Decompiler.Tests/TestCases/PdbGen/CustomPdbId.xml

1
ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj

@ -307,6 +307,7 @@ @@ -307,6 +307,7 @@
<ItemGroup>
<Content Include="TestCases\PdbGen\ForLoopTests.xml" />
<Content Include="TestCases\PdbGen\CustomPdbId.xml" />
<Content Include="TestCases\PdbGen\HelloWorld.xml" />
<Content Include="TestCases\PdbGen\LambdaCapturing.xml" />
</ItemGroup>

2
ICSharpCode.Decompiler.Tests/PdbGenerationTestRunner.cs

@ -51,7 +51,7 @@ namespace ICSharpCode.Decompiler.Tests @@ -51,7 +51,7 @@ namespace ICSharpCode.Decompiler.Tests
public void CustomPdbId()
{
// Generate a PDB for an assembly using a randomly-generated ID, then validate that the PDB uses the specified ID
(string peFileName, string pdbFileName) = CompileTestCase(nameof(HelloWorld));
(string peFileName, string pdbFileName) = CompileTestCase(nameof(CustomPdbId));
var moduleDefinition = new PEFile(peFileName);
var resolver = new UniversalAssemblyResolver(peFileName, false, moduleDefinition.Metadata.DetectTargetFrameworkId(), null, PEStreamOptions.PrefetchEntireImage);

19
ICSharpCode.Decompiler.Tests/TestCases/PdbGen/CustomPdbId.xml

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<symbols>
<files>
<file id="1" name="ICSharpCode.Decompiler.Tests.TestCases.PdbGen\HelloWorld.cs" language="C#" checksumAlgorithm="SHA256"><![CDATA[using System;
namespace ICSharpCode.Decompiler.Tests.TestCases.PdbGen;
public class HelloWorld
{
public static void Main(string[] args)
{
Console.ReadKey();
Console.WriteLine("Hello World!");
Console.ReadKey();
}
}
]]></file>
</files>
</symbols>
Loading…
Cancel
Save