Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
cf89264f
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,发现更多精彩内容 >>
提交
cf89264f
编写于
10月 07, 2015
作者:
T
Tomas Matousek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove ExitCode from the host object
上级
3b06d826
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
7 addition
and
22 deletion
+7
-22
src/Scripting/CSharpTest.Desktop/InteractiveSessionTests.cs
src/Scripting/CSharpTest.Desktop/InteractiveSessionTests.cs
+1
-0
src/Scripting/CSharpTest/CommandLineRunnerTests.cs
src/Scripting/CSharpTest/CommandLineRunnerTests.cs
+0
-11
src/Scripting/Core/Hosting/CommandLine/CommandLineRunner.cs
src/Scripting/Core/Hosting/CommandLine/CommandLineRunner.cs
+3
-1
src/Scripting/Core/Hosting/CommandLine/CommandLineScriptGlobals.cs
...ting/Core/Hosting/CommandLine/CommandLineScriptGlobals.cs
+0
-5
src/Scripting/Core/PublicAPI.Unshipped.txt
src/Scripting/Core/PublicAPI.Unshipped.txt
+0
-2
src/Scripting/CoreTest/ObjectFormatterTestBase.cs
src/Scripting/CoreTest/ObjectFormatterTestBase.cs
+3
-3
未找到文件。
src/Scripting/CSharpTest.Desktop/InteractiveSessionTests.cs
浏览文件 @
cf89264f
...
...
@@ -302,6 +302,7 @@ public async Task HostObjectBinding_DuplicateReferences()
{
typeof
(
object
).
GetTypeInfo
().
Assembly
.
Location
,
typeof
(
C
).
Assembly
.
Location
,
Assembly
.
Load
(
new
AssemblyName
(
"System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
)).
Location
,
// TODO: remove
typeof
(
C
).
Assembly
.
Location
,
typeof
(
C
).
Assembly
.
Location
,
},
s0
.
Script
.
GetCompilation
().
ExternalReferences
.
SelectAsArray
(
m
=>
m
.
Display
));
...
...
src/Scripting/CSharpTest/CommandLineRunnerTests.cs
浏览文件 @
cf89264f
...
...
@@ -108,17 +108,6 @@ public void Args()
> "
,
runner
.
Console
.
Out
.
ToString
());
}
[
Fact
]
public
void
Script_ExitCode
()
{
var
script
=
Temp
.
CreateFile
(
extension
:
".csx"
).
WriteAllText
(
"ExitCode = 42;"
);
var
runner
=
CreateRunner
(
new
[]
{
script
.
Path
});
Assert
.
Equal
(
42
,
runner
.
RunInteractive
());
Assert
.
Equal
(
""
,
runner
.
Console
.
Out
.
ToString
());
}
[
Fact
]
public
void
Script_NonExistingFile
()
{
...
...
src/Scripting/Core/Hosting/CommandLine/CommandLineRunner.cs
浏览文件 @
cf89264f
...
...
@@ -150,7 +150,9 @@ private int RunScript(ScriptOptions options, string code, string scriptPath, Err
try
{
script
.
RunAsync
(
globals
,
cancellationToken
).
Wait
();
return
globals
.
ExitCode
;
// TODO: use the return value of the script https://github.com/dotnet/roslyn/issues/5773
return
CommonCompiler
.
Succeeded
;
}
catch
(
CompilationErrorException
e
)
{
...
...
src/Scripting/Core/Hosting/CommandLine/CommandLineScriptGlobals.cs
浏览文件 @
cf89264f
...
...
@@ -33,11 +33,6 @@ public void Print(object value)
_outputWriter
.
WriteLine
(
_objectFormatter
.
FormatObject
(
value
,
PrintOptions
));
}
/// <summary>
/// Script exit code. Use a non-zero number to indicate an error.
/// </summary>
public
int
ExitCode
{
get
;
set
;
}
internal
ObjectFormattingOptions
PrintOptions
{
get
;
}
public
CommandLineScriptGlobals
(
TextWriter
outputWriter
,
ObjectFormatter
objectFormatter
)
...
...
src/Scripting/Core/PublicAPI.Unshipped.txt
浏览文件 @
cf89264f
...
...
@@ -3,8 +3,6 @@ Microsoft.CodeAnalysis.Scripting.CompilationErrorException.Diagnostics.get -> Sy
Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineScriptGlobals
Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineScriptGlobals.Args.get -> System.Collections.Generic.IList<string>
Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineScriptGlobals.CommandLineScriptGlobals(System.IO.TextWriter outputWriter, Microsoft.CodeAnalysis.Scripting.Hosting.ObjectFormatter objectFormatter) -> void
Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineScriptGlobals.ExitCode.get -> int
Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineScriptGlobals.ExitCode.set -> void
Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineScriptGlobals.Print(object value) -> void
Microsoft.CodeAnalysis.Scripting.Hosting.InteractiveAssemblyLoader
Microsoft.CodeAnalysis.Scripting.Hosting.InteractiveAssemblyLoader.Dispose() -> void
...
...
src/Scripting/CoreTest/ObjectFormatterTestBase.cs
浏览文件 @
cf89264f
...
...
@@ -8,9 +8,9 @@ namespace Microsoft.CodeAnalysis.Scripting.Hosting.UnitTests
{
public
abstract
class
ObjectFormatterTestBase
{
internal
static
readonly
ObjectFormattingOptions
s_hexa
=
new
ObjectFormattingOptions
(
useHexadecimalNumbers
:
true
);
internal
static
readonly
ObjectFormattingOptions
s_memberList
=
new
ObjectFormattingOptions
(
memberFormat
:
MemberDisplayFormat
.
List
);
internal
static
readonly
ObjectFormattingOptions
s_inline
=
new
ObjectFormattingOptions
(
memberFormat
:
MemberDisplayFormat
.
Inline
);
internal
static
readonly
ObjectFormattingOptions
s_hexa
=
new
ObjectFormattingOptions
(
useHexadecimalNumbers
:
true
,
maxOutputLength
:
int
.
MaxValue
);
internal
static
readonly
ObjectFormattingOptions
s_memberList
=
new
ObjectFormattingOptions
(
memberFormat
:
MemberDisplayFormat
.
List
,
maxOutputLength
:
int
.
MaxValue
);
internal
static
readonly
ObjectFormattingOptions
s_inline
=
new
ObjectFormattingOptions
(
memberFormat
:
MemberDisplayFormat
.
Inline
,
maxOutputLength
:
int
.
MaxValue
);
public
void
AssertMembers
(
string
str
,
params
string
[]
expected
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录