|
|
|
|
@ -93,6 +93,10 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
@@ -93,6 +93,10 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
|
|
|
|
|
|
|
|
|
|
public static partial class Tester |
|
|
|
|
{ |
|
|
|
|
public const string CurrentNetCoreVersion = "11.0"; |
|
|
|
|
public const string CurrentNetCoreAppVersion = ".NETCoreApp,Version=v11.0"; |
|
|
|
|
public const string CurrentNetCoreRefAsmVersion = "11.0.0-preview.2.26159.112"; |
|
|
|
|
|
|
|
|
|
public static readonly string TesterPath; |
|
|
|
|
public static readonly string TestCasePath; |
|
|
|
|
|
|
|
|
|
@ -108,9 +112,9 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
@@ -108,9 +112,9 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
|
|
|
|
|
TesterPath = Path.GetDirectoryName(typeof(Tester).Assembly.Location); |
|
|
|
|
TestCasePath = Path.Combine(TesterPath, "../../../../TestCases"); |
|
|
|
|
#if DEBUG
|
|
|
|
|
testRunnerBasePath = Path.Combine(TesterPath, "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Debug/net10.0"); |
|
|
|
|
testRunnerBasePath = Path.Combine(TesterPath, $"../../../../../ICSharpCode.Decompiler.TestRunner/bin/Debug/net{CurrentNetCoreVersion}"); |
|
|
|
|
#else
|
|
|
|
|
testRunnerBasePath = Path.Combine(TesterPath, "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net10.0"); |
|
|
|
|
testRunnerBasePath = Path.Combine(TesterPath, $"../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net{CurrentNetCoreVersion}"); |
|
|
|
|
#endif
|
|
|
|
|
// To parse: <Project><ItemGroup><PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0-3.final" />
|
|
|
|
|
packagesPropsFile = Path.Combine(TesterPath, "../../../../../Directory.Packages.props"); |
|
|
|
|
@ -136,6 +140,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
@@ -136,6 +140,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
|
|
|
|
|
await vswhereToolset.Fetch().ConfigureAwait(false); |
|
|
|
|
await RefAssembliesToolset.Fetch("5.0.0", sourcePath: "ref/net5.0").ConfigureAwait(false); |
|
|
|
|
await RefAssembliesToolset.Fetch("10.0.0", sourcePath: "ref/net10.0").ConfigureAwait(false); |
|
|
|
|
await RefAssembliesToolset.Fetch(CurrentNetCoreRefAsmVersion, sourcePath: $"ref/net{CurrentNetCoreVersion}").ConfigureAwait(false); |
|
|
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
|
await BuildTestRunner("win-x86", "Debug").ConfigureAwait(false); |
|
|
|
|
@ -341,7 +346,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
@@ -341,7 +346,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static readonly Dictionary<string, Lazy<string>> targetFrameworkAttributeSnippetFiles = new() { |
|
|
|
|
{ ".NETCoreApp,Version=v10.0", new Lazy<string>(() => GetTargetFrameworkAttributeSnippetFile(".NETCoreApp,Version=v10.0")) }, |
|
|
|
|
{ CurrentNetCoreAppVersion, new Lazy<string>(() => GetTargetFrameworkAttributeSnippetFile(CurrentNetCoreAppVersion)) }, |
|
|
|
|
{ ".NETCoreApp,Version=v5.0", new Lazy<string>(() => GetTargetFrameworkAttributeSnippetFile(".NETCoreApp,Version=v5.0")) }, |
|
|
|
|
{ ".NETCoreApp,Version=v2.2", new Lazy<string>(() => GetTargetFrameworkAttributeSnippetFile(".NETCoreApp,Version=v2.2")) }, |
|
|
|
|
}; |
|
|
|
|
@ -454,12 +459,15 @@ namespace System.Runtime.CompilerServices
@@ -454,12 +459,15 @@ namespace System.Runtime.CompilerServices
|
|
|
|
|
preprocessorSymbols.Add("NET80"); |
|
|
|
|
preprocessorSymbols.Add("NET90"); |
|
|
|
|
preprocessorSymbols.Add("NET100"); |
|
|
|
|
preprocessorSymbols.Add("NET110"); |
|
|
|
|
} |
|
|
|
|
preprocessorSymbols.Add("ROSLYN4"); |
|
|
|
|
preprocessorSymbols.Add("CS100"); |
|
|
|
|
preprocessorSymbols.Add("CS110"); |
|
|
|
|
preprocessorSymbols.Add("CS120"); |
|
|
|
|
preprocessorSymbols.Add("CS130"); |
|
|
|
|
preprocessorSymbols.Add("CS140"); |
|
|
|
|
preprocessorSymbols.Add("CS150"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if ((flags & CompilerOptions.UseMcsMask) != 0) |
|
|
|
|
@ -520,7 +528,7 @@ namespace System.Runtime.CompilerServices
@@ -520,7 +528,7 @@ namespace System.Runtime.CompilerServices
|
|
|
|
|
CompilerOptions.UseRoslyn1_3_2 => ("1.3.2", "6", null), |
|
|
|
|
CompilerOptions.UseRoslyn2_10_0 => ("2.10.0", "latest", targetNet40 ? null : ".NETCoreApp,Version=v2.2"), |
|
|
|
|
CompilerOptions.UseRoslyn3_11_0 => ("3.11.0", "latest", targetNet40 ? null : ".NETCoreApp,Version=v5.0"), |
|
|
|
|
_ => (roslynLatestVersion, flags.HasFlag(CompilerOptions.Preview) ? "preview" : "latest", targetNet40 ? null : ".NETCoreApp,Version=v10.0") |
|
|
|
|
_ => (roslynLatestVersion, flags.HasFlag(CompilerOptions.Preview) ? "preview" : "latest", targetNet40 ? null : CurrentNetCoreAppVersion) |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
var cscPath = roslynToolset.GetCSharpCompiler(roslynVersion); |
|
|
|
|
@ -770,7 +778,7 @@ namespace System.Runtime.CompilerServices
@@ -770,7 +778,7 @@ namespace System.Runtime.CompilerServices
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var compilation = CSharpCompilation.Create(Path.GetFileNameWithoutExtension(assemblyName), |
|
|
|
|
syntaxTrees, coreDefaultReferences.Select(r => MetadataReference.CreateFromFile(Path.Combine(RefAssembliesToolset.GetPath(".NETCoreApp,Version=v10.0"), r))), |
|
|
|
|
syntaxTrees, coreDefaultReferences.Select(r => MetadataReference.CreateFromFile(Path.Combine(RefAssembliesToolset.GetPath(CurrentNetCoreAppVersion), r))), |
|
|
|
|
new CSharpCompilationOptions( |
|
|
|
|
OutputKind.DynamicallyLinkedLibrary, |
|
|
|
|
platform: Platform.AnyCpu, |
|
|
|
|
|