Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
5df9a9d4
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,发现更多精彩内容 >>
未验证
提交
5df9a9d4
编写于
5月 29, 2018
作者:
J
Jared Parsons
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cleaned up the test failures
上级
876a23af
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
29 addition
and
19 deletion
+29
-19
src/Compilers/Test/Utilities/VisualBasic/BasicTestBase.vb
src/Compilers/Test/Utilities/VisualBasic/BasicTestBase.vb
+15
-5
src/Compilers/Test/Utilities/VisualBasic/BasicTestSource.vb
src/Compilers/Test/Utilities/VisualBasic/BasicTestSource.vb
+1
-1
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb
...s/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb
+2
-2
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IArgument.vb
...sic/Test/Semantic/IOperation/IOperationTests_IArgument.vb
+2
-2
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IBinaryOperatorExpression.vb
...c/IOperation/IOperationTests_IBinaryOperatorExpression.vb
+2
-2
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IUnaryOperatorExpression.vb
...ic/IOperation/IOperationTests_IUnaryOperatorExpression.vb
+2
-2
src/Compilers/VisualBasic/Test/Semantic/Semantics/ScriptSemanticsTests.vb
...sualBasic/Test/Semantic/Semantics/ScriptSemanticsTests.vb
+2
-2
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/WinMdTests.vb
...aluator/VisualBasic/Test/ExpressionCompiler/WinMdTests.vb
+1
-1
src/Test/Utilities/Portable/TargetFrameworkUtil.cs
src/Test/Utilities/Portable/TargetFrameworkUtil.cs
+2
-2
未找到文件。
src/Compilers/Test/Utilities/VisualBasic/BasicTestBase.vb
浏览文件 @
5df9a9d4
...
...
@@ -799,8 +799,13 @@ Public MustInherit Class BasicTestBase
Dim
fileName
=
"a.vb"
Dim
syntaxTree
=
Parse
(
source
,
fileName
,
parseOptions
)
Dim
defaultRefs
=
If
(
useLatestFrameworkReferences
,
LatestVbReferences
,
DefaultVbReferences
)
Dim
compilation
=
CreateCompilationWithMscorlib45AndVBRuntime
({
syntaxTree
},
references
:
=
defaultRefs
.
Append
({
ValueTupleRef
,
SystemRuntimeFacadeRef
}),
options
:
=
If
(
compilationOptions
,
TestOptions
.
ReleaseDll
))
Dim
allReferences
As
IEnumerable
(
Of
MetadataReference
)
If
useLatestFrameworkReferences
Then
allReferences
=
TargetFrameworkUtil
.
Mscorlib45ExtendedReferences
.
Add
(
TestBase
.
MsvbRef_v4_0_30319_17929
)
Else
allReferences
=
TargetFrameworkUtil
.
Mscorlib45ExtendedReferences
.
Add
(
TestBase
.
MsvbRef
)
End
If
Dim
compilation
=
CreateEmptyCompilation
({
syntaxTree
},
references
:
=
allReferences
,
options
:
=
If
(
compilationOptions
,
TestOptions
.
ReleaseDll
))
Dim
operationTree
=
GetOperationTreeForTest
(
Of
TSyntaxNode
)(
compilation
,
fileName
,
which
)
Return
(
operationTree
.
tree
,
operationTree
.
syntax
,
operationTree
.
operation
,
compilation
)
End
Function
...
...
@@ -858,10 +863,15 @@ Public MustInherit Class BasicTestBase
Dim
fileName
=
"a.vb"
Dim
syntaxTree
=
Parse
(
source
,
fileName
,
parseOptions
)
Dim
defaultRefs
=
If
(
useLatestFramework
,
LatestVbReferences
,
DefaultVbReferences
)
Dim
allReferences
=
defaultRefs
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
})
Dim
allReferences
As
IEnumerable
(
Of
MetadataReference
)
=
Nothing
If
useLatestFramework
Then
allReferences
=
TargetFrameworkUtil
.
Mscorlib45ExtendedReferences
.
Add
(
TestBase
.
MsvbRef_v4_0_30319_17929
)
Else
allReferences
=
TargetFrameworkUtil
.
Mscorlib45ExtendedReferences
.
Add
(
TestBase
.
MsvbRef
)
End
If
allReferences
=
If
(
references
IsNot
Nothing
,
allReferences
.
Concat
(
references
),
allReferences
)
Dim
compilation
=
Create
CompilationWithMscorlib45AndVBRuntime
({
syntaxTree
},
references
:
=
allReferences
,
options
:
=
If
(
compilationOptions
,
TestOptions
.
ReleaseDll
))
Dim
compilation
=
Create
EmptyCompilation
({
syntaxTree
},
references
:
=
allReferences
,
options
:
=
If
(
compilationOptions
,
TestOptions
.
ReleaseDll
))
VerifyOperationTreeAndDiagnosticsForTest
(
Of
TSyntaxNode
)(
compilation
,
fileName
,
expectedOperationTree
,
expectedDiagnostics
,
which
,
additionalOperationTreeVerifier
)
End
Sub
...
...
src/Compilers/Test/Utilities/VisualBasic/BasicTestSource.vb
浏览文件 @
5df9a9d4
...
...
@@ -33,7 +33,7 @@ Public Structure BasicTestSource
Dim
sources
=
TryCast
(
Value
,
String
())
If
sources
IsNot
Nothing
Then
Return
source
.
Select
(
Function
(
s
)
VisualBasicSyntaxTree
.
ParseText
(
s
,
parseOptions
)).
ToArray
()
Return
source
s
.
Select
(
Function
(
s
)
VisualBasicSyntaxTree
.
ParseText
(
s
,
parseOptions
)).
ToArray
()
End
If
Dim
tree
=
TryCast
(
Value
,
SyntaxTree
)
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb
浏览文件 @
5df9a9d4
...
...
@@ -522,7 +522,7 @@ BC30518: Overload resolution failed because no accessible 'P1' can be called wit
Dim
fileName
=
"a.vb"
Dim
syntaxTree
=
Parse
(
sourceCode
,
fileName
,
options
:
=
Nothing
)
Dim
compilation
=
Create
CompilationWithMscorlib45AndVBRuntime
({
syntaxTree
},
DefaultVbReferences
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
}))
Dim
compilation
=
Create
EmptyCompilation
({
syntaxTree
},
DefaultVbReferences
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
}))
Dim
tree
=
(
From
t
In
compilation
.
SyntaxTrees
Where
t
.
FilePath
=
fileName
).
Single
()
Dim
model
=
compilation
.
GetSemanticModel
(
tree
)
...
...
@@ -537,7 +537,7 @@ BC30518: Overload resolution failed because no accessible 'P1' can be called wit
Dim
fileName
=
"a.vb"
Dim
syntaxTree
=
Parse
(
sourceCode
,
fileName
,
options
:
=
Nothing
)
Dim
compilation
=
Create
CompilationWithMscorlib45AndVBRuntime
({
syntaxTree
},
DefaultVbReferences
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
}))
Dim
compilation
=
Create
EmptyCompilation
({
syntaxTree
},
DefaultVbReferences
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
}))
Dim
tree
=
(
From
t
In
compilation
.
SyntaxTrees
Where
t
.
FilePath
=
fileName
).
Single
()
Dim
model
=
compilation
.
GetSemanticModel
(
tree
)
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IArgument.vb
浏览文件 @
5df9a9d4
...
...
@@ -1077,7 +1077,7 @@ End Class]]>.Value
Dim
fileName
=
"a.vb"
Dim
syntaxTree
=
Parse
(
source
,
fileName
,
options
:
=
Nothing
)
Dim
compilation
=
Create
CompilationWithMscorlib45AndVBRuntime
({
syntaxTree
},
DefaultVbReferences
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
}))
Dim
compilation
=
Create
EmptyCompilation
({
syntaxTree
},
DefaultVbReferences
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
}))
Dim
result
=
GetOperationAndSyntaxForTest
(
Of
InvocationExpressionSyntax
)(
compilation
,
fileName
)
Dim
expectedInKind
=
ConversionKind
.
Widening
Or
ConversionKind
.
UserDefined
...
...
@@ -1131,7 +1131,7 @@ End Class]]>.Value
Dim
fileName
=
"a.vb"
Dim
syntaxTree
=
Parse
(
source
,
fileName
,
options
:
=
Nothing
)
Dim
compilation
=
Create
CompilationWithMscorlib45AndVBRuntime
({
syntaxTree
},
DefaultVbReferences
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
}))
Dim
compilation
=
Create
EmptyCompilation
({
syntaxTree
},
DefaultVbReferences
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
}))
Dim
tree
=
(
From
t
In
compilation
.
SyntaxTrees
Where
t
.
FilePath
=
fileName
).
Single
()
Dim
model
=
compilation
.
GetSemanticModel
(
tree
)
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IBinaryOperatorExpression.vb
浏览文件 @
5df9a9d4
...
...
@@ -993,7 +993,7 @@ IBlockOperation (26 statements, 3 locals) (OperationKind.Block, Type: null) (Syn
Dim
fileName
=
"a.vb"
Dim
syntaxTree
=
Parse
(
source
,
fileName
)
Dim
references
=
DefaultVbReferences
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
})
Dim
compilation
=
Create
CompilationWithMscorlib45AndVBRuntime
({
syntaxTree
},
references
:
=
references
,
options
:
=
TestOptions
.
ReleaseDll
.
WithOverflowChecks
(
False
))
Dim
compilation
=
Create
EmptyCompilation
({
syntaxTree
},
references
:
=
references
,
options
:
=
TestOptions
.
ReleaseDll
.
WithOverflowChecks
(
False
))
VerifyOperationTreeAndDiagnosticsForTest
(
Of
MethodBlockSyntax
)(
compilation
,
fileName
,
expectedOperationTree
,
expectedDiagnostics
)
End
Sub
...
...
@@ -1442,7 +1442,7 @@ IBlockOperation (12 statements, 2 locals) (OperationKind.Block, Type: null) (Syn
Dim
fileName
=
"a.vb"
Dim
syntaxTree
=
Parse
(
source
,
fileName
)
Dim
references
=
DefaultVbReferences
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
})
Dim
compilation
=
Create
CompilationWithMscorlib45AndVBRuntime
({
syntaxTree
},
references
:
=
references
,
options
:
=
TestOptions
.
ReleaseDll
.
WithOverflowChecks
(
False
))
Dim
compilation
=
Create
EmptyCompilation
({
syntaxTree
},
references
:
=
references
,
options
:
=
TestOptions
.
ReleaseDll
.
WithOverflowChecks
(
False
))
VerifyOperationTreeAndDiagnosticsForTest
(
Of
MethodBlockSyntax
)(
compilation
,
fileName
,
expectedOperationTree
,
expectedDiagnostics
)
End
Sub
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IUnaryOperatorExpression.vb
浏览文件 @
5df9a9d4
...
...
@@ -2131,7 +2131,7 @@ IUnaryOperation (UnaryOperatorKind.Minus, IsLifted) (OperationKind.UnaryOperator
Dim
fileName
=
"a.vb"
Dim
syntaxTree
=
Parse
(
source
,
fileName
)
Dim
references
=
DefaultVbReferences
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
})
Dim
compilation
=
Create
CompilationWithMscorlib45AndVBRuntime
({
syntaxTree
},
references
:
=
references
,
options
:
=
TestOptions
.
ReleaseDll
.
WithOverflowChecks
(
False
))
Dim
compilation
=
Create
EmptyCompilation
({
syntaxTree
},
references
:
=
references
,
options
:
=
TestOptions
.
ReleaseDll
.
WithOverflowChecks
(
False
))
VerifyOperationTreeAndDiagnosticsForTest
(
Of
UnaryExpressionSyntax
)(
compilation
,
fileName
,
expectedOperationTree
,
expectedDiagnostics
)
End
Sub
...
...
@@ -2158,7 +2158,7 @@ IUnaryOperation (UnaryOperatorKind.Minus) (OperationKind.UnaryOperator, Type: Sy
Dim
fileName
=
"a.vb"
Dim
syntaxTree
=
Parse
(
source
,
fileName
)
Dim
references
=
DefaultVbReferences
.
Concat
({
ValueTupleRef
,
SystemRuntimeFacadeRef
})
Dim
compilation
=
Create
CompilationWithMscorlib45AndVBRuntime
({
syntaxTree
},
references
:
=
references
,
options
:
=
TestOptions
.
ReleaseDll
.
WithOverflowChecks
(
False
))
Dim
compilation
=
Create
EmptyCompilation
({
syntaxTree
},
references
:
=
references
,
options
:
=
TestOptions
.
ReleaseDll
.
WithOverflowChecks
(
False
))
VerifyOperationTreeAndDiagnosticsForTest
(
Of
UnaryExpressionSyntax
)(
compilation
,
fileName
,
expectedOperationTree
,
expectedDiagnostics
)
End
Sub
...
...
src/Compilers/VisualBasic/Test/Semantic/Semantics/ScriptSemanticsTests.vb
浏览文件 @
5df9a9d4
...
...
@@ -38,7 +38,7 @@ F(Function()
Dim
code
=
"System.Console.WriteLine(1)"
Dim
compilationUnit
=
VisualBasic
.
SyntaxFactory
.
ParseCompilationUnit
(
code
,
options
:
=
New
VisualBasicParseOptions
(
kind
:
=
SourceCodeKind
.
Script
))
Dim
syntaxTree
=
compilationUnit
.
SyntaxTree
Dim
compilation
=
CreateCompilationWithMscorlib45
({
syntaxTree
},
assemblyName
:
=
"Errors_01"
)
Dim
compilation
=
CreateCompilationWithMscorlib45
({
syntaxTree
},
assemblyName
:
=
"Errors_01"
,
options
:
=
TestOptions
.
ReleaseExe
)
Dim
semanticModel
=
compilation
.
GetSemanticModel
(
syntaxTree
,
True
)
Dim
node5
As
MemberAccessExpressionSyntax
=
ErrorTestsGetNode
(
syntaxTree
)
Assert
.
Equal
(
"WriteLine"
,
node5
.
Name
.
ToString
())
...
...
@@ -69,7 +69,7 @@ System.Console.WriteLine(1)
)
syntaxTree
=
SyntaxFactory
.
ParseSyntaxTree
(
code
,
options
:
=
New
VisualBasicParseOptions
(
kind
:
=
SourceCodeKind
.
Script
))
compilation
=
CreateCompilationWithMscorlib45AndVBRuntime
({
syntaxTree
})
compilation
=
CreateCompilationWithMscorlib45AndVBRuntime
({
syntaxTree
}
,
options
:
=
TestOptions
.
ReleaseExe
)
semanticModel
=
compilation
.
GetSemanticModel
(
syntaxTree
,
True
)
node5
=
ErrorTestsGetNode
(
syntaxTree
)
Assert
.
Equal
(
"WriteLine"
,
node5
.
Name
.
ToString
())
...
...
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/WinMdTests.vb
浏览文件 @
5df9a9d4
...
...
@@ -116,7 +116,7 @@ End Class"
Shared Sub M(a As LibraryA.A, b As LibraryB.B, t As Windows.Data.Text.TextSegment, f As Windows.Storage.StorageFolder)
End Sub
End Class"
Dim
c0
=
Create
CompilationWithMscorlib40
({
source
},
compileReferences
,
TestOptions
.
DebugDll
)
Dim
c0
=
Create
EmptyCompilation
({
source
},
compileReferences
,
TestOptions
.
DebugDll
)
WithRuntimeInstance
(
c0
,
runtimeReferences
,
Sub
(
runtime
)
Dim
context
=
CreateMethodContext
(
runtime
,
"C.M"
)
...
...
src/Test/Utilities/Portable/TargetFrameworkUtil.cs
浏览文件 @
5df9a9d4
...
...
@@ -67,8 +67,8 @@ public static class TargetFrameworkUtil
public
static
ImmutableArray
<
MetadataReference
>
Mscorlib40andSystemCoreReferences
=>
ImmutableArray
.
Create
(
TestBase
.
MscorlibRef
,
TestBase
.
SystemCoreRef
);
public
static
ImmutableArray
<
MetadataReference
>
Mscorlib40andVBRuntimeReferences
=>
ImmutableArray
.
Create
(
TestBase
.
MscorlibRef
,
TestBase
.
SystemRef
,
TestBase
.
MsvbRef
);
public
static
ImmutableArray
<
MetadataReference
>
Mscorlib45References
=>
ImmutableArray
.
Create
(
TestBase
.
MscorlibRef_v4_0_30316_17626
);
public
static
ImmutableArray
<
MetadataReference
>
Mscorlib45ExtendedReferences
=>
ImmutableArray
.
Create
(
TestBase
.
MscorlibRef_v4_0_30316_17626
,
TestBase
.
SystemRef
,
TestBase
.
SystemCoreRef
,
TestBase
.
ValueTupleRef
,
TestBase
.
SystemRuntimeFacadeRef
);
public
static
ImmutableArray
<
MetadataReference
>
Mscorlib45AndCSharpReferences
=>
ImmutableArray
.
Create
(
TestBase
.
MscorlibRef_v4_0_30316_17626
,
TestBase
.
SystemCoreRef
,
TestBase
.
CSharpRef
);
public
static
ImmutableArray
<
MetadataReference
>
Mscorlib45ExtendedReferences
=>
ImmutableArray
.
Create
(
TestBase
.
MscorlibRef_v4_0_30316_17626
,
TestBase
.
SystemRef
,
TestBase
.
SystemCoreRef
_v4_0_30319_17929
,
TestBase
.
ValueTupleRef
,
TestBase
.
SystemRuntimeFacadeRef
);
public
static
ImmutableArray
<
MetadataReference
>
Mscorlib45AndCSharpReferences
=>
ImmutableArray
.
Create
(
TestBase
.
MscorlibRef_v4_0_30316_17626
,
TestBase
.
SystemCoreRef
_v4_0_30319_17929
,
TestBase
.
CSharpRef
);
public
static
ImmutableArray
<
MetadataReference
>
Mscorlib45AndVBRuntimeReferences
=>
ImmutableArray
.
Create
(
TestBase
.
MscorlibRef_v4_0_30316_17626
,
TestBase
.
SystemRef
,
TestBase
.
MsvbRef_v4_0_30319_17929
);
public
static
ImmutableArray
<
MetadataReference
>
Mscorlib46References
=>
ImmutableArray
.
Create
(
TestBase
.
MscorlibRef_v46
);
public
static
ImmutableArray
<
MetadataReference
>
Mscorlib46ExtendedReferences
=>
ImmutableArray
.
Create
(
TestBase
.
MscorlibRef_v46
,
TestBase
.
SystemRef_v46
,
TestBase
.
SystemCoreRef_v46
,
TestBase
.
ValueTupleRef
,
TestBase
.
SystemRuntimeFacadeRef
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录