Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
0021a8d6
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,发现更多精彩内容 >>
未验证
提交
0021a8d6
编写于
10月 04, 2018
作者:
J
Jared Parsons
提交者:
GitHub
10月 04, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #30305 from jaredpar/fix-scripting
Enable C# scripting on Mono
上级
e0885364
46589cbe
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
30 addition
and
31 deletion
+30
-31
build/scripts/tests.sh
build/scripts/tests.sh
+0
-1
src/Scripting/CSharpTest/CommandLineRunnerTests.cs
src/Scripting/CSharpTest/CommandLineRunnerTests.cs
+16
-16
src/Scripting/CSharpTest/InteractiveSessionTests.cs
src/Scripting/CSharpTest/InteractiveSessionTests.cs
+4
-4
src/Scripting/CSharpTest/ObjectFormatterTests.cs
src/Scripting/CSharpTest/ObjectFormatterTests.cs
+3
-3
src/Scripting/CSharpTest/ScriptTests.cs
src/Scripting/CSharpTest/ScriptTests.cs
+7
-7
未找到文件。
build/scripts/tests.sh
浏览文件 @
0021a8d6
...
...
@@ -45,7 +45,6 @@ if [[ "${runtime}" == "dotnet" ]]; then
elif
[[
"
${
runtime
}
"
=
~ ^
(
mono|mono-debug
)
$
]]
;
then
file_list
=(
"
${
unittest_dir
}
"
/
*
/net46/
*
.UnitTests.dll
)
file_skiplist
=(
'Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests.dll'
# Omitted because we appear to be missing things necessary to compile vb.net.
# See https://github.com/mono/mono/issues/10679
'Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests.dll'
...
...
src/Scripting/CSharpTest/CommandLineRunnerTests.cs
浏览文件 @
0021a8d6
...
...
@@ -104,7 +104,7 @@ private static IEnumerable<string> GetReferences()
return
new
CommandLineRunner
(
io
,
compiler
,
CSharpScriptCompiler
.
Instance
,
CSharpObjectFormatter
.
Instance
);
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
Await
()
{
var
runner
=
CreateRunner
(
input
:
...
...
@@ -206,7 +206,7 @@ > Math.PI
>"
,
runner
.
Console
.
Out
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
Void
()
{
var
runner
=
CreateRunner
(
input
:
...
...
@@ -238,7 +238,7 @@ public void Tuples()
> "
,
runner
.
Console
.
Out
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
Exception
()
{
var
runner
=
CreateRunner
(
input
:
...
...
@@ -266,7 +266,7 @@ > div(10, 0)
"
,
runner
.
Console
.
Error
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
ExceptionInGeneric
()
{
var
runner
=
CreateRunner
(
input
:
...
...
@@ -424,7 +424,7 @@ public void Args_Script3()
"
,
runner
.
Console
.
Out
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
Args_Script4
()
{
var
script
=
Temp
.
CreateFile
(
prefix
:
"@"
,
extension
:
".csx"
).
WriteAllText
(
"foreach (var arg in Args) Print(arg);"
);
...
...
@@ -441,7 +441,7 @@ public void Args_Script4()
"
,
runner
.
Console
.
Out
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
Args_Script5
()
{
var
dir
=
Temp
.
CreateDirectory
();
...
...
@@ -507,7 +507,7 @@ public void Version()
AssertEx
.
AssertEqualToleratingWhitespaceDifferences
(
$@"
{
s_compilerVersion
}
"
,
runner
.
Console
.
Out
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
Script_BadUsings
()
{
var
script
=
Temp
.
CreateFile
(
extension
:
".csx"
).
WriteAllText
(
"WriteLine(42);"
);
...
...
@@ -546,7 +546,7 @@ > nameof(Microsoft.CodeAnalysis)
runner
.
Console
.
Error
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
RelativePath
()
{
using
(
var
directory
=
new
DisposableDirectory
(
Temp
))
...
...
@@ -564,7 +564,7 @@ public void RelativePath()
}
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30289"
)
]
public
void
SourceSearchPaths1
()
{
var
main
=
Temp
.
CreateFile
(
extension
:
".csx"
).
WriteAllText
(
@"
...
...
@@ -632,7 +632,7 @@ public void ReferenceSearchPaths1()
"
,
runner
.
Console
.
Out
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
SourceSearchPaths_Change1
()
{
var
dir
=
Temp
.
CreateDirectory
();
...
...
@@ -668,7 +668,7 @@ > X
runner
.
Console
.
Error
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
ReferenceSearchPaths_Change1
()
{
var
dir
=
Temp
.
CreateDirectory
();
...
...
@@ -761,7 +761,7 @@ > X
"
,
runner
.
Console
.
Out
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
InitialScript_Error
()
{
var
reference
=
Temp
.
CreateFile
(
extension
:
".dll"
).
WriteAllBytes
(
TestResources
.
General
.
C1
);
...
...
@@ -803,7 +803,7 @@ public void HelpCommand()
> "
,
runner
.
Console
.
Out
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
SharedLibCopy_Different
()
{
string
libBaseName
=
"LibBase_"
+
Guid
.
NewGuid
();
...
...
@@ -872,7 +872,7 @@ public class Lib2
> "
,
runner
.
Console
.
Out
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
[
WorkItem
(
6580
,
"https://github.com/dotnet/roslyn/issues/6580"
)]
public
void
PreservingDeclarationsOnException
()
{
...
...
@@ -902,7 +902,7 @@ public void PreservingDeclarationsOnException()
runner
.
Console
.
Error
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
[
WorkItem
(
21327
,
"https://github.com/dotnet/roslyn/issues/21327"
)]
public
void
DefaultLiteral
()
{
...
...
@@ -920,7 +920,7 @@ public void DefaultLiteral()
> "
,
runner
.
Console
.
Out
.
ToString
());
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
[
WorkItem
(
21327
,
"https://github.com/dotnet/roslyn/issues/21327"
)]
public
void
InferredTupleNames
()
{
...
...
src/Scripting/CSharpTest/InteractiveSessionTests.cs
浏览文件 @
0021a8d6
...
...
@@ -1139,7 +1139,7 @@ public class C : I
Assert
.
NotNull
(
result
);
}
[
Fact
]
[
ConditionalFact
(
typeof
(
WindowsOnly
)),
WorkItem
(
15860
,
"https://github.com/dotnet/roslyn/issues/15860"
)
]
public
void
ReferenceDirective_RelativeToBaseParent
()
{
var
file
=
Temp
.
CreateFile
();
...
...
@@ -1546,7 +1546,7 @@ public void HostObjectInRootNamespace()
Assert
.
Equal
(
1
,
r1
.
Result
);
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
HostObjectAssemblyReference1
()
{
var
scriptCompilation
=
CSharpScript
.
Create
(
...
...
@@ -1602,7 +1602,7 @@ public void HostObjectAssemblyReference1()
}
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
HostObjectAssemblyReference2
()
{
var
scriptCompilation
=
CSharpScript
.
Create
(
...
...
@@ -1666,7 +1666,7 @@ public void HostObjectAssemblyReference2()
}
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30303"
)
]
public
void
HostObjectAssemblyReference3
()
{
string
source
=
$@"
...
...
src/Scripting/CSharpTest/ObjectFormatterTests.cs
浏览文件 @
0021a8d6
...
...
@@ -255,7 +255,7 @@ public void DebuggerProxy_DebuggerDisplayAndProxy()
);
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/mono/mono/issues/10816"
)
]
public
void
DebuggerProxy_Recursive
()
{
string
str
;
...
...
@@ -676,7 +676,7 @@ public void DebuggerProxy_FrameworkTypes_ReadOnlyCollection()
Assert
.
Equal
(
"ReadOnlyCollection<int>(3) { 1, 2, 3 }"
,
str
);
}
[
ConditionalFact
(
typeof
(
DesktopOnly
)
)]
[
ConditionalFact
(
typeof
(
WindowsDesktopOnly
),
Reason
=
ConditionalSkipReason
.
TestExecutionNeedsWindowsTypes
)]
public
void
DebuggerProxy_FrameworkTypes_Lazy
()
{
var
obj
=
new
Lazy
<
int
[
]>
(()
=>
new
int
[]
{
1
,
2
},
LazyThreadSafetyMode
.
None
);
...
...
@@ -712,7 +712,7 @@ private void TaskMethod()
{
}
[
Fact
]
[
ConditionalFact
(
typeof
(
ClrOnly
),
Reason
=
"https://github.com/mono/mono/issues/10838"
)
]
public
void
DebuggerProxy_FrameworkTypes_Task
()
{
var
obj
=
new
System
.
Threading
.
Tasks
.
Task
(
TaskMethod
);
...
...
src/Scripting/CSharpTest/ScriptTests.cs
浏览文件 @
0021a8d6
...
...
@@ -831,7 +831,7 @@ public async Task Pdb_CreateFromString_CodeFromFile_WithEmitDebugInformation_Wit
}
}
[
ConditionalFact
(
typeof
(
DesktopOnly
)
)]
[
ConditionalFact
(
typeof
(
WindowsDesktopOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30169"
)]
[
WorkItem
(
19027
,
"https://github.com/dotnet/roslyn/issues/19027"
)]
public
Task
Pdb_CreateFromString_CodeFromFile_WithEmitDebugInformation_WithFileEncoding_ResultInPdbEmitted
()
{
...
...
@@ -839,21 +839,21 @@ public Task Pdb_CreateFromString_CodeFromFile_WithEmitDebugInformation_WithFileE
return
VerifyStackTraceAsync
(()
=>
CSharpScript
.
Create
(
"throw new System.Exception();"
,
opts
),
line
:
1
,
column
:
1
,
filename
:
"debug.csx"
);
}
[
Fact
]
[
ConditionalFact
(
typeof
(
WindowsDesktopOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30169"
)
]
public
Task
Pdb_CreateFromString_CodeFromFile_WithoutEmitDebugInformation_WithoutFileEncoding_ResultInPdbNotEmitted
()
{
var
opts
=
ScriptOptions
.
Default
.
WithEmitDebugInformation
(
false
).
WithFilePath
(
null
).
WithFileEncoding
(
null
);
return
VerifyStackTraceAsync
(()
=>
CSharpScript
.
Create
(
"throw new System.Exception();"
,
opts
));
}
[
Fact
]
[
ConditionalFact
(
typeof
(
WindowsDesktopOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30169"
)
]
public
Task
Pdb_CreateFromString_CodeFromFile_WithoutEmitDebugInformation_WithFileEncoding_ResultInPdbNotEmitted
()
{
var
opts
=
ScriptOptions
.
Default
.
WithEmitDebugInformation
(
false
).
WithFilePath
(
"debug.csx"
).
WithFileEncoding
(
Encoding
.
UTF8
);
return
VerifyStackTraceAsync
(()
=>
CSharpScript
.
Create
(
"throw new System.Exception();"
,
opts
));
}
[
ConditionalFact
(
typeof
(
DesktopOnly
)
)]
[
ConditionalFact
(
typeof
(
WindowsDesktopOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30169"
)]
[
WorkItem
(
19027
,
"https://github.com/dotnet/roslyn/issues/19027"
)]
public
Task
Pdb_CreateFromStream_CodeFromFile_WithEmitDebugInformation_ResultInPdbEmitted
()
{
...
...
@@ -868,7 +868,7 @@ public Task Pdb_CreateFromStream_CodeFromFile_WithoutEmitDebugInformation_Result
return
VerifyStackTraceAsync
(()
=>
CSharpScript
.
Create
(
new
MemoryStream
(
Encoding
.
UTF8
.
GetBytes
(
"throw new System.Exception();"
)),
opts
));
}
[
ConditionalFact
(
typeof
(
DesktopOnly
)
)]
[
ConditionalFact
(
typeof
(
WindowsDesktopOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30169"
)]
[
WorkItem
(
19027
,
"https://github.com/dotnet/roslyn/issues/19027"
)]
public
Task
Pdb_CreateFromString_InlineCode_WithEmitDebugInformation_WithoutFileEncoding_ResultInPdbEmitted
()
{
...
...
@@ -876,7 +876,7 @@ public Task Pdb_CreateFromString_InlineCode_WithEmitDebugInformation_WithoutFile
return
VerifyStackTraceAsync
(()
=>
CSharpScript
.
Create
(
"throw new System.Exception();"
,
opts
),
line
:
1
,
column
:
1
,
filename
:
""
);
}
[
ConditionalFact
(
typeof
(
DesktopOnly
)
)]
[
ConditionalFact
(
typeof
(
WindowsDesktopOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30169"
)]
[
WorkItem
(
19027
,
"https://github.com/dotnet/roslyn/issues/19027"
)]
public
Task
Pdb_CreateFromString_InlineCode_WithEmitDebugInformation_WithFileEncoding_ResultInPdbEmitted
()
{
...
...
@@ -898,7 +898,7 @@ public Task Pdb_CreateFromString_InlineCode_WithoutEmitDebugInformation_WithFile
return
VerifyStackTraceAsync
(()
=>
CSharpScript
.
Create
(
"throw new System.Exception();"
,
opts
));
}
[
ConditionalFact
(
typeof
(
DesktopOnly
)
)]
[
ConditionalFact
(
typeof
(
WindowsDesktopOnly
),
Reason
=
"https://github.com/dotnet/roslyn/issues/30169"
)]
[
WorkItem
(
19027
,
"https://github.com/dotnet/roslyn/issues/19027"
)]
public
Task
Pdb_CreateFromStream_InlineCode_WithEmitDebugInformation_ResultInPdbEmitted
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录