提交 1ce0fd18 编写于 作者: J Jared Parsons

Re-arranging portable TestUtilities part 2

The Compilers.sln solution is compiling again and tests which don't
require AppDomain support are running again.  There is a bit of work
that is needed for AppDomains that I want to separate out.  In
particular the separation to portable means we have to redo some of the
serialization code.
上级 9fbed0b6
......@@ -14,6 +14,10 @@
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Test\Utilities\CSharp.Desktop\CSharpCompilerTestUtilities.Desktop.csproj">
<Project>{7a4b2176-7bfd-4b75-a61a-e25a1fdd0a1e}</Project>
<Name>CSharpCompilerTestUtilities.Desktop</Name>
......@@ -55,8 +59,10 @@
<Name>PdbUtilities</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"></PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"></PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
......@@ -92,4 +98,4 @@
</EmbeddedResource>
</ItemGroup>
<Import Project="..\..\..\..\..\build\Targets\Imports.targets" />
</Project>
</Project>
\ No newline at end of file
......@@ -1927,7 +1927,7 @@ internal void Foo()
public void Bug399()
{
// The referenced assembly Signed.dll from the repro steps
var signed = CreateMetadataReferenceFromHexGZipImage(@"
var signed = DesktopRuntimeUtil.CreateMetadataReferenceFromHexGZipImage(@"
1f8b0800000000000400f38d9ac0c0ccc0c0c002c4ffff3330ec6080000706c2a00188f9e477f1316ce13cabb883d1e7ac62
484666b14241517e7a5162ae4272625e5e7e894252aa4251699e42669e828b7fb0426e7e4aaa1e2f2f970ad48c005706061f
4626869e0db74260e63e606052e466e486388a0922f64f094828c01d26006633419430302068860488f8790f06a0bf1c5a41
......
......@@ -22,6 +22,10 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Core\Portable\CodeAnalysis.csproj">
<Project>{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}</Project>
<Name>CodeAnalysis</Name>
......
......@@ -18,6 +18,10 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Core\Portable\CodeAnalysis.csproj">
<Project>{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}</Project>
<Name>CodeAnalysis</Name>
......@@ -47,8 +51,10 @@
<Name>PdbUtilities</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "></PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' ">
<PlatformTarget>ARM</PlatformTarget>
</PropertyGroup>
......@@ -156,4 +162,4 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\..\..\..\..\build\Targets\Imports.targets" />
</Project>
</Project>
\ No newline at end of file
......@@ -18,6 +18,10 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Core\Portable\CodeAnalysis.csproj">
<Project>{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}</Project>
<Name>CodeAnalysis</Name>
......@@ -195,4 +199,4 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\..\..\..\..\build\Targets\Imports.targets" />
</Project>
</Project>
\ No newline at end of file
......@@ -3,6 +3,7 @@
using System;
using System.Reflection;
using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.CSharp.UnitTests.Symbols
......@@ -17,7 +18,7 @@ public void NoParameterNames()
// {
// void M(object, object);
// }
var reference = CreateReflectionEmitAssembly(moduleBuilder =>
var reference = DesktopRuntimeUtil.CreateReflectionEmitAssembly(moduleBuilder =>
{
var typeBuilder = moduleBuilder.DefineType(
"I",
......
......@@ -26,6 +26,10 @@
<Project>{76c6f005-c89d-4348-bb4a-391898dbeb52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Core\Portable\CodeAnalysis.csproj">
<Project>{1ee8cad3-55f9-4d91-96b2-084641da9a6c}</Project>
<Name>CodeAnalysis</Name>
......@@ -64,5 +68,8 @@
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\..\..\..\..\build\Targets\Imports.targets" />
</Project>
</Project>
\ No newline at end of file
......@@ -57,6 +57,10 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\CSharp\Portable\CSharpCodeAnalysis.csproj">
<Project>{B501A547-C911-4A05-AC6E-274A50DFF30E}</Project>
<Name>CSharpCodeAnalysis</Name>
......@@ -179,4 +183,4 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\..\..\..\build\Targets\Imports.targets" />
</Project>
</Project>
\ No newline at end of file
......@@ -22,6 +22,10 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\CSharp\csc\csc.csproj">
<Project>{4b45ca0c-03a0-400f-b454-3d4bcb16af38}</Project>
<Name>csc</Name>
......
......@@ -766,6 +766,7 @@
<InternalsVisibleToTest Include="Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests" />
<InternalsVisibleToTest Include="Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests" />
<InternalsVisibleToTest Include="Microsoft.CodeAnalysis.VisualBasic.Scripting.Desktop.UnitTests" />
<InternalsVisibleToTest Include="Roslyn.Test.Utilities.CoreClr" />
<InternalsVisibleToTest Include="Roslyn.Test.Utilities.Desktop" />
<InternalsVisibleToTest Include="Roslyn.Test.Utilities.FX45" />
<InternalsVisibleToTest Include="Roslyn.Test.Utilities" />
......
......@@ -14,6 +14,10 @@
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\Core\MSBuildTask\MSBuildTask.csproj">
<Project>{7ad4fe65-9a30-41a6-8004-aa8f89bcb7f3}</Project>
<Name>MSBuildTask</Name>
......@@ -90,4 +94,4 @@
<None Include="project.json" />
</ItemGroup>
<Import Project="..\..\..\..\build\Targets\Imports.targets" />
</Project>
</Project>
\ No newline at end of file
......@@ -18,6 +18,10 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Core\Portable\CodeAnalysis.csproj">
<Project>{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}</Project>
<Name>CodeAnalysis</Name>
......@@ -39,8 +43,10 @@
<Name>PdbUtilities</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"></PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"></PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<PlatformTarget>ARM</PlatformTarget>
</PropertyGroup>
......
......@@ -64,7 +64,7 @@ private Action<IModuleSymbol> Translate(Action<ModuleSymbol> action)
}
}
internal ICompilationVerifier CompileAndVerify(
internal CompilationVerifier CompileAndVerify(
string source,
IEnumerable<MetadataReference> additionalRefs = null,
IEnumerable<ModuleData> dependencies = null,
......@@ -91,34 +91,7 @@ private Action<IModuleSymbol> Translate(Action<ModuleSymbol> action)
verify: verify);
}
internal ICompilationVerifier CompileAndVerify(
string[] sources,
MetadataReference[] additionalRefs = null,
IEnumerable<ModuleData> dependencies = null,
Action<ModuleSymbol> sourceSymbolValidator = null,
Action<PEAssembly> validator = null,
Action<ModuleSymbol> symbolValidator = null,
SignatureDescription[] expectedSignatures = null,
string expectedOutput = null,
CompilationOptions options = null,
ParseOptions parseOptions = null,
bool verify = true)
{
return base.CompileAndVerify(
sources,
additionalRefs,
dependencies,
Translate2(sourceSymbolValidator),
validator,
Translate2(symbolValidator),
expectedSignatures,
expectedOutput,
options,
parseOptions,
verify);
}
internal ICompilationVerifier CompileAndVerifyExperimental(
internal CompilationVerifier CompileAndVerifyExperimental(
string source,
MessageID feature,
string expectedOutput = null,
......@@ -147,7 +120,7 @@ private Action<IModuleSymbol> Translate(Action<ModuleSymbol> action)
verify: verify);
}
internal ICompilationVerifier CompileAndVerifyWinRt(
internal CompilationVerifier CompileAndVerifyWinRt(
string source,
string expectedOutput = null,
MetadataReference[] additionalRefs = null,
......@@ -168,29 +141,6 @@ private Action<IModuleSymbol> Translate(Action<ModuleSymbol> action)
expectedOutput: expectedOutput,
verify: verify);
}
internal ICompilationVerifier CompileAndVerify(
Compilation compilation,
IEnumerable<ResourceDescription> manifestResources = null,
IEnumerable<ModuleData> dependencies = null,
Action<ModuleSymbol> sourceSymbolValidator = null,
Action<PEAssembly> validator = null,
Action<ModuleSymbol> symbolValidator = null,
SignatureDescription[] expectedSignatures = null,
string expectedOutput = null,
bool verify = true)
{
return base.CompileAndVerify(
compilation,
manifestResources,
dependencies,
Translate2(sourceSymbolValidator),
validator,
Translate2(symbolValidator),
expectedSignatures,
expectedOutput,
verify);
}
}
public abstract class CSharpTestBaseBase : CommonTestBase
......@@ -655,13 +605,13 @@ private static void WalkOperationTree(CSharpCompilation compilation)
/// <typeparam name="T">Expected type of the exception.</typeparam>
/// <param name="source">Program to compile and execute.</param>
/// <param name="expectedMessage">Ignored if null.</param>
internal ICompilationVerifier CompileAndVerifyException<T>(string source, string expectedMessage = null, bool allowUnsafe = false) where T : Exception
internal CompilationVerifier CompileAndVerifyException<T>(string source, string expectedMessage = null, bool allowUnsafe = false) where T : Exception
{
var comp = CreateCompilationWithMscorlib(source, options: TestOptions.ReleaseExe.WithAllowUnsafe(allowUnsafe));
return CompileAndVerifyException<T>(comp, expectedMessage);
}
internal ICompilationVerifier CompileAndVerifyException<T>(CSharpCompilation comp, string expectedMessage = null) where T : Exception
internal CompilationVerifier CompileAndVerifyException<T>(CSharpCompilation comp, string expectedMessage = null) where T : Exception
{
try
{
......
......@@ -21,6 +21,10 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Core\Portable\CodeAnalysis.csproj">
<Project>{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}</Project>
<Name>CodeAnalysis</Name>
......
......@@ -23,6 +23,10 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\CSharp\Portable\CSharpCodeAnalysis.csproj">
<Project>{b501a547-c911-4a05-ac6e-274a50dff30e}</Project>
<Name>CSharpCodeAnalysis</Name>
......@@ -134,4 +138,4 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\..\..\..\..\build\Targets\Imports.targets" />
</Project>
</Project>
\ No newline at end of file
......@@ -20,6 +20,10 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Core\Portable\CodeAnalysis.csproj">
<Project>{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}</Project>
<Name>CodeAnalysis</Name>
......@@ -261,4 +265,4 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\..\..\..\..\build\Targets\Imports.targets" />
</Project>
</Project>
\ No newline at end of file
......@@ -20,6 +20,10 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Core\Portable\CodeAnalysis.csproj">
<Project>{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}</Project>
<Name>CodeAnalysis</Name>
......@@ -227,4 +231,4 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\..\..\..\..\build\Targets\Imports.targets" />
</Project>
</Project>
\ No newline at end of file
......@@ -20,6 +20,10 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Core\Portable\CodeAnalysis.csproj">
<Project>{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}</Project>
<Name>CodeAnalysis</Name>
......@@ -176,4 +180,4 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\..\..\..\..\build\Targets\Imports.targets" />
</Project>
</Project>
\ No newline at end of file
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Reflection
Imports Roslyn.Test.Utilities
Imports Xunit
Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests
......@@ -14,7 +15,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests
' Interface I
' Sub M(... As Object, ... As Object)
' End Interface
Dim reference = CreateReflectionEmitAssembly(
Dim reference = DesktopRuntimeUtil.CreateReflectionEmitAssembly(
Sub(moduleBuilder)
Dim typeBuilder = moduleBuilder.DefineType(
"I",
......
......@@ -19,6 +19,10 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj">
<Project>{ccbd3438-3e84-40a9-83ad-533f23bcfca5}</Project>
<Name>TestUtilities</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Core\Portable\CodeAnalysis.csproj">
<Project>{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}</Project>
<Name>CodeAnalysis</Name>
......@@ -160,4 +164,4 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\..\..\..\..\build\Targets\Imports.targets" />
</Project>
</Project>
\ No newline at end of file
......@@ -12,7 +12,6 @@
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<DefineConstants>$(DefineConstants);DNX</DefineConstants>
<NoStdLib>true</NoStdLib>
</PropertyGroup>
<ItemGroup Label="Project References">
......@@ -41,34 +40,10 @@
<Name>TestUtilities</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' ">
<PlatformTarget>ARM</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' ">
<PlatformTarget>ARM</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Any CPU' ">
<PlatformTarget>
</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Any CPU' ">
<PlatformTarget>
</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>
</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>
</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<None Include="project.json" />
</ItemGroup>
<ItemGroup>
<Compile Include="CoreCLRRuntimeEnvironment.cs" />
<Compile Include="Exceptions.cs" />
</ItemGroup>
<Import Project="..\..\..\..\build\Targets\Imports.targets" />
</Project>
\ No newline at end of file
</Project>
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.CompilerServices;
using System.Xml.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeGen;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.DiaSymReader;
using Roslyn.Test.PdbUtilities;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Test.Utilities
{
public class CompilationVerifier
{
private readonly CommonTestBase _test;
private readonly Compilation _compilation;
private CompilationTestData _testData;
private readonly IEnumerable<ModuleData> _dependencies;
private ImmutableArray<Diagnostic> _diagnostics;
private IModuleSymbol _lazyModuleSymbol;
private IList<ModuleData> _allModuleData;
internal ImmutableArray<byte> EmittedAssemblyData;
internal ImmutableArray<byte> EmittedAssemblyPdb;
public CompilationVerifier(
CommonTestBase test,
Compilation compilation,
IEnumerable<ModuleData> dependencies = null)
{
_test = test;
_compilation = compilation;
_dependencies = dependencies;
}
internal CompilationTestData TestData
{
get { return _testData; }
}
public Compilation Compilation
{
get { return _compilation; }
}
public TempRoot Temp
{
get { return _test.Temp; }
}
internal ImmutableArray<Diagnostic> Diagnostics
{
get { return _diagnostics; }
}
internal ImmutableArray<ModuleMetadata> GetAllModuleMetadata()
{
if (EmittedAssemblyData == null)
{
throw new InvalidOperationException("You must call Emit before calling GetAllModuleMetadata.");
}
ImmutableArray<ModuleMetadata> modules = ImmutableArray.Create(ModuleMetadata.CreateFromImage(EmittedAssemblyData));
if (_allModuleData != null)
{
var netModules = _allModuleData.Where(m => m.Kind == OutputKind.NetModule);
if (netModules.Any())
{
modules = modules.Concat(
ImmutableArray.CreateRange(netModules.Select(m => ModuleMetadata.CreateFromImage(m.Image))));
}
}
return modules;
}
public void Emit(string expectedOutput, IEnumerable<ResourceDescription> manifestResources, EmitOptions emitOptions, bool peVerify, SignatureDescription[] expectedSignatures)
{
using (var testEnvironment = RuntimeEnvironmentFactory.Create(_dependencies))
{
string mainModuleName = Emit(testEnvironment, manifestResources, emitOptions);
_allModuleData = testEnvironment.GetAllModuleData();
if (peVerify)
{
testEnvironment.PeVerify();
}
if (expectedSignatures != null)
{
MetadataSignatureUnitTestHelper.VerifyMemberSignatures(testEnvironment, expectedSignatures);
}
if (expectedOutput != null)
{
testEnvironment.Execute(mainModuleName, expectedOutput);
}
}
}
// TODO(tomat): Fold into CompileAndVerify.
// Replace bool verify parameter with string[] expectedPeVerifyOutput. If null, no verification. If empty verify have to succeed. Otherwise compare errors.
public void EmitAndVerify(params string[] expectedPeVerifyOutput)
{
using (var testEnvironment = RuntimeEnvironmentFactory.Create(_dependencies))
{
string mainModuleName = Emit(testEnvironment, null, null);
string[] actualOutput = testEnvironment.PeVerifyModules(new[] { mainModuleName }, throwOnError: false);
Assert.Equal(expectedPeVerifyOutput, actualOutput);
}
}
private string Emit(IRuntimeEnvironment testEnvironment, IEnumerable<ResourceDescription> manifestResources, EmitOptions emitOptions)
{
testEnvironment.Emit(_compilation, manifestResources, emitOptions);
_diagnostics = testEnvironment.GetDiagnostics();
EmittedAssemblyData = testEnvironment.GetMainImage();
EmittedAssemblyPdb = testEnvironment.GetMainPdb();
_testData = ((IInternalRuntimeEnvironment)testEnvironment).GetCompilationTestData();
return _compilation.Assembly.Identity.GetDisplayName();
}
public CompilationVerifier VerifyIL(
string qualifiedMethodName,
XCData expectedIL,
bool realIL = false,
string sequencePoints = null,
[CallerFilePath]string callerPath = null,
[CallerLineNumber]int callerLine = 0)
{
return VerifyILImpl(qualifiedMethodName, expectedIL.Value, realIL, sequencePoints, callerPath, callerLine, escapeQuotes: false);
}
public CompilationVerifier VerifyIL(
string qualifiedMethodName,
string expectedIL,
bool realIL = false,
string sequencePoints = null,
[CallerFilePath]string callerPath = null,
[CallerLineNumber]int callerLine = 0)
{
return VerifyILImpl(qualifiedMethodName, expectedIL, realIL, sequencePoints, callerPath, callerLine, escapeQuotes: true);
}
public void VerifyLocalSignature(
string qualifiedMethodName,
string expectedSignature,
[CallerLineNumber]int callerLine = 0,
[CallerFilePath]string callerPath = null)
{
var ilBuilder = _testData.GetMethodData(qualifiedMethodName).ILBuilder;
string actualSignature = ILBuilderVisualizer.LocalSignatureToString(ilBuilder);
AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedSignature, actualSignature, escapeQuotes: true, expectedValueSourcePath: callerPath, expectedValueSourceLine: callerLine);
}
private CompilationVerifier VerifyILImpl(
string qualifiedMethodName,
string expectedIL,
bool realIL,
string sequencePoints,
string callerPath,
int callerLine,
bool escapeQuotes)
{
string actualIL = VisualizeIL(qualifiedMethodName, realIL, sequencePoints);
AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedIL, actualIL, escapeQuotes, callerPath, callerLine);
return this;
}
public CompilationVerifier VerifyPdb(
XElement expectedPdb,
IMethodSymbol debugEntryPoint = null,
DebugInformationFormat format = 0,
PdbToXmlOptions options = 0,
[CallerLineNumber]int expectedValueSourceLine = 0,
[CallerFilePath]string expectedValueSourcePath = null)
{
_compilation.VerifyPdb(expectedPdb, debugEntryPoint, format, options, expectedValueSourceLine, expectedValueSourcePath);
return this;
}
public CompilationVerifier VerifyPdb(
string expectedPdb,
IMethodSymbol debugEntryPoint = null,
DebugInformationFormat format = 0,
PdbToXmlOptions options = 0,
[CallerLineNumber]int expectedValueSourceLine = 0,
[CallerFilePath]string expectedValueSourcePath = null)
{
_compilation.VerifyPdb(expectedPdb, debugEntryPoint, format, options, expectedValueSourceLine, expectedValueSourcePath);
return this;
}
public CompilationVerifier VerifyPdb(
string qualifiedMethodName,
string expectedPdb,
IMethodSymbol debugEntryPoint = null,
DebugInformationFormat format = 0,
PdbToXmlOptions options = 0,
[CallerLineNumber]int expectedValueSourceLine = 0,
[CallerFilePath]string expectedValueSourcePath = null)
{
_compilation.VerifyPdb(qualifiedMethodName, expectedPdb, debugEntryPoint, format, options, expectedValueSourceLine, expectedValueSourcePath);
return this;
}
public CompilationVerifier VerifyPdb(
string qualifiedMethodName,
XElement expectedPdb,
IMethodSymbol debugEntryPoint = null,
DebugInformationFormat format = 0,
PdbToXmlOptions options = 0,
[CallerLineNumber]int expectedValueSourceLine = 0,
[CallerFilePath]string expectedValueSourcePath = null)
{
_compilation.VerifyPdb(qualifiedMethodName, expectedPdb, debugEntryPoint, format, options, expectedValueSourceLine, expectedValueSourcePath);
return this;
}
public ISymUnmanagedReader3 CreateSymReader()
{
var pdbStream = new MemoryStream(EmittedAssemblyPdb.ToArray());
return SymReaderFactory.CreateReader(pdbStream, metadataReaderOpt: null, metadataMemoryOwnerOpt: null);
}
public string VisualizeIL(string qualifiedMethodName, bool realIL = false, string sequencePoints = null)
{
// TODO: Currently the qualifiedMethodName is a symbol display name while PDB need metadata name.
// So we need to pass the PDB metadata name of the method to sequencePoints (instead of just bool).
return VisualizeIL(_testData.GetMethodData(qualifiedMethodName), realIL, sequencePoints);
}
internal string VisualizeIL(CompilationTestData.MethodData methodData, bool realIL, string sequencePoints = null)
{
Dictionary<int, string> markers = null;
if (sequencePoints != null)
{
var actualPdbXml = PdbToXmlConverter.ToXml(
pdbStream: new MemoryStream(EmittedAssemblyPdb.ToArray()),
peStream: new MemoryStream(EmittedAssemblyData.ToArray()),
options: PdbToXmlOptions.ResolveTokens |
PdbToXmlOptions.ThrowOnError |
PdbToXmlOptions.ExcludeDocuments |
PdbToXmlOptions.ExcludeCustomDebugInformation |
PdbToXmlOptions.ExcludeScopes,
methodName: sequencePoints);
markers = PdbValidation.GetMarkers(actualPdbXml);
}
if (!realIL)
{
return ILBuilderVisualizer.ILBuilderToString(methodData.ILBuilder, markers: markers);
}
if (_lazyModuleSymbol == null)
{
_lazyModuleSymbol = GetModuleSymbolForEmittedImage(EmittedAssemblyData, MetadataImportOptions.All);
}
return _lazyModuleSymbol != null ? _test.VisualizeRealIL(_lazyModuleSymbol, methodData, markers) : null;
}
public CompilationVerifier VerifyMemberInIL(string methodName, bool expected)
{
Assert.Equal(expected, _testData.GetMethodsByName().ContainsKey(methodName));
return this;
}
public CompilationVerifier VerifyDiagnostics(params DiagnosticDescription[] expected)
{
_diagnostics.Verify(expected);
return this;
}
public IModuleSymbol GetModuleSymbolForEmittedImage()
{
return GetModuleSymbolForEmittedImage(EmittedAssemblyData, _compilation.Options.MetadataImportOptions);
}
private IModuleSymbol GetModuleSymbolForEmittedImage(ImmutableArray<byte> peImage, MetadataImportOptions importOptions)
{
if (peImage.IsDefault)
{
return null;
}
var targetReference = LoadTestEmittedExecutableForSymbolValidation(peImage, _compilation.Options.OutputKind, display: _compilation.AssemblyName);
var references = _compilation.References.Concat(new[] { targetReference });
var assemblies = _test.ReferencesToModuleSymbols(references, importOptions);
return assemblies.Last();
}
private static MetadataReference LoadTestEmittedExecutableForSymbolValidation(
ImmutableArray<byte> image,
OutputKind outputKind,
string display = null)
{
var moduleMetadata = ModuleMetadata.CreateFromImage(image);
moduleMetadata.Module.PretendThereArentNoPiaLocalTypes();
if (outputKind == OutputKind.NetModule)
{
return moduleMetadata.GetReference(display: display);
}
else
{
return AssemblyMetadata.Create(moduleMetadata).GetReference(display: display);
}
}
public void VerifyOperationTree(string expectedOperationTree, bool skipImplicitlyDeclaredSymbols = false)
{
_compilation.VerifyOperationTree(expectedOperationTree, skipImplicitlyDeclaredSymbols);
}
public void VerifyOperationTree(string symbolToVerify, string expectedOperationTree, bool skipImplicitlyDeclaredSymbols = false)
{
_compilation.VerifyOperationTree(symbolToVerify, expectedOperationTree, skipImplicitlyDeclaredSymbols);
}
}
}
此差异已折叠。
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Xunit;
using Xunit.Sdk;
namespace Microsoft.CodeAnalysis.Test.Utilities
{
[TraitDiscoverer("Microsoft.CodeAnalysis.Test.Utilities.CompilerTraitDiscoverer", assemblyName: "Roslyn.Test.Utilities.Desktop")]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
public sealed class CompilerTraitAttribute : Attribute, ITraitAttribute
{
public CompilerFeature[] Features { get; }
public CompilerTraitAttribute(params CompilerFeature[] features)
{
Features = features;
}
}
}
......@@ -10,27 +10,6 @@
namespace Roslyn.Test.Utilities
{
public class WindowsOnly : ExecutionCondition
{
public override bool ShouldSkip { get { return Path.DirectorySeparatorChar != '\\'; } }
public override string SkipReason { get { return "Test not supported on Mono"; } }
}
public class UnixLikeOnly : ExecutionCondition
{
public override bool ShouldSkip { get { return !PathUtilities.IsUnixLikePlatform; } }
public override string SkipReason { get { return "Test not supported on Windows"; } }
}
public class NotMonoOnly : ExecutionCondition
{
public override bool ShouldSkip { get { return MonoHelpers.IsRunningOnMono(); } }
public override string SkipReason { get { return "Test not supported on Mono"; } }
}
public class Framework35Installed : ExecutionCondition
{
public override bool ShouldSkip
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Test.Utilities;
namespace Roslyn.Test.Utilities
{
public sealed class DesktopRuntimeEnvironmentFactory : IRuntimeEnvironmentFactory
{
public IRuntimeEnvironment Create(IEnumerable<ModuleData> additionalDependencies)
{
return new HostedRuntimeEnvironment(additionalDependencies);
}
}
}
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Test.Utilities;
namespace Roslyn.Test.Utilities
{
public static class DesktopRuntimeUtil
{
/// <summary>
/// Creates a reference to a single-module assembly or a standalone module stored in memory
/// from a hex-encoded byte stream representing a gzipped assembly image.
/// </summary>
/// <param name="image">
/// A string containing a hex-encoded byte stream representing a gzipped assembly image.
/// Hex digits are case-insensitive and can be separated by spaces or newlines.
/// Cannot be null.
/// </param>
/// <param name="properties">Reference properties (extern aliases, type embedding, <see cref="MetadataImageKind"/>).</param>
/// <param name="documentation">Provides XML documentation for symbol found in the reference.</param>
/// <param name="filePath">Optional path that describes the location of the metadata. The file doesn't need to exist on disk. The path is opaque to the compiler.</param>
internal static PortableExecutableReference CreateMetadataReferenceFromHexGZipImage(
string image,
MetadataReferenceProperties properties = default(MetadataReferenceProperties),
DocumentationProvider documentation = null,
string filePath = null)
{
if (image == null)
{
throw new ArgumentNullException(nameof(image));
}
using (var compressed = new MemoryStream(SoapHexBinary.Parse(image).Value))
using (var gzipStream = new GZipStream(compressed, CompressionMode.Decompress))
using (var uncompressed = new MemoryStream())
{
gzipStream.CopyTo(uncompressed);
uncompressed.Position = 0;
return MetadataReference.CreateFromStream(uncompressed, properties, documentation, filePath);
}
}
internal static MetadataReference CreateReflectionEmitAssembly(Action<ModuleBuilder> create)
{
using (var file = new DisposableFile(extension: ".dll"))
{
var name = Path.GetFileName(file.Path);
var appDomain = AppDomain.CurrentDomain;
var assembly = appDomain.DefineDynamicAssembly(new AssemblyName(name), AssemblyBuilderAccess.Save, Path.GetDirectoryName(file.Path));
var module = assembly.DefineDynamicModule(CommonTestBase.GetUniqueName(), name);
create(module);
assembly.Save(name);
var image = CommonTestBase.ReadFromFile(file.Path);
return MetadataReference.CreateFromImage(image);
}
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Test.Utilities
{
public static class IlasmUtilities
{
public static DisposableFile CreateTempAssembly(string declarations, bool appendDefaultHeader = true)
{
string assemblyPath;
string pdbPath;
IlasmTempAssembly(declarations, appendDefaultHeader, includePdb: false, assemblyPath: out assemblyPath, pdbPath: out pdbPath);
Assert.NotNull(assemblyPath);
Assert.Null(pdbPath);
return new DisposableFile(assemblyPath);
}
public static void IlasmTempAssembly(string declarations, bool appendDefaultHeader, bool includePdb, out string assemblyPath, out string pdbPath)
{
if (declarations == null) throw new ArgumentNullException(nameof(declarations));
using (var sourceFile = new DisposableFile(extension: ".il"))
{
string sourceFileName = Path.GetFileNameWithoutExtension(sourceFile.Path);
assemblyPath = Path.Combine(
TempRoot.Root,
Path.ChangeExtension(Path.GetFileName(sourceFile.Path), "dll"));
string completeIL;
if (appendDefaultHeader)
{
completeIL = string.Format(
@".assembly '{0}' {{}}
.assembly extern mscorlib
{{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89)
.ver 4:0:0:0
}}
{1}",
sourceFileName,
declarations);
}
else
{
completeIL = declarations.Replace("<<GeneratedFileName>>", sourceFileName);
}
sourceFile.WriteAllText(completeIL);
var ilasmPath = Path.Combine(
Path.GetDirectoryName(typeof(object).Assembly.Location),
"ilasm.exe");
var arguments = string.Format(
"\"{0}\" /DLL /OUT=\"{1}\"",
sourceFile.Path,
assemblyPath);
if (includePdb && !MonoHelpers.IsRunningOnMono())
{
pdbPath = Path.ChangeExtension(assemblyPath, "pdb");
arguments += string.Format(" /PDB=\"{0}\"", pdbPath);
}
else
{
pdbPath = null;
}
var program = ilasmPath;
if (MonoHelpers.IsRunningOnMono())
{
arguments = string.Format("{0} {1}", ilasmPath, arguments);
arguments = arguments.Replace("\"", "");
arguments = arguments.Replace("=", ":");
program = "mono";
}
var result = ProcessUtilities.Run(program, arguments);
if (result.ContainsErrors)
{
throw new ArgumentException(
"The provided IL cannot be compiled." + Environment.NewLine +
program + " " + arguments + Environment.NewLine +
result,
nameof(declarations));
}
}
}
}
}
......@@ -153,7 +153,7 @@ public override object InitializeLifetimeService()
/// return values that are already present.
/// </summary>
/// <param name="modules"></param>
public void AddModuleData(IEnumerable<ModuleData> modules)
internal void AddModuleData(IEnumerable<ModuleData> modules)
{
foreach (var module in modules)
{
......
......@@ -87,28 +87,21 @@
</Compile>
<Compile Include="AppDomainUtils.cs" />
<Compile Include="CLRHelpers.cs" />
<Compile Include="DesktopRuntimeEnvironmentFactory.cs" />
<Compile Include="DesktopRuntimeUtil.cs" />
<Compile Include="InstrumentationChecker.cs" />
<Compile Include="CompilerTraitAttribute.cs" />
<Compile Include="ConditionalFactAttribute.cs" />
<Compile Include="ObjectReference.cs" />
<Compile Include="ProcessUtilities.cs" />
<Compile Include="AppDomainAssemblyCache.cs" />
<Compile Include="Exceptions.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="RuntimeAssemblyManager.cs" />
<Compile Include="SharedResourceHelpers.cs" />
<Compile Include="CommonDiagnosticAnalyzers.cs" />
<Compile Include="CommonTestBase.CompilationVerifier.cs" />
<Compile Include="CommonTestBase.cs" />
<Compile Include="CultureContext.cs" />
<Compile Include="ErrorDiagnostics.cs" />
<Compile Include="HostedRuntimeEnvironment.cs" />
<Compile Include="MetadataSignatureHelper.cs" />
<Compile Include="MetadataSignatureUnitTestHelper.cs" />
<Compile Include="..\Portable\ReflectionAssert.cs">
<Link>ReflectionAssert.cs</Link>
</Compile>
<Compile Include="IlasmUtilities.cs" />
<Compile Include="SigningTestHelpers.cs" />
<Compile Include="TestHelpers.cs" />
<Compile Include="TestResource.Designer.cs">
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.CompilerServices;
using System.Xml.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeGen;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.DiaSymReader;
using Roslyn.Test.PdbUtilities;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Test.Utilities
{
public partial class CommonTestBase
{
public class CompilationVerifier
{
private readonly CommonTestBase _test;
private readonly Compilation _compilation;
private CompilationTestData _testData;
private readonly IEnumerable<ModuleData> _dependencies;
private ImmutableArray<Diagnostic> _diagnostics;
private IModuleSymbol _lazyModuleSymbol;
private IList<ModuleData> _allModuleData;
internal ImmutableArray<byte> EmittedAssemblyData;
internal ImmutableArray<byte> EmittedAssemblyPdb;
public CompilationVerifier(
CommonTestBase test,
Compilation compilation,
IEnumerable<ModuleData> dependencies = null)
{
_test = test;
_compilation = compilation;
_dependencies = dependencies;
}
internal CompilationTestData TestData
{
get { return _testData; }
}
public Compilation Compilation
{
get { return _compilation; }
}
public TempRoot Temp
{
get { return _test.Temp; }
}
internal ImmutableArray<Diagnostic> Diagnostics
{
get { return _diagnostics; }
}
internal ImmutableArray<ModuleMetadata> GetAllModuleMetadata()
{
if (EmittedAssemblyData == null)
{
throw new InvalidOperationException("You must call Emit before calling GetAllModuleMetadata.");
}
ImmutableArray<ModuleMetadata> modules = ImmutableArray.Create(ModuleMetadata.CreateFromImage(EmittedAssemblyData));
if (_allModuleData != null)
{
var netModules = _allModuleData.Where(m => m.Kind == OutputKind.NetModule);
if (netModules.Any())
{
modules = modules.Concat(
ImmutableArray.CreateRange(netModules.Select(m => ModuleMetadata.CreateFromImage(m.Image))));
}
}
return modules;
}
public void Emit(string expectedOutput, IEnumerable<ResourceDescription> manifestResources, EmitOptions emitOptions, bool peVerify, SignatureDescription[] expectedSignatures)
{
using (var testEnvironment = RuntimeEnvironmentFactory.Create(_dependencies))
{
string mainModuleName = Emit(testEnvironment, manifestResources, emitOptions);
_allModuleData = testEnvironment.GetAllModuleData();
if (peVerify)
{
testEnvironment.PeVerify();
}
if (expectedSignatures != null)
{
MetadataSignatureUnitTestHelper.VerifyMemberSignatures(testEnvironment, expectedSignatures);
}
if (expectedOutput != null)
{
testEnvironment.Execute(mainModuleName, expectedOutput);
}
}
}
// TODO(tomat): Fold into CompileAndVerify.
// Replace bool verify parameter with string[] expectedPeVerifyOutput. If null, no verification. If empty verify have to succeed. Otherwise compare errors.
public void EmitAndVerify(params string[] expectedPeVerifyOutput)
{
using (var testEnvironment = RuntimeEnvironmentFactory.Create(_dependencies))
{
string mainModuleName = Emit(testEnvironment, null, null);
string[] actualOutput = testEnvironment.PeVerifyModules(new[] { mainModuleName }, throwOnError: false);
Assert.Equal(expectedPeVerifyOutput, actualOutput);
}
}
private string Emit(IRuntimeEnvironment testEnvironment, IEnumerable<ResourceDescription> manifestResources, EmitOptions emitOptions)
{
testEnvironment.Emit(_compilation, manifestResources, emitOptions);
_diagnostics = testEnvironment.GetDiagnostics();
EmittedAssemblyData = testEnvironment.GetMainImage();
EmittedAssemblyPdb = testEnvironment.GetMainPdb();
_testData = ((IInternalRuntimeEnvironment)testEnvironment).GetCompilationTestData();
return _compilation.Assembly.Identity.GetDisplayName();
}
public CompilationVerifier VerifyIL(
string qualifiedMethodName,
XCData expectedIL,
bool realIL = false,
string sequencePoints = null,
[CallerFilePath]string callerPath = null,
[CallerLineNumber]int callerLine = 0)
{
return VerifyILImpl(qualifiedMethodName, expectedIL.Value, realIL, sequencePoints, callerPath, callerLine, escapeQuotes: false);
}
public CompilationVerifier VerifyIL(
string qualifiedMethodName,
string expectedIL,
bool realIL = false,
string sequencePoints = null,
[CallerFilePath]string callerPath = null,
[CallerLineNumber]int callerLine = 0)
{
return VerifyILImpl(qualifiedMethodName, expectedIL, realIL, sequencePoints, callerPath, callerLine, escapeQuotes: true);
}
public void VerifyLocalSignature(
string qualifiedMethodName,
string expectedSignature,
[CallerLineNumber]int callerLine = 0,
[CallerFilePath]string callerPath = null)
{
var ilBuilder = _testData.GetMethodData(qualifiedMethodName).ILBuilder;
string actualSignature = ILBuilderVisualizer.LocalSignatureToString(ilBuilder);
AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedSignature, actualSignature, escapeQuotes: true, expectedValueSourcePath: callerPath, expectedValueSourceLine: callerLine);
}
private CompilationVerifier VerifyILImpl(
string qualifiedMethodName,
string expectedIL,
bool realIL,
string sequencePoints,
string callerPath,
int callerLine,
bool escapeQuotes)
{
string actualIL = VisualizeIL(qualifiedMethodName, realIL, sequencePoints);
AssertEx.AssertEqualToleratingWhitespaceDifferences(expectedIL, actualIL, escapeQuotes, callerPath, callerLine);
return this;
}
public CompilationVerifier VerifyPdb(
XElement expectedPdb,
IMethodSymbol debugEntryPoint = null,
DebugInformationFormat format = 0,
PdbToXmlOptions options = 0,
[CallerLineNumber]int expectedValueSourceLine = 0,
[CallerFilePath]string expectedValueSourcePath = null)
{
_compilation.VerifyPdb(expectedPdb, debugEntryPoint, format, options, expectedValueSourceLine, expectedValueSourcePath);
return this;
}
public CompilationVerifier VerifyPdb(
string expectedPdb,
IMethodSymbol debugEntryPoint = null,
DebugInformationFormat format = 0,
PdbToXmlOptions options = 0,
[CallerLineNumber]int expectedValueSourceLine = 0,
[CallerFilePath]string expectedValueSourcePath = null)
{
_compilation.VerifyPdb(expectedPdb, debugEntryPoint, format, options, expectedValueSourceLine, expectedValueSourcePath);
return this;
}
public CompilationVerifier VerifyPdb(
string qualifiedMethodName,
string expectedPdb,
IMethodSymbol debugEntryPoint = null,
DebugInformationFormat format = 0,
PdbToXmlOptions options = 0,
[CallerLineNumber]int expectedValueSourceLine = 0,
[CallerFilePath]string expectedValueSourcePath = null)
{
_compilation.VerifyPdb(qualifiedMethodName, expectedPdb, debugEntryPoint, format, options, expectedValueSourceLine, expectedValueSourcePath);
return this;
}
public CompilationVerifier VerifyPdb(
string qualifiedMethodName,
XElement expectedPdb,
IMethodSymbol debugEntryPoint = null,
DebugInformationFormat format = 0,
PdbToXmlOptions options = 0,
[CallerLineNumber]int expectedValueSourceLine = 0,
[CallerFilePath]string expectedValueSourcePath = null)
{
_compilation.VerifyPdb(qualifiedMethodName, expectedPdb, debugEntryPoint, format, options, expectedValueSourceLine, expectedValueSourcePath);
return this;
}
public ISymUnmanagedReader3 CreateSymReader()
{
var pdbStream = new MemoryStream(EmittedAssemblyPdb.ToArray());
return SymReaderFactory.CreateReader(pdbStream, metadataReaderOpt: null, metadataMemoryOwnerOpt: null);
}
public string VisualizeIL(string qualifiedMethodName, bool realIL = false, string sequencePoints = null)
{
// TODO: Currently the qualifiedMethodName is a symbol display name while PDB need metadata name.
// So we need to pass the PDB metadata name of the method to sequencePoints (instead of just bool).
return VisualizeIL(_testData.GetMethodData(qualifiedMethodName), realIL, sequencePoints);
}
internal string VisualizeIL(CompilationTestData.MethodData methodData, bool realIL, string sequencePoints = null)
{
Dictionary<int, string> markers = null;
if (sequencePoints != null)
{
var actualPdbXml = PdbToXmlConverter.ToXml(
pdbStream: new MemoryStream(EmittedAssemblyPdb.ToArray()),
peStream: new MemoryStream(EmittedAssemblyData.ToArray()),
options: PdbToXmlOptions.ResolveTokens |
PdbToXmlOptions.ThrowOnError |
PdbToXmlOptions.ExcludeDocuments |
PdbToXmlOptions.ExcludeCustomDebugInformation |
PdbToXmlOptions.ExcludeScopes,
methodName: sequencePoints);
markers = PdbValidation.GetMarkers(actualPdbXml);
}
if (!realIL)
{
return ILBuilderVisualizer.ILBuilderToString(methodData.ILBuilder, markers: markers);
}
if (_lazyModuleSymbol == null)
{
_lazyModuleSymbol = GetModuleSymbolForEmittedImage(EmittedAssemblyData, MetadataImportOptions.All);
}
return _lazyModuleSymbol != null ? _test.VisualizeRealIL(_lazyModuleSymbol, methodData, markers) : null;
}
public CompilationVerifier VerifyMemberInIL(string methodName, bool expected)
{
Assert.Equal(expected, _testData.GetMethodsByName().ContainsKey(methodName));
return this;
}
public CompilationVerifier VerifyDiagnostics(params DiagnosticDescription[] expected)
{
_diagnostics.Verify(expected);
return this;
}
public IModuleSymbol GetModuleSymbolForEmittedImage()
{
return GetModuleSymbolForEmittedImage(EmittedAssemblyData, _compilation.Options.MetadataImportOptions);
}
private IModuleSymbol GetModuleSymbolForEmittedImage(ImmutableArray<byte> peImage, MetadataImportOptions importOptions)
{
if (peImage.IsDefault)
{
return null;
}
var targetReference = LoadTestEmittedExecutableForSymbolValidation(peImage, _compilation.Options.OutputKind, display: _compilation.AssemblyName);
var references = _compilation.References.Concat(new[] { targetReference });
var assemblies = _test.ReferencesToModuleSymbols(references, importOptions);
return assemblies.Last();
}
private static MetadataReference LoadTestEmittedExecutableForSymbolValidation(
ImmutableArray<byte> image,
OutputKind outputKind,
string display = null)
{
var moduleMetadata = ModuleMetadata.CreateFromImage(image);
moduleMetadata.Module.PretendThereArentNoPiaLocalTypes();
if (outputKind == OutputKind.NetModule)
{
return moduleMetadata.GetReference(display: display);
}
else
{
return AssemblyMetadata.Create(moduleMetadata).GetReference(display: display);
}
}
public void VerifyOperationTree(string expectedOperationTree, bool skipImplicitlyDeclaredSymbols = false)
{
_compilation.VerifyOperationTree(expectedOperationTree, skipImplicitlyDeclaredSymbols);
}
public void VerifyOperationTree(string symbolToVerify, string expectedOperationTree, bool skipImplicitlyDeclaredSymbols = false)
{
_compilation.VerifyOperationTree(symbolToVerify, expectedOperationTree, skipImplicitlyDeclaredSymbols);
}
}
}
}
......@@ -12,6 +12,7 @@
using System.Reflection.PortableExecutable;
using System.Xml.Linq;
using Microsoft.CodeAnalysis.CodeGen;
using Microsoft.CodeAnalysis.Emit;
using Roslyn.Test.Utilities;
using Xunit;
......@@ -34,7 +35,7 @@ public abstract partial class CommonTestBase : TestBase
protected abstract CompilationOptions CompilationOptionsReleaseDll { get; }
internal ICompilationVerifier CompileAndVerify(
internal CompilationVerifier CompileAndVerify(
string source,
IEnumerable<MetadataReference> additionalRefs = null,
IEnumerable<ModuleData> dependencies = null,
......@@ -45,6 +46,7 @@ public abstract partial class CommonTestBase : TestBase
string expectedOutput = null,
CompilationOptions options = null,
ParseOptions parseOptions = null,
EmitOptions emitOptions = null,
bool verify = true)
{
return CompileAndVerify(
......@@ -58,11 +60,12 @@ public abstract partial class CommonTestBase : TestBase
expectedOutput: expectedOutput,
options: options,
parseOptions: parseOptions,
emitOptions: emitOptions,
verify: verify);
}
internal ICompilationVerifier CompileAndVerify(
string[] sources,
internal CompilationVerifier CompileAndVerify(
IEnumerable<string> sources,
IEnumerable<MetadataReference> additionalRefs = null,
IEnumerable<ModuleData> dependencies = null,
Action<IModuleSymbol> sourceSymbolValidator = null,
......@@ -72,6 +75,7 @@ public abstract partial class CommonTestBase : TestBase
string expectedOutput = null,
CompilationOptions options = null,
ParseOptions parseOptions = null,
EmitOptions emitOptions = null,
bool verify = true)
{
if (options == null)
......@@ -90,10 +94,11 @@ public abstract partial class CommonTestBase : TestBase
symbolValidator,
expectedSignatures,
expectedOutput,
emitOptions,
verify);
}
internal ICompilationVerifier CompileAndVerify(
internal CompilationVerifier CompileAndVerify(
Compilation compilation,
IEnumerable<ResourceDescription> manifestResources = null,
IEnumerable<ModuleData> dependencies = null,
......@@ -102,6 +107,7 @@ public abstract partial class CommonTestBase : TestBase
Action<IModuleSymbol> symbolValidator = null,
SignatureDescription[] expectedSignatures = null,
string expectedOutput = null,
EmitOptions emitOptions = null,
bool verify = true)
{
Assert.NotNull(compilation);
......@@ -123,7 +129,7 @@ public abstract partial class CommonTestBase : TestBase
sourceSymbolValidator(module);
}
ICompilationVerifier result = null;
CompilationVerifier result = null;
var verifier = Emit(compilation,
dependencies,
......@@ -132,6 +138,7 @@ public abstract partial class CommonTestBase : TestBase
expectedOutput,
assemblyValidator,
symbolValidator,
emitOptions,
verify);
if (result == null)
......@@ -151,7 +158,7 @@ public abstract partial class CommonTestBase : TestBase
return result;
}
internal ICompilationVerifier CompileAndVerifyFieldMarshal(string source, Dictionary<string, byte[]> expectedBlobs, bool isField = true)
internal CompilationVerifier CompileAndVerifyFieldMarshal(string source, Dictionary<string, byte[]> expectedBlobs, bool isField = true)
{
return CompileAndVerifyFieldMarshal(
source,
......@@ -163,12 +170,12 @@ internal ICompilationVerifier CompileAndVerifyFieldMarshal(string source, Dictio
isField);
}
internal ICompilationVerifier CompileAndVerifyFieldMarshal(string source, Func<string, PEAssembly, byte[]> getExpectedBlob, bool isField = true)
internal CompilationVerifier CompileAndVerifyFieldMarshal(string source, Func<string, PEAssembly, byte[]> getExpectedBlob, bool isField = true)
{
return CompileAndVerify(source, options: CompilationOptionsReleaseDll, assemblyValidator: (assembly) => MetadataValidation.MarshalAsMetadataValidator(assembly, getExpectedBlob, isField));
}
static internal void RunValidators(ICompilationVerifier verifier, Action<PEAssembly> assemblyValidator, Action<IModuleSymbol> symbolValidator)
static internal void RunValidators(CompilationVerifier verifier, Action<PEAssembly> assemblyValidator, Action<IModuleSymbol> symbolValidator)
{
if (assemblyValidator != null)
{
......@@ -186,7 +193,7 @@ static internal void RunValidators(ICompilationVerifier verifier, Action<PEAssem
}
}
internal ICompilationVerifier Emit(
internal CompilationVerifier Emit(
Compilation compilation,
IEnumerable<ModuleData> dependencies,
IEnumerable<ResourceDescription> manifestResources,
......@@ -194,9 +201,20 @@ static internal void RunValidators(ICompilationVerifier verifier, Action<PEAssem
string expectedOutput,
Action<PEAssembly> assemblyValidator,
Action<IModuleSymbol> symbolValidator,
EmitOptions emitOptions,
bool verify)
{
return null;
CompilationVerifier verifier = null;
verifier = new CompilationVerifier(this, compilation, dependencies);
verifier.Emit(expectedOutput, manifestResources, emitOptions, verify, expectedSignatures);
// We're dual-purposing emitters here. In this context, it
// tells the validator the version of Emit that is calling it.
RunValidators(verifier, assemblyValidator, symbolValidator);
return verifier;
}
/// <summary>
......@@ -216,9 +234,29 @@ public static ImmutableArray<byte> ReadFromFile(string path)
out ImmutableArray<byte> assemblyBytes,
out ImmutableArray<byte> pdbBytes)
{
// TODO: Port IL writer to portable
assemblyBytes = default(ImmutableArray<byte>);
pdbBytes = default(ImmutableArray<byte>);
string assemblyPath;
string pdbPath;
IlasmUtilities.IlasmTempAssembly(ilSource, appendDefaultHeader, includePdb, out assemblyPath, out pdbPath);
Assert.NotNull(assemblyPath);
Assert.Equal(pdbPath != null, includePdb);
using (new DisposableFile(assemblyPath))
{
assemblyBytes = ReadFromFile(assemblyPath);
}
if (pdbPath != null)
{
using (new DisposableFile(pdbPath))
{
pdbBytes = ReadFromFile(pdbPath);
}
}
else
{
pdbBytes = default(ImmutableArray<byte>);
}
}
internal static MetadataReference CompileIL(string ilSource, bool appendDefaultHeader = true, bool embedInteropTypes = false)
......@@ -408,27 +446,6 @@ private void AddReferencedCompilations(IEnumerable<Compilation> referencedCompil
}
}
/// <summary>
/// Creates a reference to a single-module assembly or a standalone module stored in memory
/// from a hex-encoded byte stream representing a gzipped assembly image.
/// </summary>
/// <param name="image">
/// A string containing a hex-encoded byte stream representing a gzipped assembly image.
/// Hex digits are case-insensitive and can be separated by spaces or newlines.
/// Cannot be null.
/// </param>
/// <param name="properties">Reference properties (extern aliases, type embedding, <see cref="MetadataImageKind"/>).</param>
/// <param name="documentation">Provides XML documentation for symbol found in the reference.</param>
/// <param name="filePath">Optional path that describes the location of the metadata. The file doesn't need to exist on disk. The path is opaque to the compiler.</param>
protected internal PortableExecutableReference CreateMetadataReferenceFromHexGZipImage(
string image,
MetadataReferenceProperties properties = default(MetadataReferenceProperties),
DocumentationProvider documentation = null,
string filePath = null)
{
return null;
}
#endregion
#region IL Verification
......
......@@ -4,6 +4,7 @@
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using Microsoft.CodeAnalysis;
......@@ -16,15 +17,39 @@ namespace Roslyn.Test.Utilities
{
public class RuntimeEnvironmentFactory
{
private static readonly Lazy<Func<IRuntimeEnvironment>> s_lazyFactory = new Lazy<Func<IRuntimeEnvironment>>(GetFactoryFunc);
private static readonly Lazy<IRuntimeEnvironmentFactory> s_lazyFactory = new Lazy<IRuntimeEnvironmentFactory>(GetFactoryImplementation);
internal static IRuntimeEnvironment Create(IEnumerable<ModuleData> additionalDependencies = null)
{
return s_lazyFactory.Value.Create(additionalDependencies);
}
private static Func<IRuntimeEnvironment> GetFactoryFunc()
private static IRuntimeEnvironmentFactory GetFactoryImplementation()
{
throw new Exception();
string assemblyName;
string typeName;
if (DesktopShim.FileNotFoundException.Type != null)
{
assemblyName = "Roslyn.Test.Utilities.Desktop";
typeName = "Roslyn.Test.Utilities.DesktopRuntimeEnvironmentFactory";
}
else
{
assemblyName = "Roslyn.Test.Utilities.CoreClr";
typeName = "Roslyn.Test.Utilities.CoreClrRuntimeEnvironmentFactory";
}
var thisAssemblyName = typeof(RuntimeEnvironmentFactory).GetTypeInfo().Assembly.GetName();
var name = new AssemblyName();
name.Name = assemblyName;
name.Version = thisAssemblyName.Version;
name.SetPublicKey(thisAssemblyName.GetPublicKey());
name.CultureName = thisAssemblyName.CultureName;
name.ProcessorArchitecture = thisAssemblyName.ProcessorArchitecture;
var assembly = Assembly.Load(name);
var type = assembly.GetType(typeName);
return (IRuntimeEnvironmentFactory)Activator.CreateInstance(type);
}
}
......@@ -242,7 +267,6 @@ EmitOptions emitOptions
}
}
public static string DumpAssemblyData(IEnumerable<ModuleData> modules, out string dumpDirectory)
{
dumpDirectory = null;
......@@ -317,9 +341,14 @@ public static string DumpAssemblyData(IEnumerable<ModuleData> modules, out strin
}
}
public interface IRuntimeEnvironmentFactory
{
IRuntimeEnvironment Create(IEnumerable<ModuleData> additionalDependencies);
}
public interface IRuntimeEnvironment : IDisposable
{
void Emit(Microsoft.CodeAnalysis.Compilation mainCompilation, IEnumerable<ResourceDescription> manifestResources, EmitOptions emitOptions, bool usePdbForDebugging = false);
void Emit(Compilation mainCompilation, IEnumerable<ResourceDescription> manifestResources, EmitOptions emitOptions, bool usePdbForDebugging = false);
int Execute(string moduleName, string expectedOutput);
ImmutableArray<byte> GetMainImage();
ImmutableArray<byte> GetMainPdb();
......
......@@ -46,7 +46,7 @@ public static class ProcessUtilities
{
foreach (var entry in additionalEnvironmentVars)
{
startInfo.EnvironmentVariables[entry.Key] = entry.Value;
startInfo.Environment[entry.Key] = entry.Value;
}
}
......@@ -73,7 +73,7 @@ public static class ProcessUtilities
if (stdInput != null)
{
process.StandardInput.Write(stdInput);
process.StandardInput.Close();
process.StandardInput.Dispose();
}
process.WaitForExit();
......@@ -122,7 +122,6 @@ public static string RunAndGetOutput(string exeFileName, string arguments = null
string result = null;
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = false;
......
......@@ -2,7 +2,9 @@
using System;
using System.IO;
using System.Reflection;
using Roslyn.Test.Utilities;
using Roslyn.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Test.Utilities
......@@ -21,8 +23,78 @@ public static DisposableFile CreateTempAssembly(string declarations, bool append
public static void IlasmTempAssembly(string declarations, bool appendDefaultHeader, bool includePdb, out string assemblyPath, out string pdbPath)
{
assemblyPath = null;
pdbPath = null;
if (declarations == null) throw new ArgumentNullException(nameof(declarations));
using (var sourceFile = new DisposableFile(extension: ".il"))
{
string sourceFileName = Path.GetFileNameWithoutExtension(sourceFile.Path);
assemblyPath = Path.Combine(
TempRoot.Root,
Path.ChangeExtension(Path.GetFileName(sourceFile.Path), "dll"));
string completeIL;
if (appendDefaultHeader)
{
completeIL = string.Format(
@".assembly '{0}' {{}}
.assembly extern mscorlib
{{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89)
.ver 4:0:0:0
}}
{1}",
sourceFileName,
declarations);
}
else
{
completeIL = declarations.Replace("<<GeneratedFileName>>", sourceFileName);
}
sourceFile.WriteAllText(completeIL);
var ilasmPath = Path.Combine(
CorLightup.Desktop.GetAssemblyLocation(typeof(object).GetTypeInfo().Assembly),
"ilasm.exe");
var arguments = string.Format(
"\"{0}\" /DLL /OUT=\"{1}\"",
sourceFile.Path,
assemblyPath);
if (includePdb && !MonoHelpers.IsRunningOnMono())
{
pdbPath = Path.ChangeExtension(assemblyPath, "pdb");
arguments += string.Format(" /PDB=\"{0}\"", pdbPath);
}
else
{
pdbPath = null;
}
var program = ilasmPath;
if (MonoHelpers.IsRunningOnMono())
{
arguments = string.Format("{0} {1}", ilasmPath, arguments);
arguments = arguments.Replace("\"", "");
arguments = arguments.Replace("=", ":");
program = "mono";
}
var result = ProcessUtilities.Run(program, arguments);
if (result.ContainsErrors)
{
throw new ArgumentException(
"The provided IL cannot be compiled." + Environment.NewLine +
program + " " + arguments + Environment.NewLine +
result,
nameof(declarations));
}
}
}
}
}
......@@ -60,6 +60,7 @@
</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleToTest Include="Roslyn.Test.Utilities.CoreClr" />
<InternalsVisibleToTest Include="Roslyn.Test.Utilities.Desktop" />
<InternalsVisibleToTest Include="Roslyn.Compilers.CSharp.CommandLine.UnitTests" />
<InternalsVisibleToTest Include="Roslyn.Compilers.CSharp.Emit.UnitTests" />
......@@ -70,6 +71,7 @@
<InternalsVisibleToTest Include="Roslyn.Compilers.CSharp.Symbol.UnitTests" />
<InternalsVisibleToTest Include="Roslyn.Compilers.CSharp.Syntax.UnitTests" />
<InternalsVisibleToTest Include="Roslyn.Compilers.CSharp.Test.Utilities" />
<InternalsVisibleToTest Include="Roslyn.Compilers.CSharp.Test.Utilities.Desktop" />
<InternalsVisibleToTest Include="Roslyn.Compilers.UnitTests" />
<InternalsVisibleToTest Include="Roslyn.Compilers.VisualBasic.CommandLine.UnitTests" />
<InternalsVisibleToTest Include="Roslyn.Compilers.VisualBasic.Emit.UnitTests" />
......@@ -115,6 +117,7 @@
<Compile Include="Assert\EqualityUtil`1.cs" />
<Compile Include="Assert\TestExceptionUtilities.cs" />
<Compile Include="Assert\WorkItemAttribute.cs" />
<Compile Include="CommonTestBase.CompilationVerifier.cs" />
<Compile Include="CommonTestBase.cs" />
<Compile Include="Compilation\CompilationDifference.cs" />
<Compile Include="Compilation\CompilationExtensions.cs" />
......@@ -157,11 +160,13 @@
<Compile Include="FX\PinnedBlob.cs" />
<Compile Include="FX\PinnedMetadata.cs" />
<Compile Include="FX\ProcessResult.cs" />
<Compile Include="FX\ProcessUtilities.cs" />
<Compile Include="FX\RegexExtensions.cs" />
<Compile Include="FX\StringExtensions.cs" />
<Compile Include="ICompilationVerifier.cs" />
<Compile Include="MarkedSource\MarkupTestFile.cs" />
<Compile Include="MarkedSource\SourceWithMarkedNodes.cs" />
<Compile Include="MetadataSignatureUnitTestHelper.cs" />
<Compile Include="Metadata\CustomAttributeRow.cs" />
<Compile Include="Metadata\DynamicAnalysisDataReader.cs" />
<Compile Include="Metadata\EncValidation.cs" />
......@@ -218,4 +223,4 @@
</ItemGroup>
<Import Project="..\..\..\..\build\Targets\Imports.targets" />
<ProjectExtensions />
</Project>
\ No newline at end of file
</Project>
......@@ -9,6 +9,7 @@
"System.Diagnostics.Debug": "4.3.0",
"System.Diagnostics.Tools": "4.3.0",
"System.Diagnostics.TraceSource": "4.3.0",
"System.Diagnostics.Process": "4.1.0",
"System.IO.FileSystem": "4.3.0",
"System.Reflection.TypeExtensions": "4.3.0",
"System.Text.RegularExpressions": "4.3.0",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册