Browse Source

Remove FSharp.Compiler.Service

pull/681/head
Daniel Grunwald 9 years ago
parent
commit
ddf2b88b3a
  1. 23
      ICSharpCode.Decompiler/Tests/FSharpPatterns/TestHelpers.cs
  2. 4
      ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj
  3. 1
      ICSharpCode.Decompiler/Tests/packages.config

23
ICSharpCode.Decompiler/Tests/FSharpPatterns/TestHelpers.cs

@ -24,23 +24,6 @@ namespace ICSharpCode.Decompiler.Tests.FSharpPatterns @@ -24,23 +24,6 @@ namespace ICSharpCode.Decompiler.Tests.FSharpPatterns
return new StreamReader(asm.GetManifestResourceStream(fullResourceName)).ReadToEnd();
}
// see https://fsharp.github.io/FSharp.Compiler.Service/compiler.html
public static string CompileFsToAssembly(string source, bool optimize)
{
var tmp = Path.GetTempFileName();
File.Delete(tmp);
var sourceFile = Path.ChangeExtension(tmp, ".fs");
File.WriteAllText(sourceFile, source);
var asmFile = Path.ChangeExtension(sourceFile, ".dll");
var sscs = new Microsoft.FSharp.Compiler.SimpleSourceCodeServices.SimpleSourceCodeServices();
var result = sscs.Compile(new[] { "fsc.exe", "--debug:full", "--optimize" + (optimize ? "+" : "-"), "--target:library", "-o", asmFile, sourceFile });
File.Delete(sourceFile);
Assert.AreEqual(0, result.Item1.Length);
Assert.AreEqual(0, result.Item2);
Assert.True(File.Exists(asmFile), "Assembly File does not exist");
return asmFile;
}
static Lazy<string> ilasm = new Lazy<string>(() => ToolLocator.FindTool("ilasm.exe"));
static Lazy<string> ildasm = new Lazy<string>(() => ToolLocator.FindTool("ildasm.exe"));
@ -72,12 +55,6 @@ namespace ICSharpCode.Decompiler.Tests.FSharpPatterns @@ -72,12 +55,6 @@ namespace ICSharpCode.Decompiler.Tests.FSharpPatterns
CompareAssemblyAgainstCSharp(expectedCSharpCode, asmFilePath);
}
public static void RunFSharp(string fsharpCode, string expectedCSharpCode, bool optimize)
{
var asmFilePath = CompileFsToAssembly(fsharpCode, optimize);
CompareAssemblyAgainstCSharp(expectedCSharpCode, asmFilePath);
}
private static void CompareAssemblyAgainstCSharp(string expectedCSharpCode, string asmFilePath)
{
var module = ModuleDefinition.ReadModule(asmFilePath);

4
ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj

@ -49,10 +49,6 @@ @@ -49,10 +49,6 @@
<Reference Include="DiffLib">
<HintPath>..\..\packages\DiffLib.1.0.0.55\lib\net35-Client\DiffLib.dll</HintPath>
</Reference>
<Reference Include="FSharp.Compiler.Service, Version=2.0.0.2, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\FSharp.Compiler.Service.2.0.0.2\lib\net45\FSharp.Compiler.Service.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.core, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll</HintPath>
<Private>False</Private>

1
ICSharpCode.Decompiler/Tests/packages.config

@ -1,6 +1,5 @@ @@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DiffLib" version="1.0.0.55" />
<package id="FSharp.Compiler.Service" version="2.0.0.2" targetFramework="net45" />
<package id="NUnitTestAdapter" version="2.0.0" targetFramework="net45" />
</packages>
Loading…
Cancel
Save