Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
cf6dcdcb
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,发现更多精彩内容 >>
提交
cf6dcdcb
编写于
10月 31, 2017
作者:
G
Gen Lu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Address comments
上级
f5a8a0bb
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
21 addition
and
34 deletion
+21
-34
build/scripts/build.ps1
build/scripts/build.ps1
+1
-1
src/Compilers/Test/Utilities/CSharp/CSharpCompilerTestUtilities.csproj
.../Test/Utilities/CSharp/CSharpCompilerTestUtilities.csproj
+0
-3
src/Compilers/Test/Utilities/CSharp/CSharpTestBase.cs
src/Compilers/Test/Utilities/CSharp/CSharpTestBase.cs
+4
-11
src/Compilers/Test/Utilities/VisualBasic/BasicCompilerTestUtilities.vbproj
...t/Utilities/VisualBasic/BasicCompilerTestUtilities.vbproj
+0
-3
src/Compilers/Test/Utilities/VisualBasic/CompilationTestUtils.vb
...pilers/Test/Utilities/VisualBasic/CompilationTestUtils.vb
+8
-15
src/Test/Utilities/Portable/Compilation/CompilationExtensions.cs
...t/Utilities/Portable/Compilation/CompilationExtensions.cs
+5
-1
src/Test/Utilities/Portable/TestUtilities.csproj
src/Test/Utilities/Portable/TestUtilities.csproj
+3
-0
未找到文件。
build/scripts/build.ps1
浏览文件 @
cf6dcdcb
src/Compilers/Test/Utilities/CSharp/CSharpCompilerTestUtilities.csproj
浏览文件 @
cf6dcdcb
...
...
@@ -17,9 +17,6 @@
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"
/>
<PropertyGroup
Condition=
"'$(TestIOperationInterface)' == 'true'"
>
<DefineConstants>
$(DefineConstants);TEST_IOPERATION_INTERFACE
</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference
Include=
"..\..\..\..\Test\PdbUtilities\PdbUtilities.csproj"
/>
<ProjectReference
Include=
"..\..\..\..\Test\Utilities\Portable\TestUtilities.csproj"
/>
...
...
src/Compilers/Test/Utilities/CSharp/CSharpTestBase.cs
浏览文件 @
cf6dcdcb
...
...
@@ -582,7 +582,7 @@ public static SyntaxTree ParseWithRoundTripCheck(string text, CSharpParseOptions
trees
,
references
,
options
);
ValidateIOperations
(
createCompilationLambda
);
CompilationExtensions
.
ValidateIOperations
(
createCompilationLambda
);
return
createCompilationLambda
();
}
...
...
@@ -596,7 +596,7 @@ public static SyntaxTree ParseWithRoundTripCheck(string text, CSharpParseOptions
var
trees
=
(
sources
==
null
)
?
null
:
sources
.
Select
(
s
=>
Parse
(
s
,
options
:
parseOptions
)).
ToArray
();
Func
<
CSharpCompilation
>
createCompilationLambda
=
()
=>
CSharpCompilation
.
Create
(
identity
.
Name
,
options
:
options
??
TestOptions
.
ReleaseDll
,
references
:
references
,
syntaxTrees
:
trees
);
ValidateIOperations
(
createCompilationLambda
);
CompilationExtensions
.
ValidateIOperations
(
createCompilationLambda
);
var
c
=
createCompilationLambda
();
Assert
.
NotNull
(
c
.
Assembly
);
// force creation of SourceAssemblySymbol
...
...
@@ -621,7 +621,7 @@ public static SyntaxTree ParseWithRoundTripCheck(string text, CSharpParseOptions
previousScriptCompilation
:
previous
,
returnType
:
returnType
,
globalsType
:
hostObjectType
);
ValidateIOperations
(
createCompilationLambda
);
CompilationExtensions
.
ValidateIOperations
(
createCompilationLambda
);
return
createCompilationLambda
();
}
...
...
@@ -644,7 +644,7 @@ public static SyntaxTree ParseWithRoundTripCheck(string text, CSharpParseOptions
previousScriptCompilation
:
previous
,
returnType
:
returnType
,
globalsType
:
hostObjectType
);
ValidateIOperations
(
createCompilationLambda
);
CompilationExtensions
.
ValidateIOperations
(
createCompilationLambda
);
return
createCompilationLambda
();
}
...
...
@@ -1253,13 +1253,6 @@ protected static void VerifyOperationTreeForTest<TSyntaxNode>(CSharpCompilation
return
ilReference
;
}
private
static
void
ValidateIOperations
(
Func
<
Compilation
>
createCompilation
)
{
#if TEST_IOPERATION_INTERFACE
var
compilation
=
createCompilation
();
compilation
.
CheckOperations
();
#endif
}
#
endregion
#
region
Span
...
...
src/Compilers/Test/Utilities/VisualBasic/BasicCompilerTestUtilities.vbproj
浏览文件 @
cf6dcdcb
...
...
@@ -22,9 +22,6 @@
</ItemGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"
/>
<PropertyGroup
Condition=
"'$(TestIOperationInterface)' == 'true'"
>
<DefineConstants>
$(DefineConstants),TEST_IOPERATION_INTERFACE
</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
...
...
src/Compilers/Test/Utilities/VisualBasic/CompilationTestUtils.vb
浏览文件 @
cf6dcdcb
...
...
@@ -41,7 +41,7 @@ Friend Module CompilationUtils
references
,
options
)
End
Function
ValidateIOperations
(
createCompilationLambda
)
CompilationExtensions
.
ValidateIOperations
(
createCompilationLambda
)
Return
createCompilationLambda
()
End
Function
...
...
@@ -76,7 +76,7 @@ Friend Module CompilationUtils
Return
VisualBasicCompilation
.
Create
(
assemblyName
,
sourceTrees
,
metadataReferences
,
options
)
End
Function
ValidateIOperations
(
createCompilationLambda
)
CompilationExtensions
.
ValidateIOperations
(
createCompilationLambda
)
Return
createCompilationLambda
()
End
Function
...
...
@@ -106,7 +106,7 @@ Friend Module CompilationUtils
Dim
createCompilationLambda
=
Function
()
Return
VisualBasicCompilation
.
Create
(
If
(
assemblyName
,
GetUniqueName
()),
sourceTrees
,
If
(
references
Is
Nothing
,
additionalRefs
,
additionalRefs
.
Concat
(
references
)),
options
)
End
Function
ValidateIOperations
(
createCompilationLambda
)
CompilationExtensions
.
ValidateIOperations
(
createCompilationLambda
)
Return
createCompilationLambda
()
End
Function
...
...
@@ -120,7 +120,7 @@ Friend Module CompilationUtils
Dim
createCompilationLambda
=
Function
()
Return
VisualBasicCompilation
.
Create
(
If
(
assemblyName
,
GetUniqueName
()),
{
Parse
(
source
,
parseOptions
)},
If
(
references
Is
Nothing
,
additionalRefs
,
additionalRefs
.
Concat
(
references
)),
options
)
End
Function
ValidateIOperations
(
createCompilationLambda
)
CompilationExtensions
.
ValidateIOperations
(
createCompilationLambda
)
Return
createCompilationLambda
()
End
Function
...
...
@@ -131,7 +131,7 @@ Friend Module CompilationUtils
Dim
createCompilationLambda
=
Function
()
Return
VisualBasicCompilation
.
Create
(
GetUniqueName
(),
sourceTrees
,
If
(
references
Is
Nothing
,
additionalRefs
,
additionalRefs
.
Concat
(
references
)),
options
)
End
Function
ValidateIOperations
(
createCompilationLambda
)
CompilationExtensions
.
ValidateIOperations
(
createCompilationLambda
)
Return
createCompilationLambda
()
End
Function
...
...
@@ -141,7 +141,7 @@ Friend Module CompilationUtils
Dim
createCompilationLambda
=
Function
()
Return
VisualBasicCompilation
.
Create
(
GetUniqueName
(),
{
sourceTree
},
If
(
references
Is
Nothing
,
{
MscorlibRef
},
{
MscorlibRef
}.
Concat
(
references
)),
options
)
End
Function
ValidateIOperations
(
createCompilationLambda
)
CompilationExtensions
.
ValidateIOperations
(
createCompilationLambda
)
Return
createCompilationLambda
()
End
Function
...
...
@@ -333,7 +333,7 @@ Friend Module CompilationUtils
Dim
createCompilationLambda
=
Function
()
Return
VisualBasicCompilation
.
Create
(
If
(
assemblyName
,
GetUniqueName
()),
sourceTrees
,
references
,
options
)
End
Function
ValidateIOperations
(
createCompilationLambda
)
CompilationExtensions
.
ValidateIOperations
(
createCompilationLambda
)
Return
createCompilationLambda
()
End
Function
...
...
@@ -360,7 +360,7 @@ Friend Module CompilationUtils
Dim
createCompilationLambda
=
Function
()
Return
VisualBasicCompilation
.
Create
(
identity
.
Name
,
trees
,
references
,
options
)
End
Function
ValidateIOperations
(
createCompilationLambda
)
CompilationExtensions
.
ValidateIOperations
(
createCompilationLambda
)
Dim
c
=
createCompilationLambda
()
Assert
.
NotNull
(
c
.
Assembly
)
' force creation of SourceAssemblySymbol
...
...
@@ -1289,11 +1289,4 @@ Friend Module CompilationUtils
Dim
result
=
If
(
namespacesAndTypesOnly
,
model
.
LookupNamespacesAndTypes
(
position
,
container
),
model
.
LookupSymbols
(
position
,
container
))
Return
result
.
Select
(
Function
(
s
)
s
.
Name
).
Distinct
().
ToList
()
End
Function
Private
Sub
ValidateIOperations
(
createCompilation
As
Func
(
Of
Compilation
))
#If TEST_IOPERATION_INTERFACE Then
Dim
compilation
=
createCompilation
()
compilation
.
CheckOperations
()
#End If
End
Sub
End
Module
src/Test/Utilities/Portable/Compilation/CompilationExtensions.cs
浏览文件 @
cf6dcdcb
...
...
@@ -251,8 +251,11 @@ internal static bool CanHaveExecutableCodeBlock(ISymbol symbol)
}
}
public
static
void
CheckOperations
(
this
Compilation
c
ompilation
)
public
static
void
ValidateIOperations
(
Func
<
Compilation
>
createC
ompilation
)
{
#if TEST_IOPERATION_INTERFACE
var
compilation
=
createCompilation
();
foreach
(
var
tree
in
compilation
.
SyntaxTrees
)
{
var
semanticModel
=
compilation
.
GetSemanticModel
(
tree
);
...
...
@@ -268,6 +271,7 @@ public static void CheckOperations(this Compilation compilation)
}
}
}
#endif
}
}
}
src/Test/Utilities/Portable/TestUtilities.csproj
浏览文件 @
cf6dcdcb
...
...
@@ -23,6 +23,9 @@
</ItemGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"
/>
<PropertyGroup
Condition=
"'$(TestIOperationInterface)' == 'true'"
>
<DefineConstants>
$(DefineConstants);TEST_IOPERATION_INTERFACE
</DefineConstants>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleToTest
Include=
"Roslyn.Test.Utilities.CoreClr"
/>
<InternalsVisibleToTest
Include=
"Roslyn.Test.Utilities.Desktop"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录