Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
ceed8eb8
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ceed8eb8
编写于
5月 16, 2018
作者:
O
Oliver Schneider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make `bless` a flag instead of a subcommand
上级
37dee69d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
22 deletion
+11
-22
src/bootstrap/builder.rs
src/bootstrap/builder.rs
+0
-5
src/bootstrap/flags.rs
src/bootstrap/flags.rs
+10
-10
src/bootstrap/test.rs
src/bootstrap/test.rs
+1
-7
未找到文件。
src/bootstrap/builder.rs
浏览文件 @
ceed8eb8
...
...
@@ -311,8 +311,6 @@ fn pathset_for_path(&self, path: &Path) -> Option<&PathSet> {
pub
enum
Kind
{
Build
,
Check
,
/// Run tests and replace any failing tests' output files (stderr/stout) with the correct ones
Bless
,
Test
,
Bench
,
Dist
,
...
...
@@ -336,7 +334,6 @@ fn get_step_descriptions(kind: Kind) -> Vec<StepDescription> {
native
::
Llvm
,
tool
::
Rustfmt
,
tool
::
Miri
,
native
::
Lld
),
Kind
::
Check
=>
describe!
(
check
::
Std
,
check
::
Test
,
check
::
Rustc
,
check
::
CodegenBackend
,
check
::
Rustdoc
),
Kind
::
Bless
|
Kind
::
Test
=>
describe!
(
test
::
Tidy
,
test
::
Bootstrap
,
test
::
Ui
,
test
::
RunPass
,
test
::
CompileFail
,
test
::
ParseFail
,
test
::
RunFail
,
test
::
RunPassValgrind
,
test
::
MirOpt
,
test
::
Codegen
,
test
::
CodegenUnits
,
test
::
Incremental
,
test
::
Debuginfo
,
...
...
@@ -370,7 +367,6 @@ pub fn get_help(build: &Build, subcommand: &str) -> Option<String> {
let
kind
=
match
subcommand
{
"build"
=>
Kind
::
Build
,
"doc"
=>
Kind
::
Doc
,
"bless"
=>
Kind
::
Bless
,
"test"
=>
Kind
::
Test
,
"bench"
=>
Kind
::
Bench
,
"dist"
=>
Kind
::
Dist
,
...
...
@@ -412,7 +408,6 @@ pub fn new(build: &Build) -> Builder {
Subcommand
::
Build
{
ref
paths
}
=>
(
Kind
::
Build
,
&
paths
[
..
]),
Subcommand
::
Check
{
ref
paths
}
=>
(
Kind
::
Check
,
&
paths
[
..
]),
Subcommand
::
Doc
{
ref
paths
}
=>
(
Kind
::
Doc
,
&
paths
[
..
]),
Subcommand
::
Test
{
ref
paths
,
bless
:
true
,
..
}
=>
(
Kind
::
Bless
,
&
paths
[
..
]),
Subcommand
::
Test
{
ref
paths
,
..
}
=>
(
Kind
::
Test
,
&
paths
[
..
]),
Subcommand
::
Bench
{
ref
paths
,
..
}
=>
(
Kind
::
Bench
,
&
paths
[
..
]),
Subcommand
::
Dist
{
ref
paths
}
=>
(
Kind
::
Dist
,
&
paths
[
..
]),
...
...
src/bootstrap/flags.rs
浏览文件 @
ceed8eb8
...
...
@@ -144,7 +144,6 @@ pub fn parse(args: &[String]) -> Flags {
let
subcommand
=
args
.iter
()
.find
(|
&
s
|
(
s
==
"build"
)
||
(
s
==
"check"
)
||
(
s
==
"bless"
)
||
(
s
==
"test"
)
||
(
s
==
"bench"
)
||
(
s
==
"doc"
)
...
...
@@ -165,7 +164,6 @@ pub fn parse(args: &[String]) -> Flags {
// Some subcommands get extra options
match
subcommand
.as_str
()
{
"bless"
|
"test"
=>
{
opts
.optflag
(
""
,
"no-fail-fast"
,
"Run all tests regardless of failure"
);
opts
.optmulti
(
""
,
"test-args"
,
"extra arguments"
,
"ARGS"
);
...
...
@@ -177,6 +175,7 @@ pub fn parse(args: &[String]) -> Flags {
);
opts
.optflag
(
""
,
"no-doc"
,
"do not run doc tests"
);
opts
.optflag
(
""
,
"doc"
,
"only run doc tests"
);
opts
.optflag
(
""
,
"bless"
,
"update all stderr/stdout files of failing ui tests"
);
},
"bench"
=>
{
opts
.optmulti
(
""
,
"test-args"
,
"extra arguments"
,
"ARGS"
);
},
"clean"
=>
{
opts
.optflag
(
""
,
"all"
,
"clean all build artifacts"
);
},
...
...
@@ -252,12 +251,6 @@ pub fn parse(args: &[String]) -> Flags {
compilation, so there's no need to pass it separately, though it won't hurt. We also completely
ignore the stage passed, as there's no way to compile in non-stage 0 without actually building
the compiler."
);
}
"bless"
=>
{
subcommand_help
.push_str
(
"
\n
Arguments:
This subcommand works exactly like the `test` subcommand, but also updates stderr/stdout files
before they cause a test failure"
);
}
"test"
=>
{
subcommand_help
.push_str
(
"
\n
...
...
@@ -268,6 +261,7 @@ pub fn parse(args: &[String]) -> Flags {
./x.py test src/test/run-pass
./x.py test src/libstd --test-args hash_map
./x.py test src/libstd --stage 0
./x.py test src/test/ui --bless
If no arguments are passed then the complete artifacts for that stage are
compiled and tested.
...
...
@@ -329,11 +323,10 @@ pub fn parse(args: &[String]) -> Flags {
"check"
=>
{
Subcommand
::
Check
{
paths
:
paths
}
}
"bless"
|
"test"
=>
{
Subcommand
::
Test
{
paths
,
bless
:
subcommand
.as_str
()
==
"bless"
,
bless
:
matches
.opt_present
(
"bless"
)
,
test_args
:
matches
.opt_strs
(
"test-args"
),
rustc_args
:
matches
.opt_strs
(
"rustc-args"
),
fail_fast
:
!
matches
.opt_present
(
"no-fail-fast"
),
...
...
@@ -436,6 +429,13 @@ pub fn doc_tests(&self) -> DocTests {
_
=>
DocTests
::
Yes
,
}
}
pub
fn
bless
(
&
self
)
->
bool
{
match
*
self
{
Subcommand
::
Test
{
bless
,
..
}
=>
bless
,
_
=>
false
,
}
}
}
fn
split
(
s
:
Vec
<
String
>
)
->
Vec
<
String
>
{
...
...
src/bootstrap/test.rs
浏览文件 @
ceed8eb8
...
...
@@ -41,8 +41,6 @@
/// The two modes of the test runner; tests or benchmarks.
#[derive(Debug,
PartialEq,
Eq,
Hash,
Copy,
Clone,
PartialOrd,
Ord)]
pub
enum
TestKind
{
/// Run `cargo bless`
Bless
,
/// Run `cargo test`
Test
,
/// Run `cargo bench`
...
...
@@ -53,7 +51,6 @@ impl From<Kind> for TestKind {
fn
from
(
kind
:
Kind
)
->
Self
{
match
kind
{
Kind
::
Test
=>
TestKind
::
Test
,
Kind
::
Bless
=>
TestKind
::
Bless
,
Kind
::
Bench
=>
TestKind
::
Bench
,
_
=>
panic!
(
"unexpected kind in crate: {:?}"
,
kind
)
}
...
...
@@ -64,8 +61,6 @@ impl TestKind {
// Return the cargo subcommand for this test kind
fn
subcommand
(
self
)
->
&
'static
str
{
match
self
{
// bless and test are both `test` for folder names and cargo subcommands
TestKind
::
Bless
|
TestKind
::
Test
=>
"test"
,
TestKind
::
Bench
=>
"bench"
,
}
...
...
@@ -75,7 +70,6 @@ fn subcommand(self) -> &'static str {
impl
fmt
::
Display
for
TestKind
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
f
.write_str
(
match
*
self
{
TestKind
::
Bless
=>
"Testing (bless)"
,
TestKind
::
Test
=>
"Testing"
,
TestKind
::
Bench
=>
"Benchmarking"
,
})
...
...
@@ -967,7 +961,7 @@ fn run(self, builder: &Builder) {
cmd
.arg
(
"--host"
)
.arg
(
&*
compiler
.host
);
cmd
.arg
(
"--llvm-filecheck"
)
.arg
(
builder
.llvm_filecheck
(
builder
.config.build
));
if
builder
.
kind
==
Kind
::
Bless
{
if
builder
.
config.cmd
.bless
()
{
cmd
.arg
(
"--bless"
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录