Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
5b48bdd9
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5b48bdd9
编写于
2月 14, 2015
作者:
A
Andy Gocke
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #500 from agocke/ReduceCSharpEmitTestAllocations
Reduce C# emit test allocations
上级
274b5c85
86de1602
变更
19
显示空白变更内容
内联
并排
Showing
19 changed file
with
271 addition
and
270 deletion
+271
-270
BuildAndTest.proj
BuildAndTest.proj
+1
-0
src/Compilers/CSharp/Portable/CSharpCodeAnalysis.csproj
src/Compilers/CSharp/Portable/CSharpCodeAnalysis.csproj
+1
-0
src/Compilers/CSharp/Test/Emit/CSharpCompilerEmitTest.csproj
src/Compilers/CSharp/Test/Emit/CSharpCompilerEmitTest.csproj
+1
-2
src/Compilers/CSharp/Test/Symbol/CSharpCompilerSymbolTest.csproj
...pilers/CSharp/Test/Symbol/CSharpCompilerSymbolTest.csproj
+0
-3
src/Compilers/CSharp/Test/WinRT/CSharpWinRTTest.csproj
src/Compilers/CSharp/Test/WinRT/CSharpWinRTTest.csproj
+84
-0
src/Compilers/CSharp/Test/WinRT/CodeGen/WinMdEventTests.cs
src/Compilers/CSharp/Test/WinRT/CodeGen/WinMdEventTests.cs
+5
-5
src/Compilers/CSharp/Test/WinRT/CodeGen/WinRTCollectionTests.cs
...mpilers/CSharp/Test/WinRT/CodeGen/WinRTCollectionTests.cs
+45
-60
src/Compilers/CSharp/Test/WinRT/Metadata/WinMdDumpTest.cs
src/Compilers/CSharp/Test/WinRT/Metadata/WinMdDumpTest.cs
+0
-0
src/Compilers/CSharp/Test/WinRT/Metadata/WinMdEventTests.cs
src/Compilers/CSharp/Test/WinRT/Metadata/WinMdEventTests.cs
+8
-11
src/Compilers/CSharp/Test/WinRT/Metadata/WinMdMetadataTests.cs
...ompilers/CSharp/Test/WinRT/Metadata/WinMdMetadataTests.cs
+6
-7
src/Compilers/CSharp/Test/WinRT/packages.config
src/Compilers/CSharp/Test/WinRT/packages.config
+7
-0
src/Compilers/Core/Portable/CodeAnalysis.csproj
src/Compilers/Core/Portable/CodeAnalysis.csproj
+1
-0
src/Compilers/Test/Utilities/CSharp/CSharpCompilerTestUtilities.csproj
.../Test/Utilities/CSharp/CSharpCompilerTestUtilities.csproj
+1
-0
src/Compilers/Test/Utilities/CSharp/CSharpTestBase.cs
src/Compilers/Test/Utilities/CSharp/CSharpTestBase.cs
+42
-81
src/Roslyn.sln
src/Roslyn.sln
+14
-1
src/Roslyn2013.sln
src/Roslyn2013.sln
+24
-1
src/Test/Utilities/CommonTestBase.cs
src/Test/Utilities/CommonTestBase.cs
+0
-91
src/Test/Utilities/HostedRuntimeEnvironment.cs
src/Test/Utilities/HostedRuntimeEnvironment.cs
+30
-8
src/Test/Utilities/TestUtilities.csproj
src/Test/Utilities/TestUtilities.csproj
+1
-0
未找到文件。
BuildAndTest.proj
浏览文件 @
5b48bdd9
...
...
@@ -66,6 +66,7 @@
<TestAssemblies Include="Binaries\Debug\Roslyn.Compilers.CSharp.CommandLine.UnitTests.dll" />
<TestAssemblies Include="Binaries\Debug\Roslyn.Compilers.CSharp.Emit.UnitTests.dll" />
<TestAssemblies Include="Binaries\Debug\Roslyn.Compilers.CSharp.WinRT.UnitTests.dll" />
<TestAssemblies Include="Binaries\Debug\Roslyn.Compilers.CSharp.Semantic.UnitTests.dll" />
<TestAssemblies Include="Binaries\Debug\Roslyn.Compilers.CSharp.Syntax.UnitTests.dll" />
<TestAssemblies Include="Binaries\Debug\Roslyn.Compilers.CSharp.Symbol.UnitTests.dll" />
...
...
src/Compilers/CSharp/Portable/CSharpCodeAnalysis.csproj
浏览文件 @
5b48bdd9
...
...
@@ -867,6 +867,7 @@
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.CommandLine.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.Emit.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.WinRT.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.EnC.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.Semantic.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.Symbol.UnitTests"
/>
...
...
src/Compilers/CSharp/Test/Emit/CSharpCompilerEmitTest.csproj
浏览文件 @
5b48bdd9
...
...
@@ -144,8 +144,6 @@
<Compile
Include=
"CodeGen\SwitchTests.cs"
/>
<Compile
Include=
"CodeGen\UnsafeTests.cs"
/>
<Compile
Include=
"CodeGen\WinMdDelegateTests.cs"
/>
<Compile
Include=
"CodeGen\WinMdEventTests.cs"
/>
<Compile
Include=
"CodeGen\WinRTCollectionTests.cs"
/>
<Compile
Include=
"Emit\CompilationEmitTests.cs"
/>
<Compile
Include=
"Emit\DeterministicTests.cs"
/>
<Compile
Include=
"Emit\EditAndContinue\AssemblyReferencesTests.cs"
/>
...
...
@@ -198,6 +196,7 @@
<EmbeddedResource
Include=
"Resources.resx"
>
<Generator>
ResXFileCodeGenerator
</Generator>
<LastGenOutput>
Resources.Designer.cs
</LastGenOutput>
<SubType>
Designer
</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
...
...
src/Compilers/CSharp/Test/Symbol/CSharpCompilerSymbolTest.csproj
浏览文件 @
5b48bdd9
...
...
@@ -162,9 +162,6 @@
<Compile
Include=
"Symbols\Metadata\PE\TypeAccessibility.cs"
/>
<Compile
Include=
"Symbols\Metadata\PE\TypeForwarders.cs"
/>
<Compile
Include=
"Symbols\Metadata\PE\TypeKindTests.cs"
/>
<Compile
Include=
"Symbols\Metadata\WinMdDumpTest.cs"
/>
<Compile
Include=
"Symbols\Metadata\WinMdEventTests.cs"
/>
<Compile
Include=
"Symbols\Metadata\WinMdMetadataTests.cs"
/>
<Compile
Include=
"Symbols\MethodEqualityTests.cs"
/>
<Compile
Include=
"Symbols\MissingSpecialMember.cs"
/>
<Compile
Include=
"Symbols\MockAssemblySymbol.cs"
/>
...
...
src/Compilers/CSharp/Test/WinRT/CSharpWinRTTest.csproj
0 → 100644
浏览文件 @
5b48bdd9
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"4.0"
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<ImportGroup
Label=
"Settings"
>
<Import
Project=
"..\..\..\..\Tools\Microsoft.CodeAnalysis.Toolset.Open\Targets\VSL.Settings.targets"
/>
<Import
Project=
"..\..\..\..\..\build\VSL.Settings.Closed.targets"
/>
</ImportGroup>
<PropertyGroup>
<NonShipping>
true
</NonShipping>
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
<Platform
Condition=
" '$(Platform)' == '' "
>
AnyCPU
</Platform>
<ProjectGuid>
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}
</ProjectGuid>
<OutputType>
Library
</OutputType>
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen
</RootNamespace>
<AssemblyName>
Roslyn.Compilers.CSharp.WinRT.UnitTests
</AssemblyName>
<TargetFrameworkVersion>
v4.5
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<NuGetPackageImportStamp>
46858cd2
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
/>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU'"
/>
<ItemGroup>
<Compile
Include=
"CodeGen\WinMdEventTests.cs"
/>
<Compile
Include=
"CodeGen\WinRTCollectionTests.cs"
/>
<Compile
Include=
"Metadata\WinMdDumpTest.cs"
/>
<Compile
Include=
"Metadata\WinMdEventTests.cs"
/>
<Compile
Include=
"Metadata\WinMdMetadataTests.cs"
/>
</ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"..\..\..\..\Test\Utilities\TestUtilities.csproj"
>
<Project>
{76c6f005-c89d-4348-bb4a-391898dbeb52}
</Project>
<Name>
TestUtilities
</Name>
</ProjectReference>
<ProjectReference
Include=
"..\..\..\Core\Portable\CodeAnalysis.csproj"
>
<Project>
{1ee8cad3-55f9-4d91-96b2-084641da9a6c}
</Project>
<Name>
CodeAnalysis
</Name>
</ProjectReference>
<ProjectReference
Include=
"..\..\..\Test\Resources\Core\CompilerTestResources.vbproj"
>
<Project>
{7fe6b002-89d8-4298-9b1b-0b5c247dd1fd}
</Project>
<Name>
CompilerTestResources
</Name>
</ProjectReference>
<ProjectReference
Include=
"..\..\..\Test\Utilities\Core2\CompilerTestUtilities2.csproj"
>
<Project>
{f7712928-1175-47b3-8819-ee086753dee2}
</Project>
<Name>
CompilerTestUtilities2
</Name>
</ProjectReference>
<ProjectReference
Include=
"..\..\..\Test\Utilities\CSharp\CSharpCompilerTestUtilities.csproj"
>
<Project>
{4371944a-d3ba-4b5b-8285-82e5ffc6d1f9}
</Project>
<Name>
CSharpCompilerTestUtilities
</Name>
</ProjectReference>
<ProjectReference
Include=
"..\..\Portable\CSharpCodeAnalysis.csproj"
>
<Project>
{b501a547-c911-4a05-ac6e-274a50dff30e}
</Project>
<Name>
CSharpCodeAnalysis
</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference
Include=
"Microsoft.CodeAnalysis.Test.Resources.Proprietary"
>
<HintPath>
..\..\..\..\..\packages\Microsoft.CodeAnalysis.Test.Resources.Proprietary.1.0.0-rc1-20150208-02\lib\net45\Microsoft.CodeAnalysis.Test.Resources.Proprietary.dll
</HintPath>
</Reference>
<Reference
Include=
"System.Collections.Immutable, Version=1.1.33.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
>
<SpecificVersion>
False
</SpecificVersion>
<HintPath>
..\..\..\..\..\packages\System.Collections.Immutable.1.1.33-beta\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll
</HintPath>
</Reference>
<Reference
Include=
"System.Reflection.Metadata, Version=1.0.18.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
>
<SpecificVersion>
False
</SpecificVersion>
<HintPath>
..\..\..\..\..\packages\System.Reflection.Metadata.1.0.18-beta\lib\portable-net45+win8\System.Reflection.Metadata.dll
</HintPath>
</Reference>
<Reference
Include=
"System.Xml.Linq"
/>
<Reference
Include=
"xunit, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL"
>
<SpecificVersion>
False
</SpecificVersion>
<HintPath>
..\..\..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll
</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None
Include=
"packages.config"
/>
</ItemGroup>
<ItemGroup>
<Folder
Include=
"Properties\"
/>
</ItemGroup>
<ImportGroup
Label=
"Targets"
>
<Import
Project=
"..\..\..\..\Tools\Microsoft.CodeAnalysis.Toolset.Open\Targets\VSL.Imports.targets"
/>
<Import
Project=
"..\..\..\..\..\build\VSL.Imports.Closed.targets"
/>
<Import
Project=
"..\..\..\..\..\build\Roslyn.Toolsets.Xunit.targets"
/>
</ImportGroup>
</Project>
\ No newline at end of file
src/Compilers/CSharp/Test/
Emit
/CodeGen/WinMdEventTests.cs
→
src/Compilers/CSharp/Test/
WinRT
/CodeGen/WinMdEventTests.cs
浏览文件 @
5b48bdd9
...
...
@@ -173,7 +173,7 @@ class C
event System.Action E;
}
"
;
var
verifier
=
CompileAndVerify
(
source
,
options
:
TestOptions
.
ReleaseWinMD
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
additionalRefs
:
WinRtRefs
);
var
verifier
=
CompileAndVerify
WinRt
(
source
,
options
:
TestOptions
.
ReleaseWinMD
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
verifier
.
VerifyIL
(
"C.E.add"
,
@"
{
...
...
@@ -209,7 +209,7 @@ class C
static event System.Action<int> E;
}
"
;
var
verifier
=
CompileAndVerify
(
source
,
options
:
TestOptions
.
ReleaseWinMD
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
additionalRefs
:
WinRtRefs
);
var
verifier
=
CompileAndVerify
WinRt
(
source
,
options
:
TestOptions
.
ReleaseWinMD
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
verifier
.
VerifyIL
(
"C.E.add"
,
@"
{
...
...
@@ -273,7 +273,7 @@ static void Action()
}
}
"
;
var
verifier
=
CompileAndVerify
(
source
,
options
:
TestOptions
.
ReleaseWinMD
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
additionalRefs
:
WinRtRefs
);
var
verifier
=
CompileAndVerify
WinRt
(
source
,
options
:
TestOptions
.
ReleaseWinMD
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
verifier
.
VerifyIL
(
"D.InstanceAdd"
,
@"
{
...
...
@@ -366,7 +366,7 @@ static void Action()
}
}
"
;
var
verifier
=
CompileAndVerify
(
source
,
options
:
TestOptions
.
ReleaseWinMD
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
additionalRefs
:
WinRtRefs
);
var
verifier
=
CompileAndVerify
WinRt
(
source
,
options
:
TestOptions
.
ReleaseWinMD
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
verifier
.
VerifyIL
(
"C.InstanceAssign"
,
@"
{
...
...
@@ -455,7 +455,7 @@ static void Action()
}
}
"
;
var
verifier
=
CompileAndVerify
(
source
,
options
:
TestOptions
.
ReleaseWinMD
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
additionalRefs
:
WinRtRefs
);
var
verifier
=
CompileAndVerify
WinRt
(
source
,
options
:
TestOptions
.
ReleaseWinMD
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
verifier
.
VerifyIL
(
"C.InstanceInvoke"
,
@"
{
...
...
src/Compilers/CSharp/Test/
Emit
/CodeGen/WinRTCollectionTests.cs
→
src/Compilers/CSharp/Test/
WinRT
/CodeGen/WinRTCollectionTests.cs
浏览文件 @
5b48bdd9
...
...
@@ -13,23 +13,12 @@ namespace Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen
{
public
class
WinRTCollectionTests
:
CSharpTestBase
{
private
MetadataReference
[]
_legacyRefs
=
null
;
public
MetadataReference
[]
LegacyRefs
{
get
public
static
MetadataReference
[]
LegacyRefs
{
get
;
}
=
{
if
(
_legacyRefs
==
null
)
{
var
list
=
new
List
<
MetadataReference
>(
WinRtRefs
.
Length
+
2
);
list
.
AddRange
(
WinRtRefs
);
list
.
Add
(
AssemblyMetadata
.
CreateFromImage
(
TestResources
.
WinRt
.
Windows_Languages_WinRTTest
).
GetReference
(
display
:
"WinRTTest"
));
list
.
Add
(
AssemblyMetadata
.
CreateFromImage
(
ProprietaryTestResources
.
NetFX
.
v4_0_30319_17929
.
System_Core
).
GetReference
(
display
:
"SystemCore"
));
_legacyRefs
=
list
.
ToArray
();
}
return
_legacyRefs
;
}
}
AssemblyMetadata
.
CreateFromImage
(
TestResources
.
WinRt
.
Windows_Languages_WinRTTest
).
GetReference
(
display
:
"WinRTTest"
),
AssemblyMetadata
.
CreateFromImage
(
ProprietaryTestResources
.
NetFX
.
v4_0_30319_17929
.
System_Core
).
GetReference
(
display
:
"SystemCore"
)
};
[
Fact
,
WorkItem
(
762316
,
"DevDiv"
)]
public
void
InheritFromTypeWithProjections
()
...
...
@@ -96,7 +85,6 @@ public static void Main(string[] args)
var
verifier
=
CompileAndVerifyOnWin8Only
(
source
,
expectedOutput
:
expectedOutput
,
additionalRefs
:
WinRtRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
verifier
.
VerifyIL
(
"Class1.Main"
,
...
...
@@ -198,7 +186,6 @@ public static void Main(string[] args)
var
verifier
=
CompileAndVerifyOnWin8Only
(
source
,
expectedOutput
:
expectedOut
,
additionalRefs
:
WinRtRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
verifier
.
VerifyIL
(
"Class1.Main"
,
...
...
@@ -265,7 +252,6 @@ public static void Main(string[] args)
var
verifier
=
CompileAndVerifyOnWin8Only
(
source
,
expectedOutput
:
expectedOut
,
additionalRefs
:
WinRtRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
verifier
.
VerifyIL
(
"Class1.Main"
,
...
...
@@ -441,7 +427,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
verify
:
false
);
...
...
@@ -1472,7 +1458,7 @@ static int Main()
return FailedCount;
}
}"
;
var
comp
=
Create
CompilationWithMscorlibAndSystemCore
(
source
,
reference
s
:
LegacyRefs
);
var
comp
=
Create
WinRtCompilation
(
source
,
additionalRef
s
:
LegacyRefs
);
comp
.
VerifyDiagnostics
(
// (3,1): info CS8019: Unnecessary using directive.
// using System.Reflection;
...
...
@@ -1839,7 +1825,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
//FIXME: Can't verify because the metadata adapter isn't implemented yet
...
...
@@ -3201,7 +3187,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
additionalRefs
:
LegacyRefs
,
verify
:
false
);
...
...
@@ -4445,7 +4431,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
verify
:
false
);
...
...
@@ -4812,7 +4798,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
verify
:
false
);
...
...
@@ -4999,7 +4985,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
verify
:
false
);
...
...
@@ -5197,7 +5183,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
verify
:
false
);
...
...
@@ -5418,7 +5404,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
verify
:
false
);
...
...
@@ -5556,7 +5542,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
verify
:
false
);
...
...
@@ -5705,23 +5691,25 @@ IEnumerator IEnumerable.GetEnumerator()
}
}
}"
;
var
comp
=
Create
Compilation
(
source
,
reference
s
:
LegacyRefs
);
var
comp
=
Create
WinRtCompilation
(
source
,
additionalRef
s
:
LegacyRefs
);
comp
.
VerifyDiagnostics
(
// (30,36): error CS0539: 'Test.
R.this[int]' in explicit interface declaration is not a member of interface
// (30,36): error CS0539: '
R.this[int]' in explicit interface declaration is not a member of interface
// int IObservableVector<int>.this[int index]
Diagnostic
(
ErrorCode
.
ERR_InterfaceMemberNotFound
,
"this"
).
WithArguments
(
"Test.R.this[int]"
),
// (13,53): warning CS0067: The event 'Test.
R.VectorChanged' is never used
Diagnostic
(
ErrorCode
.
ERR_InterfaceMemberNotFound
,
"this"
).
WithArguments
(
"Test.R.this[int]"
).
WithLocation
(
30
,
36
),
// (13,53): warning CS0067: The event '
R.VectorChanged' is never used
// public event VectorChangedEventHandler<int> VectorChanged;
Diagnostic
(
ErrorCode
.
WRN_UnreferencedEvent
,
"VectorChanged"
).
WithArguments
(
"Test.R.VectorChanged"
),
// (2,1): info CS8019: Unnecessary using directive.
Diagnostic
(
ErrorCode
.
WRN_UnreferencedEvent
,
"VectorChanged"
).
WithArguments
(
"Test.R.VectorChanged"
).
WithLocation
(
13
,
53
),
// error CS5001: Program does not contain a static 'Main' method suitable for an entry point
Diagnostic
(
ErrorCode
.
ERR_NoEntryPoint
).
WithLocation
(
1
,
1
),
// (2,1): hidden CS8019: Unnecessary using directive.
// using System.Reflection;
Diagnostic
(
ErrorCode
.
HDN_UnusedUsingDirective
,
"using System.Reflection;"
),
// (3,1): info CS8019: Unnecessary using directive.
// using System.Runtime.InteropServices;
Diagnostic
(
ErrorCode
.
HDN_UnusedUsingDirective
,
"using System.Runtime.InteropServices;"
),
// (4,1): info CS8019: Unnecessary using directive.
Diagnostic
(
ErrorCode
.
HDN_UnusedUsingDirective
,
"using System.Reflection;"
).
WithLocation
(
2
,
1
),
// (4,1): hidden CS8019: Unnecessary using directive.
// using System.Threading;
Diagnostic
(
ErrorCode
.
HDN_UnusedUsingDirective
,
"using System.Threading;"
));
Diagnostic
(
ErrorCode
.
HDN_UnusedUsingDirective
,
"using System.Threading;"
).
WithLocation
(
4
,
1
),
// (3,1): hidden CS8019: Unnecessary using directive.
// using System.Runtime.InteropServices;
Diagnostic
(
ErrorCode
.
HDN_UnusedUsingDirective
,
"using System.Runtime.InteropServices;"
).
WithLocation
(
3
,
1
));
}
[
Fact
]
...
...
@@ -5825,7 +5813,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
verify
:
false
);
...
...
@@ -6053,7 +6041,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
verify
:
false
);
...
...
@@ -6253,7 +6241,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
verify
:
false
);
...
...
@@ -6613,7 +6601,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
verify
:
false
);
...
...
@@ -6774,7 +6762,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
var
verifier
=
CompileAndVerify
WinRt
(
source
,
additionalRefs
:
LegacyRefs
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
...
...
@@ -7047,7 +7035,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
var
verifier
=
CompileAndVerify
WinRt
(
source
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
additionalRefs
:
LegacyRefs
,
...
...
@@ -7175,7 +7163,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
var
verifier
=
CompileAndVerify
WinRt
(
source
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
additionalRefs
:
LegacyRefs
,
...
...
@@ -7297,7 +7285,7 @@ static int Main()
return FailedCount;
}
}"
;
var
verifier
=
CompileAndVerify
(
var
verifier
=
CompileAndVerify
WinRt
(
source
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
additionalRefs
:
LegacyRefs
,
...
...
@@ -7377,10 +7365,9 @@ public IEnumerator<int> GetEnumerator()
}
}
}"
;
var
verifier
=
CompileAndVerify
(
source
,
var
verifier
=
CompileAndVerify
WinRt
(
source
,
options
:
TestOptions
.
ReleaseWinMD
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
additionalRefs
:
WinRtRefs
);
emitOptions
:
TestEmitters
.
RefEmitBug
);
verifier
.
VerifyDiagnostics
();
verifier
.
VerifyIL
(
"Test.C.GetEnumerator()"
,
...
...
@@ -7392,8 +7379,6 @@ .maxstack 1
}"
);
var
compRef
=
verifier
.
Compilation
.
ToMetadataReference
();
var
allRefs
=
new
List
<
MetadataReference
>(
WinRtRefs
);
allRefs
.
Add
(
compRef
);
source
=
@"using System;
using Test;
...
...
@@ -7409,9 +7394,9 @@ public static void Main(string[] args)
}
}
}"
;
verifier
=
CompileAndVerify
(
source
,
verifier
=
CompileAndVerify
WinRt
(
source
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
additionalRefs
:
allRefs
.
ToArray
()
);
additionalRefs
:
new
[]
{
compRef
}
);
verifier
.
VerifyDiagnostics
(
// (1,1): info CS8019: Unnecessary using directive.
// using System;
...
...
src/Compilers/CSharp/Test/
Symbol/Symbols
/Metadata/WinMdDumpTest.cs
→
src/Compilers/CSharp/Test/
WinRT
/Metadata/WinMdDumpTest.cs
浏览文件 @
5b48bdd9
文件已移动
src/Compilers/CSharp/Test/
Symbol/Symbols
/Metadata/WinMdEventTests.cs
→
src/Compilers/CSharp/Test/
WinRT
/Metadata/WinMdEventTests.cs
浏览文件 @
5b48bdd9
...
...
@@ -2351,14 +2351,16 @@ public bool Scenario2()
return d.d1 == null;
}
}"
;
var
verifier
=
CompileAndVerify
OnWin8Only
(
var
verifier
=
CompileAndVerify
(
new
[]
{
src
,
DynamicCommonSrc
},
additionalRefs
:
new
[]
{
MscorlibRef_v4_0_30316_17626
,
SystemCoreRef_v4_0_30319_17929
,
_eventLibRef
,
},
emitOptions
:
TestEmitters
.
RefEmitBug
);
emitOptions
:
TestEmitters
.
RefEmitBug
,
verify
:
OSVersion
.
IsWin8
);
verifier
.
VerifyDiagnostics
(
// (6,42): warning CS0067: The event 'A.d2' is never used
// public event genericDelegate<object> d2;
...
...
@@ -2485,8 +2487,7 @@ public class abcdef{
}
} "
;
CSharpCompilation
comp
=
CreateWinRtCompilation
(
text
);
var
cv
=
CompileAndVerifyOnWin8Only
(
comp
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
var
cv
=
CompileAndVerifyOnWin8Only
(
text
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
cv
.
VerifyIL
(
"abcdef.foo()"
,
@"
{
...
...
@@ -2546,8 +2547,7 @@ private void OnSuspending(object sender, SuspendingEventArgs e)
}
} "
;
CSharpCompilation
comp
=
CreateWinRtCompilation
(
text
);
var
cv
=
CompileAndVerifyOnWin8Only
(
comp
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
var
cv
=
CompileAndVerifyOnWin8Only
(
text
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
var
ExpectedIl
=
@"
...
...
@@ -2611,10 +2611,7 @@ private void OnSuspending(object sender, SuspendingEventArgs e)
}
}"
;
CSharpCompilation
comp
=
CreateWinRtCompilation
(
text
);
var
cv
=
CompileAndVerifyOnWin8Only
(
comp
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
CSharpCompilation
a
=
CreateWinRtCompilation
(
text
);
var
cv
=
CompileAndVerifyOnWin8Only
(
text
,
emitOptions
:
TestEmitters
.
RefEmitBug
);
cv
.
VerifyIL
(
"abcdef.foo()"
,
@"
{
...
...
@@ -2660,7 +2657,7 @@ public void VerifySignatures()
var
text
=
"public class A{};"
;
var
comp
=
CreateWinRtCompilation
(
text
);
var
winmdlib
=
comp
.
ExternalReferences
[
1
]
;
var
winmdlib
=
comp
.
ExternalReferences
.
Where
(
r
=>
r
.
Display
==
"Windows"
).
Single
()
;
var
winmdNS
=
comp
.
GetReferencedAssemblySymbol
(
winmdlib
);
var
ns1
=
comp
.
GlobalNamespace
.
GetMember
<
NamespaceSymbol
>(
"Windows"
);
...
...
src/Compilers/CSharp/Test/
Symbol/Symbols
/Metadata/WinMdMetadataTests.cs
→
src/Compilers/CSharp/Test/
WinRT
/Metadata/WinMdMetadataTests.cs
浏览文件 @
5b48bdd9
...
...
@@ -39,7 +39,7 @@ public void FunctionPrototypeForwarded()
var
text
=
"public class A{};"
;
var
comp
=
CreateWinRtCompilation
(
text
);
var
winmdlib
=
comp
.
ExternalReferences
[
1
]
;
var
winmdlib
=
comp
.
ExternalReferences
.
Where
(
r
=>
r
.
Display
==
"Windows"
).
Single
()
;
var
winmdNS
=
comp
.
GetReferencedAssemblySymbol
(
winmdlib
);
var
wns1
=
winmdNS
.
GlobalNamespace
.
GetMember
<
NamespaceSymbol
>(
"Windows"
);
...
...
@@ -61,7 +61,7 @@ public void DelegateConstructorMarkedPublic()
var
text
=
"public class A{};"
;
var
comp
=
CreateWinRtCompilation
(
text
);
var
winmdlib
=
comp
.
ExternalReferences
[
1
]
;
var
winmdlib
=
comp
.
ExternalReferences
.
Where
(
r
=>
r
.
Display
==
"Windows"
).
Single
()
;
var
winmdNS
=
comp
.
GetReferencedAssemblySymbol
(
winmdlib
);
var
wns1
=
winmdNS
.
GlobalNamespace
.
GetMember
<
NamespaceSymbol
>(
"Windows"
);
...
...
@@ -82,7 +82,7 @@ public void TypeFowardingRenaming()
var
text
=
"public class A{};"
;
var
comp
=
CreateWinRtCompilation
(
text
);
var
winmdlib
=
comp
.
ExternalReferences
[
1
]
;
var
winmdlib
=
comp
.
ExternalReferences
.
Where
(
r
=>
r
.
Display
==
"Windows"
).
Single
()
;
var
winmdNS
=
comp
.
GetReferencedAssemblySymbol
(
winmdlib
);
var
wns1
=
winmdNS
.
GlobalNamespace
.
GetMember
<
NamespaceSymbol
>(
"Windows"
);
...
...
@@ -102,7 +102,7 @@ public void WinMdTypesDefPrivate()
{
var
text
=
"public class A{};"
;
var
comp
=
CreateWinRtCompilation
(
text
);
var
winmdlib
=
comp
.
ExternalReferences
[
1
]
;
var
winmdlib
=
comp
.
ExternalReferences
.
Where
(
r
=>
r
.
Display
==
"Windows"
).
Single
()
;
var
winmdNS
=
comp
.
GetReferencedAssemblySymbol
(
winmdlib
);
var
wns1
=
winmdNS
.
GlobalNamespace
.
GetMember
<
NamespaceSymbol
>(
"Windows"
);
...
...
@@ -122,7 +122,7 @@ public void WinMdColorType()
var
comp
=
CreateWinRtCompilation
(
text
);
var
winmdlib
=
comp
.
ExternalReferences
[
1
]
;
var
winmdlib
=
comp
.
ExternalReferences
.
Where
(
r
=>
r
.
Display
==
"Windows"
).
Single
()
;
var
winmdNS
=
comp
.
GetReferencedAssemblySymbol
(
winmdlib
);
var
wns1
=
winmdNS
.
GlobalNamespace
.
GetMember
<
NamespaceSymbol
>(
"Windows"
);
var
wns2
=
wns1
.
GetMember
<
NamespaceSymbol
>(
"UI"
);
...
...
@@ -166,7 +166,7 @@ public void IReferenceToINullableType()
var
comp
=
CreateWinRtCompilation
(
text
);
var
winmdlib
=
comp
.
ExternalReferences
[
1
]
;
var
winmdlib
=
comp
.
ExternalReferences
.
Where
(
r
=>
r
.
Display
==
"Windows"
).
Single
()
;
var
winmdNS
=
comp
.
GetReferencedAssemblySymbol
(
winmdlib
);
var
wns1
=
winmdNS
.
GlobalNamespace
.
GetMember
<
NamespaceSymbol
>(
"Windows"
);
var
wns2
=
wns1
.
GetMember
<
NamespaceSymbol
>(
"Globalization"
);
...
...
@@ -203,7 +203,6 @@ public static void Main(string[] args)
}"
;
var
verifier
=
CompileAndVerifyOnWin8Only
(
source
,
emitOptions
:
TestEmitters
.
RefEmitBug
,
additionalRefs
:
WinRtRefs
,
expectedOutput
:
"10\r\n0"
);
verifier
.
VerifyDiagnostics
();
}
...
...
src/Compilers/CSharp/Test/WinRT/packages.config
0 → 100644
浏览文件 @
5b48bdd9
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"Microsoft.CodeAnalysis.Test.Resources.Proprietary"
version
=
"1.0.0-rc1-20150208-02"
targetFramework
=
"net45"
/>
<
package
id
=
"System.Collections.Immutable"
version
=
"1.1.33-beta"
targetFramework
=
"net45"
/>
<
package
id
=
"System.Reflection.Metadata"
version
=
"1.0.18-beta"
targetFramework
=
"net45"
/>
<
package
id
=
"xunit"
version
=
"1.9.2"
targetFramework
=
"net45"
/>
</
packages
>
\ No newline at end of file
src/Compilers/Core/Portable/CodeAnalysis.csproj
浏览文件 @
5b48bdd9
...
...
@@ -611,6 +611,7 @@
<InternalsVisibleTo
Include=
"VBCSCompiler"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.CommandLine.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.Emit.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.WinRT.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.EnC.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.Semantic.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.Symbol.UnitTests"
/>
...
...
src/Compilers/Test/Utilities/CSharp/CSharpCompilerTestUtilities.csproj
浏览文件 @
5b48bdd9
...
...
@@ -100,6 +100,7 @@
<ItemGroup>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.CommandLine.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.Emit.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.WinRT.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.EnC.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.Semantic.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.Symbol.UnitTests"
/>
...
...
src/Compilers/Test/Utilities/CSharp/CSharpTestBase.cs
浏览文件 @
5b48bdd9
...
...
@@ -121,6 +121,44 @@ private Action<IModuleSymbol> Translate(Action<ModuleSymbol> action)
verify
:
verify
);
}
internal
CompilationVerifier
CompileAndVerifyWinRt
(
string
source
,
string
expectedOutput
=
null
,
MetadataReference
[]
additionalRefs
=
null
,
TestEmitters
emitOptions
=
TestEmitters
.
All
,
CSharpCompilationOptions
options
=
null
,
bool
verify
=
true
)
{
if
(
options
==
null
)
{
options
=
expectedOutput
!=
null
?
TestOptions
.
ReleaseExe
:
TestOptions
.
ReleaseDll
;
}
var
compilation
=
CreateCompilation
(
source
,
WinRtRefs
.
Concat
(
additionalRefs
??
Enumerable
.
Empty
<
MetadataReference
>()),
options
);
return
CompileAndVerify
(
compilation
:
compilation
,
expectedOutput
:
expectedOutput
,
emitOptions
:
emitOptions
,
verify
:
verify
);
}
internal
CompilationVerifier
CompileAndVerifyOnWin8Only
(
string
source
,
MetadataReference
[]
additionalRefs
=
null
,
TestEmitters
emitOptions
=
TestEmitters
.
All
,
string
expectedOutput
=
null
)
{
return
CompileAndVerifyWinRt
(
source
,
additionalRefs
:
additionalRefs
,
expectedOutput
:
expectedOutput
,
emitOptions
:
emitOptions
,
verify
:
OSVersion
.
IsWin8
);
}
internal
CompilationVerifier
CompileAndVerify
(
string
[]
sources
,
MetadataReference
[]
additionalRefs
=
null
,
...
...
@@ -176,92 +214,15 @@ private Action<IModuleSymbol> Translate(Action<ModuleSymbol> action)
collectEmittedAssembly
,
verify
);
}
internal
CompilationVerifier
CompileAndVerifyOnWin8Only
(
string
source
,
MetadataReference
[]
additionalRefs
=
null
,
IEnumerable
<
ModuleData
>
dependencies
=
null
,
TestEmitters
emitOptions
=
TestEmitters
.
All
,
Action
<
ModuleSymbol
>
sourceSymbolValidator
=
null
,
Action
<
PEAssembly
>
validator
=
null
,
Action
<
ModuleSymbol
>
symbolValidator
=
null
,
SignatureDescription
[]
expectedSignatures
=
null
,
string
expectedOutput
=
null
,
CompilationOptions
options
=
null
,
bool
collectEmittedAssembly
=
true
)
{
return
base
.
CompileAndVerifyOnWin8Only
(
source
,
additionalRefs
,
dependencies
,
emitOptions
,
Translate
(
sourceSymbolValidator
),
validator
,
Translate
(
symbolValidator
),
expectedSignatures
,
expectedOutput
,
options
,
collectEmittedAssembly
);
}
internal
CompilationVerifier
CompileAndVerifyOnWin8Only
(
Compilation
compilation
,
IEnumerable
<
ModuleData
>
dependencies
=
null
,
TestEmitters
emitOptions
=
TestEmitters
.
All
,
Action
<
ModuleSymbol
>
sourceSymbolValidator
=
null
,
Action
<
PEAssembly
>
validator
=
null
,
Action
<
ModuleSymbol
>
symbolValidator
=
null
,
SignatureDescription
[]
expectedSignatures
=
null
,
string
expectedOutput
=
null
,
bool
collectEmittedAssembly
=
true
)
{
return
base
.
CompileAndVerifyOnWin8Only
(
compilation
,
dependencies
,
emitOptions
,
Translate
(
sourceSymbolValidator
),
validator
,
Translate
(
symbolValidator
),
expectedSignatures
,
expectedOutput
,
collectEmittedAssembly
);
}
internal
CompilationVerifier
CompileAndVerifyOnWin8Only
(
string
[]
sources
,
MetadataReference
[]
additionalRefs
=
null
,
IEnumerable
<
ModuleData
>
dependencies
=
null
,
TestEmitters
emitOptions
=
TestEmitters
.
All
,
Action
<
ModuleSymbol
>
sourceSymbolValidator
=
null
,
Action
<
PEAssembly
>
validator
=
null
,
Action
<
ModuleSymbol
>
symbolValidator
=
null
,
SignatureDescription
[]
expectedSignatures
=
null
,
string
expectedOutput
=
null
,
CompilationOptions
options
=
null
,
bool
collectEmittedAssembly
=
true
,
bool
verify
=
true
)
{
return
base
.
CompileAndVerifyOnWin8Only
(
sources
,
additionalRefs
,
dependencies
,
emitOptions
,
Translate
(
sourceSymbolValidator
),
validator
,
Translate
(
symbolValidator
),
expectedSignatures
,
expectedOutput
,
options
,
collectEmittedAssembly
,
verify
);
}
}
public
abstract
class
CSharpTestBaseBase
:
CommonTestBase
{
public
static
CSharpCompilation
CreateWinRtCompilation
(
string
text
)
public
static
CSharpCompilation
CreateWinRtCompilation
(
string
text
,
MetadataReference
[]
additionalRefs
=
null
)
{
return
CSharpTestBase
.
CreateCompilationWithMscorlib
(
text
,
WinRtRefs
,
TestOptions
.
ReleaseExe
);
return
CSharpTestBase
.
CreateCompilation
(
text
,
WinRtRefs
.
Concat
(
additionalRefs
??
Enumerable
.
Empty
<
MetadataReference
>()),
TestOptions
.
ReleaseExe
);
}
internal
static
DiagnosticDescription
Diagnostic
(
ErrorCode
code
,
string
squiggledText
=
null
,
object
[]
arguments
=
null
,
...
...
src/Roslyn.sln
浏览文件 @
5b48bdd9
...
...
@@ -315,14 +315,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setup", "Setup", "{4C81EBB2
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{998CAFE8-06E4-4683-A151-0F6AA4BFF6C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpWinRTTest", "Compilers\CSharp\Test\WinRT\CSharpWinRTTest.csproj", "{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{edc68a0e-c68d-4a74-91b7-bf38ec909888}*SharedItemsImports = 4
Compilers\Core\SharedCollections\SharedCollections.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 4
Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{a1bcd0ce-6c2f-4f8c-9a48-d9d93928e26d}*SharedItemsImports = 4
Compilers\Core\SharedCollections\SharedCollections.projitems*{afde6bea-5038-4a4a-a88e-dbd2e4088eed}*SharedItemsImports = 4
Compilers\Core\SharedCollections\SharedCollections.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4
Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4
Compilers\Core\SharedCollections\SharedCollections.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4
Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{3973b09a-4fbf-44a5-8359-3d22ceb71f71}*SharedItemsImports = 4
Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{b501a547-c911-4a05-ac6e-274a50dff30e}*SharedItemsImports = 4
Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4
...
...
@@ -1830,6 +1832,16 @@ Global
{0FAE8CB3-4D2F-4A11-B1E6-F47EFF0FB863}.Release|ARM.Build.0 = Release|Any CPU
{0FAE8CB3-4D2F-4A11-B1E6-F47EFF0FB863}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{0FAE8CB3-4D2F-4A11-B1E6-F47EFF0FB863}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|ARM.ActiveCfg = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|Any CPU.Build.0 = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|ARM.ActiveCfg = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
@@ -1975,5 +1987,6 @@ Global
{151F6994-AEB3-4B12-B746-2ACFF26C7BBB} = {235A3418-A3B0-4844-BCEB-F1CF45069232}
{4C81EBB2-82E1-4C81-80C4-84CC40FA281B} = {235A3418-A3B0-4844-BCEB-F1CF45069232}
{998CAFE8-06E4-4683-A151-0F6AA4BFF6C6} = {235A3418-A3B0-4844-BCEB-F1CF45069232}
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E} = {32A48625-F0AD-419D-828B-A50BDABA38EA}
EndGlobalSection
EndGlobal
src/Roslyn2013.sln
浏览文件 @
5b48bdd9
...
...
@@ -201,14 +201,16 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "BasicSystemRuntimeAnalyzers
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemRuntimeAnalyzersTest", "Diagnostics\FxCop\System.Runtime.Analyzers\Test\SystemRuntimeAnalyzersTest.csproj", "{0FAE8CB3-4D2F-4A11-B1E6-F47EFF0FB863}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpWinRTTest", "Compilers\CSharp\Test\WinRT\CSharpWinRTTest.csproj", "{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{edc68a0e-c68d-4a74-91b7-bf38ec909888}*SharedItemsImports = 4
Compilers\Core\SharedCollections\SharedCollections.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 4
Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{a1bcd0ce-6c2f-4f8c-9a48-d9d93928e26d}*SharedItemsImports = 4
Compilers\Core\SharedCollections\SharedCollections.projitems*{afde6bea-5038-4a4a-a88e-dbd2e4088eed}*SharedItemsImports = 4
Compilers\Core\SharedCollections\SharedCollections.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4
Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4
Compilers\Core\SharedCollections\SharedCollections.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4
Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{3973b09a-4fbf-44a5-8359-3d22ceb71f71}*SharedItemsImports = 4
Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{b501a547-c911-4a05-ac6e-274a50dff30e}*SharedItemsImports = 4
Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4
...
...
@@ -1460,6 +1462,26 @@ Global
{0FAE8CB3-4D2F-4A11-B1E6-F47EFF0FB863}.Release|Win32.Build.0 = Release|Any CPU
{0FAE8CB3-4D2F-4A11-B1E6-F47EFF0FB863}.Release|x86.ActiveCfg = Release|Any CPU
{0FAE8CB3-4D2F-4A11-B1E6-F47EFF0FB863}.Release|x86.Build.0 = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|ARM.ActiveCfg = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|ARM.Build.0 = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|Win32.ActiveCfg = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|Win32.Build.0 = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|x86.ActiveCfg = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Debug|x86.Build.0 = Debug|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|Any CPU.Build.0 = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|ARM.ActiveCfg = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|ARM.Build.0 = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|Win32.ActiveCfg = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|Win32.Build.0 = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|x86.ActiveCfg = Release|Any CPU
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
@@ -1541,5 +1563,6 @@ Global
{A36451EC-1127-40CE-B841-47F393D24624} = {E2DE3EA3-97CD-4978-8917-747E961E1712}
{D835C05E-9D83-40B2-9D25-19EB652F10D7} = {E2DE3EA3-97CD-4978-8917-747E961E1712}
{0FAE8CB3-4D2F-4A11-B1E6-F47EFF0FB863} = {E2DE3EA3-97CD-4978-8917-747E961E1712}
{FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E} = {14B2BA6C-0448-463B-ACBB-E09F63C0C9CD}
EndGlobalSection
EndGlobal
src/Test/Utilities/CommonTestBase.cs
浏览文件 @
5b48bdd9
...
...
@@ -249,97 +249,6 @@ static CommonTestBase()
return
result
;
}
/// <summary>
/// Compiles, but only verifies if run on a Windows 8 machine.
/// </summary>
internal
CompilationVerifier
CompileAndVerifyOnWin8Only
(
string
source
,
MetadataReference
[]
additionalRefs
=
null
,
IEnumerable
<
ModuleData
>
dependencies
=
null
,
TestEmitters
emitOptions
=
TestEmitters
.
All
,
Action
<
IModuleSymbol
>
sourceSymbolValidator
=
null
,
Action
<
PEAssembly
>
validator
=
null
,
Action
<
IModuleSymbol
>
symbolValidator
=
null
,
SignatureDescription
[]
expectedSignatures
=
null
,
string
expectedOutput
=
null
,
CompilationOptions
options
=
null
,
bool
collectEmittedAssembly
=
true
)
{
return
CompileAndVerify
(
source
,
additionalRefs
,
dependencies
,
emitOptions
,
Translate
(
sourceSymbolValidator
),
Translate
(
validator
),
Translate
(
symbolValidator
),
expectedSignatures
,
OSVersion
.
IsWin8
?
expectedOutput
:
null
,
options
,
collectEmittedAssembly
,
verify
:
OSVersion
.
IsWin8
);
}
/// <summary>
/// Compiles, but only verifies on a Windows 8 machine.
/// </summary>
internal
CompilationVerifier
CompileAndVerifyOnWin8Only
(
Compilation
compilation
,
IEnumerable
<
ModuleData
>
dependencies
=
null
,
TestEmitters
emitOptions
=
TestEmitters
.
All
,
Action
<
IModuleSymbol
>
sourceSymbolValidator
=
null
,
Action
<
PEAssembly
>
validator
=
null
,
Action
<
IModuleSymbol
>
symbolValidator
=
null
,
SignatureDescription
[]
expectedSignatures
=
null
,
string
expectedOutput
=
null
,
bool
collectEmittedAssembly
=
true
)
{
return
CompileAndVerify
(
compilation
,
null
,
dependencies
,
emitOptions
,
Translate
(
sourceSymbolValidator
),
Translate
(
validator
),
Translate
(
symbolValidator
),
expectedSignatures
,
OSVersion
.
IsWin8
?
expectedOutput
:
null
,
collectEmittedAssembly
,
verify
:
OSVersion
.
IsWin8
);
}
/// <summary>
/// Compiles, but only verifies on a win8 machine.
/// </summary>
internal
CompilationVerifier
CompileAndVerifyOnWin8Only
(
string
[]
sources
,
MetadataReference
[]
additionalRefs
=
null
,
IEnumerable
<
ModuleData
>
dependencies
=
null
,
TestEmitters
emitOptions
=
TestEmitters
.
All
,
Action
<
IModuleSymbol
>
sourceSymbolValidator
=
null
,
Action
<
PEAssembly
>
validator
=
null
,
Action
<
IModuleSymbol
>
symbolValidator
=
null
,
SignatureDescription
[]
expectedSignatures
=
null
,
string
expectedOutput
=
null
,
CompilationOptions
options
=
null
,
bool
collectEmittedAssembly
=
true
,
bool
verify
=
true
)
{
return
CompileAndVerify
(
sources
,
additionalRefs
,
dependencies
,
emitOptions
,
Translate
(
sourceSymbolValidator
),
Translate
(
validator
),
Translate
(
symbolValidator
),
expectedSignatures
,
OSVersion
.
IsWin8
?
expectedOutput
:
null
,
options
,
collectEmittedAssembly
,
verify
:
verify
&&
OSVersion
.
IsWin8
);
}
private
static
Action
<
T
,
TestEmitters
>
Translate
<
T
>(
Action
<
T
>
action
)
{
if
(
action
!=
null
)
...
...
src/Test/Utilities/HostedRuntimeEnvironment.cs
浏览文件 @
5b48bdd9
...
...
@@ -27,6 +27,7 @@ public class HostedRuntimeEnvironment : IDisposable
private
RuntimeAssemblyManager
assemblyManager
;
private
ImmutableArray
<
Diagnostic
>
lazyDiagnostics
;
private
ModuleData
mainModule
;
private
ImmutableArray
<
byte
>
mainModulePdb
;
private
List
<
ModuleData
>
allModuleData
;
private
readonly
CompilationTestData
testData
=
new
CompilationTestData
();
private
readonly
IEnumerable
<
ModuleData
>
additionalDependencies
;
...
...
@@ -97,7 +98,6 @@ private void CreateAssemblyManager(IEnumerable<ModuleData> compilationDependenci
// Determines if any of the given dependencies has the same name as already loaded assembly with different content.
private
static
string
DetectNameCollision
(
IEnumerable
<
ModuleData
>
modules
)
{
modules
=
modules
.
Where
(
m
=>
!
m
.
FullName
.
Contains
(
"mscorlib"
));
lock
(
allModuleNames
)
{
foreach
(
var
module
in
modules
)
...
...
@@ -122,12 +122,19 @@ private static string DetectNameCollision(IEnumerable<ModuleData> modules)
return
null
;
}
private
static
void
EmitDependentCompilation
(
Compilation
compilation
,
List
<
ModuleData
>
dependencies
,
DiagnosticBag
diagnostics
)
private
static
void
EmitDependentCompilation
(
Compilation
compilation
,
List
<
ModuleData
>
dependencies
,
DiagnosticBag
diagnostics
,
bool
usePdbForDebugging
=
false
)
{
ImmutableArray
<
byte
>
assembly
,
pdb
;
if
(
EmitCompilation
(
compilation
,
null
,
dependencies
,
diagnostics
,
null
,
out
assembly
,
out
pdb
))
{
dependencies
.
Add
(
new
ModuleData
(
compilation
.
Assembly
.
Identity
,
OutputKind
.
DynamicallyLinkedLibrary
,
assembly
,
pdb
,
inMemoryModule
:
true
));
dependencies
.
Add
(
new
ModuleData
(
compilation
.
Assembly
.
Identity
,
OutputKind
.
DynamicallyLinkedLibrary
,
assembly
,
pdb
:
usePdbForDebugging
?
pdb
:
default
(
ImmutableArray
<
byte
>),
inMemoryModule
:
true
));
}
}
...
...
@@ -156,11 +163,18 @@ internal static void EmitReferences(Compilation compilation, List<ModuleData> de
ImmutableArray
<
byte
>
bytes
=
module
.
Module
.
PEReaderOpt
.
GetEntireImage
().
GetContent
();
if
(
isManifestModule
)
{
dependencies
.
Add
(
new
ModuleData
(((
AssemblyMetadata
)
metadata
).
GetAssembly
().
Identity
,
OutputKind
.
DynamicallyLinkedLibrary
,
bytes
,
pdb
:
default
(
ImmutableArray
<
byte
>),
inMemoryModule
:
true
));
dependencies
.
Add
(
new
ModuleData
(((
AssemblyMetadata
)
metadata
).
GetAssembly
().
Identity
,
OutputKind
.
DynamicallyLinkedLibrary
,
bytes
,
pdb
:
default
(
ImmutableArray
<
byte
>),
inMemoryModule
:
true
));
}
else
{
dependencies
.
Add
(
new
ModuleData
(
module
.
Name
,
bytes
,
pdb
:
default
(
ImmutableArray
<
byte
>),
inMemoryModule
:
true
));
dependencies
.
Add
(
new
ModuleData
(
module
.
Name
,
bytes
,
pdb
:
default
(
ImmutableArray
<
byte
>),
inMemoryModule
:
true
));
}
isManifestModule
=
false
;
...
...
@@ -226,7 +240,10 @@ private static IEnumerable<ModuleMetadata> EnumerateModules(Metadata metadata)
}
}
public
void
Emit
(
Compilation
mainCompilation
,
IEnumerable
<
ResourceDescription
>
manifestResources
)
public
void
Emit
(
Compilation
mainCompilation
,
IEnumerable
<
ResourceDescription
>
manifestResources
,
bool
usePdbForDebugging
=
false
)
{
var
diagnostics
=
DiagnosticBag
.
GetInstance
();
var
dependencies
=
new
List
<
ModuleData
>();
...
...
@@ -240,7 +257,12 @@ public void Emit(Compilation mainCompilation, IEnumerable<ResourceDescription> m
if
(
succeeded
)
{
this
.
mainModule
=
new
ModuleData
(
mainCompilation
.
Assembly
.
Identity
,
mainCompilation
.
Options
.
OutputKind
,
mainImage
,
mainPdb
,
inMemoryModule
:
true
);
this
.
mainModule
=
new
ModuleData
(
mainCompilation
.
Assembly
.
Identity
,
mainCompilation
.
Options
.
OutputKind
,
mainImage
,
pdb
:
usePdbForDebugging
?
mainPdb
:
default
(
ImmutableArray
<
byte
>),
inMemoryModule
:
true
);
this
.
mainModulePdb
=
mainPdb
;
this
.
allModuleData
=
dependencies
;
this
.
allModuleData
.
Insert
(
0
,
mainModule
);
CreateAssemblyManager
(
dependencies
,
mainModule
);
...
...
@@ -314,7 +336,7 @@ public ImmutableArray<byte> GetMainPdb()
throw
new
InvalidOperationException
(
"You must call Emit before calling GetMainPdb."
);
}
return
mainModule
.
Pdb
;
return
mainModulePdb
;
}
internal
IList
<
ModuleData
>
GetAllModuleData
()
...
...
src/Test/Utilities/TestUtilities.csproj
浏览文件 @
5b48bdd9
...
...
@@ -194,6 +194,7 @@
<ItemGroup>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.CommandLine.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.Emit.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.WinRT.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.EnC.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.Semantic.UnitTests"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Compilers.CSharp.Symbol.UnitTests"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录