Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
b2192ae1
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,发现更多精彩内容 >>
提交
b2192ae1
编写于
4月 01, 2018
作者:
G
Guillaume Gomez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add rustdoc-ui test suite
上级
a6fefdec
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
85 addition
and
34 deletion
+85
-34
src/bootstrap/builder.rs
src/bootstrap/builder.rs
+1
-1
src/bootstrap/test.rs
src/bootstrap/test.rs
+21
-7
src/librustdoc/html/render.rs
src/librustdoc/html/render.rs
+1
-1
src/libstd/lib.rs
src/libstd/lib.rs
+2
-2
src/libtest/lib.rs
src/libtest/lib.rs
+0
-1
src/test/rustdoc-ui/intra-links-warning.rs
src/test/rustdoc-ui/intra-links-warning.rs
+19
-0
src/test/rustdoc-ui/intra-links-warning.stderr
src/test/rustdoc-ui/intra-links-warning.stderr
+6
-0
src/tools/compiletest/src/main.rs
src/tools/compiletest/src/main.rs
+4
-2
src/tools/compiletest/src/runtest.rs
src/tools/compiletest/src/runtest.rs
+31
-20
未找到文件。
src/bootstrap/builder.rs
浏览文件 @
b2192ae1
...
...
@@ -326,7 +326,7 @@ fn get_step_descriptions(kind: Kind) -> Vec<StepDescription> {
test
::
TheBook
,
test
::
UnstableBook
,
test
::
Rustfmt
,
test
::
Miri
,
test
::
Clippy
,
test
::
RustdocJS
,
test
::
RustdocTheme
,
// Run run-make last, since these won't pass without make on Windows
test
::
RunMake
),
test
::
RunMake
,
test
::
RustdocUi
),
Kind
::
Bench
=>
describe!
(
test
::
Crate
,
test
::
CrateLibrustc
),
Kind
::
Doc
=>
describe!
(
doc
::
UnstableBook
,
doc
::
UnstableBookGen
,
doc
::
TheBook
,
doc
::
Standalone
,
doc
::
Std
,
doc
::
Test
,
doc
::
WhitelistedRustc
,
doc
::
Rustc
,
...
...
src/bootstrap/test.rs
浏览文件 @
b2192ae1
...
...
@@ -886,8 +886,12 @@ fn run(self, builder: &Builder) {
cmd
.arg
(
"--run-lib-path"
)
.arg
(
builder
.sysroot_libdir
(
compiler
,
target
));
cmd
.arg
(
"--rustc-path"
)
.arg
(
builder
.rustc
(
compiler
));
let
is_rustdoc_ui
=
suite
.ends_with
(
"rustdoc-ui"
);
// Avoid depending on rustdoc when we don't need it.
if
mode
==
"rustdoc"
||
(
mode
==
"run-make"
&&
suite
.ends_with
(
"fulldeps"
))
{
if
mode
==
"rustdoc"
||
(
mode
==
"run-make"
&&
suite
.ends_with
(
"fulldeps"
))
||
(
mode
==
"ui"
&&
is_rustdoc_ui
)
{
cmd
.arg
(
"--rustdoc-path"
)
.arg
(
builder
.rustdoc
(
compiler
.host
));
}
...
...
@@ -903,14 +907,24 @@ fn run(self, builder: &Builder) {
cmd
.arg
(
"--nodejs"
)
.arg
(
nodejs
);
}
let
mut
flags
=
vec!
[
"-Crpath"
.to_string
()];
if
build
.config.rust_optimize_tests
{
flags
.push
(
"-O"
.to_string
());
let
mut
flags
=
if
is_rustdoc_ui
{
Vec
::
new
()
}
else
{
vec!
[
"-Crpath"
.to_string
()]
};
if
!
is_rustdoc_ui
{
if
build
.config.rust_optimize_tests
{
flags
.push
(
"-O"
.to_string
());
}
if
build
.config.rust_debuginfo_tests
{
flags
.push
(
"-g"
.to_string
());
}
}
if
build
.config.rust_debuginfo_tests
{
flags
.push
(
"-g"
.to_string
());
if
!
is_rustdoc_ui
{
flags
.push
(
"-Zmiri -Zunstable-options"
.to_string
());
}
else
{
flags
.push
(
"-Zunstable-options"
.to_string
());
}
flags
.push
(
"-Zunstable-options"
.to_string
());
flags
.push
(
build
.config.cmd
.rustc_args
()
.join
(
" "
));
if
let
Some
(
linker
)
=
build
.linker
(
target
)
{
...
...
src/librustdoc/html/render.rs
浏览文件 @
b2192ae1
...
...
@@ -107,7 +107,7 @@ pub struct SharedContext {
/// This describes the layout of each page, and is not modified after
/// creation of the context (contains info like the favicon and added html).
pub
layout
:
layout
::
Layout
,
/// This flag indicates whether
[src]
links should be generated or not. If
/// This flag indicates whether
`[src]`
links should be generated or not. If
/// the source files are present in the html rendering, then this will be
/// `true`.
pub
include_sources
:
bool
,
...
...
src/libstd/lib.rs
浏览文件 @
b2192ae1
...
...
@@ -44,10 +44,10 @@
//!
//! Once you are familiar with the contents of the standard library you may
//! begin to find the verbosity of the prose distracting. At this stage in your
//! development you may want to press the
**[-]**
button near the top of the
//! development you may want to press the
`[-]`
button near the top of the
//! page to collapse it into a more skimmable view.
//!
//! While you are looking at that
**[-]** button also notice the **[src]**
//! While you are looking at that
`[-]` button also notice the `[src]`
//! button. Rust's API documentation comes with the source code and you are
//! encouraged to read it. The standard library source is generally high
//! quality and a peek behind the curtains is often enlightening.
...
...
src/libtest/lib.rs
浏览文件 @
b2192ae1
...
...
@@ -1288,7 +1288,6 @@ fn num_cpus() -> usize {
pub
fn
filter_tests
(
opts
:
&
TestOpts
,
tests
:
Vec
<
TestDescAndFn
>
)
->
Vec
<
TestDescAndFn
>
{
let
mut
filtered
=
tests
;
// Remove tests that don't match the test filter
filtered
=
match
opts
.filter
{
None
=>
filtered
,
...
...
src/test/rustdoc-ui/intra-links-warning.rs
0 → 100644
浏览文件 @
b2192ae1
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(warnings)]
// must-compile-successfully
//! Test with [Foo::baz], [Bar::foo], [Uniooon::X]
pub
struct
Foo
{
pub
bar
:
usize
,
}
src/test/rustdoc-ui/intra-links-warning.stderr
0 → 100644
浏览文件 @
b2192ae1
warning: [Foo::baz] cannot be resolved, ignoring it...
warning: [Bar::foo] cannot be resolved, ignoring it...
warning: [Uniooon::X] cannot be resolved, ignoring it...
src/tools/compiletest/src/main.rs
浏览文件 @
b2192ae1
...
...
@@ -283,6 +283,8 @@ fn make_absolute(path: PathBuf) -> PathBuf {
),
};
let
src_base
=
opt_path
(
matches
,
"src-base"
);
let
run_ignored
=
matches
.opt_present
(
"ignored"
);
Config
{
compile_lib_path
:
make_absolute
(
opt_path
(
matches
,
"compile-lib-path"
)),
run_lib_path
:
make_absolute
(
opt_path
(
matches
,
"run-lib-path"
)),
...
...
@@ -293,7 +295,7 @@ fn make_absolute(path: PathBuf) -> PathBuf {
valgrind_path
:
matches
.opt_str
(
"valgrind-path"
),
force_valgrind
:
matches
.opt_present
(
"force-valgrind"
),
llvm_filecheck
:
matches
.opt_str
(
"llvm-filecheck"
)
.map
(|
s
|
PathBuf
::
from
(
&
s
)),
src_base
:
opt_path
(
matches
,
"src-base"
)
,
src_base
,
build_base
:
opt_path
(
matches
,
"build-base"
),
stage_id
:
matches
.opt_str
(
"stage-id"
)
.unwrap
(),
mode
:
matches
...
...
@@ -301,7 +303,7 @@ fn make_absolute(path: PathBuf) -> PathBuf {
.unwrap
()
.parse
()
.expect
(
"invalid mode"
),
run_ignored
:
matches
.opt_present
(
"ignored"
)
,
run_ignored
,
filter
:
matches
.free
.first
()
.cloned
(),
filter_exact
:
matches
.opt_present
(
"exact"
),
logfile
:
matches
.opt_str
(
"logfile"
)
.map
(|
s
|
PathBuf
::
from
(
&
s
)),
...
...
src/tools/compiletest/src/runtest.rs
浏览文件 @
b2192ae1
...
...
@@ -1288,7 +1288,9 @@ fn compile_test(&self) -> ProcRes {
// want to actually assert warnings about all this code. Instead
// let's just ignore unused code warnings by defaults and tests
// can turn it back on if needed.
rustc
.args
(
&
[
"-A"
,
"unused"
]);
if
!
self
.config.src_base
.ends_with
(
"rustdoc-ui"
)
{
rustc
.args
(
&
[
"-A"
,
"unused"
]);
}
}
_
=>
{}
}
...
...
@@ -1582,7 +1584,12 @@ fn compose_and_run(
}
fn
make_compile_args
(
&
self
,
input_file
:
&
Path
,
output_file
:
TargetLocation
)
->
Command
{
let
mut
rustc
=
Command
::
new
(
&
self
.config.rustc_path
);
let
is_rustdoc
=
self
.config.src_base
.ends_with
(
"rustdoc-ui"
);
let
mut
rustc
=
if
!
is_rustdoc
{
Command
::
new
(
&
self
.config.rustc_path
)
}
else
{
Command
::
new
(
&
self
.config.rustdoc_path
.clone
()
.expect
(
"no rustdoc built yet"
))
};
rustc
.arg
(
input_file
)
.arg
(
"-L"
)
.arg
(
&
self
.config.build_base
);
// Optionally prevent default --target if specified in test compile-flags.
...
...
@@ -1605,17 +1612,19 @@ fn make_compile_args(&self, input_file: &Path, output_file: TargetLocation) -> C
rustc
.args
(
&
[
"--cfg"
,
revision
]);
}
if
let
Some
(
ref
incremental_dir
)
=
self
.props.incremental_dir
{
rustc
.args
(
&
[
"-C"
,
&
format!
(
"incremental={}"
,
incremental_dir
.display
()),
]);
rustc
.args
(
&
[
"-Z"
,
"incremental-verify-ich"
]);
rustc
.args
(
&
[
"-Z"
,
"incremental-queries"
]);
}
if
!
is_rustdoc
{
if
let
Some
(
ref
incremental_dir
)
=
self
.props.incremental_dir
{
rustc
.args
(
&
[
"-C"
,
&
format!
(
"incremental={}"
,
incremental_dir
.display
()),
]);
rustc
.args
(
&
[
"-Z"
,
"incremental-verify-ich"
]);
rustc
.args
(
&
[
"-Z"
,
"incremental-queries"
]);
}
if
self
.config.mode
==
CodegenUnits
{
rustc
.args
(
&
[
"-Z"
,
"human_readable_cgu_names"
]);
if
self
.config.mode
==
CodegenUnits
{
rustc
.args
(
&
[
"-Z"
,
"human_readable_cgu_names"
]);
}
}
match
self
.config.mode
{
...
...
@@ -1668,11 +1677,12 @@ fn make_compile_args(&self, input_file: &Path, output_file: TargetLocation) -> C
}
}
if
self
.config.target
==
"wasm32-unknown-unknown"
{
// rustc.arg("-g"); // get any backtrace at all on errors
}
else
if
!
self
.props.no_prefer_dynamic
{
rustc
.args
(
&
[
"-C"
,
"prefer-dynamic"
]);
if
!
is_rustdoc
{
if
self
.config.target
==
"wasm32-unknown-unknown"
{
// rustc.arg("-g"); // get any backtrace at all on errors
}
else
if
!
self
.props.no_prefer_dynamic
{
rustc
.args
(
&
[
"-C"
,
"prefer-dynamic"
]);
}
}
match
output_file
{
...
...
@@ -1696,8 +1706,10 @@ fn make_compile_args(&self, input_file: &Path, output_file: TargetLocation) -> C
}
else
{
rustc
.args
(
self
.split_maybe_args
(
&
self
.config.target_rustcflags
));
}
if
let
Some
(
ref
linker
)
=
self
.config.linker
{
rustc
.arg
(
format!
(
"-Clinker={}"
,
linker
));
if
!
is_rustdoc
{
if
let
Some
(
ref
linker
)
=
self
.config.linker
{
rustc
.arg
(
format!
(
"-Clinker={}"
,
linker
));
}
}
rustc
.args
(
&
self
.props.compile_flags
);
...
...
@@ -2509,7 +2521,6 @@ fn run_ui_test(&self) {
.compile_flags
.iter
()
.any
(|
s
|
s
.contains
(
"--error-format"
));
let
proc_res
=
self
.compile_test
();
self
.check_if_test_should_compile
(
&
proc_res
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录