Imported Upstream version 6.4.0.137

Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-07-26 19:53:28 +00:00
parent e9207cf623
commit ef583813eb
2712 changed files with 74169 additions and 40587 deletions

View File

@@ -11,7 +11,6 @@ using NUnit.Framework;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Emit;
using CS = Microsoft.CodeAnalysis.CSharp;
using VB = Microsoft.CodeAnalysis.VisualBasic;
#endif
namespace Mono.Cecil.Tests {
@@ -37,6 +36,14 @@ namespace Mono.Cecil.Tests {
get { return TryGetType ("System.Runtime.Loader.AssemblyLoadContext, System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") != null; }
}
public static bool OnWindows {
get { return Environment.OSVersion.Platform == PlatformID.Win32NT; }
}
public static bool HasNativePdbSupport {
get { return OnWindows && !OnMono; }
}
static Type TryGetType (string assemblyQualifiedName)
{
try {
@@ -90,7 +97,7 @@ namespace Mono.Cecil.Tests {
if (extension == ".il")
return IlasmCompilationService.Instance.Compile (name);
if (extension == ".cs" || extension == ".vb")
if (extension == ".cs")
#if NET_CORE
return RoslynCompilationService.Instance.Compile (name);
#else
@@ -182,14 +189,6 @@ namespace Mono.Cecil.Tests {
new [] { CS.SyntaxFactory.ParseSyntaxTree (source) },
references,
new CS.CSharpCompilationOptions (OutputKind.DynamicallyLinkedLibrary, optimizationLevel: OptimizationLevel.Release));
case ".vb":
return VB.VisualBasicCompilation.Create (
assemblyName,
new [] { VB.SyntaxFactory.ParseSyntaxTree (source) },
references,
new VB.VisualBasicCompilationOptions (OutputKind.DynamicallyLinkedLibrary, optimizationLevel: OptimizationLevel.Release));
default:
throw new NotSupportedException ();
}
@@ -320,7 +319,7 @@ namespace Mono.Cecil.Tests {
public static ProcessOutput ILAsm (string source, string output)
{
var ilasm = "ilasm";
if (!Platform.OnMono)
if (Platform.OnWindows)
ilasm = NetFrameworkTool ("ilasm");
return RunProcess (ilasm, "/nologo", "/dll", "/out:" + Quote (output), Quote (source));