Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
a6cd7a2e
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,发现更多精彩内容 >>
提交
a6cd7a2e
编写于
6月 21, 2017
作者:
O
Oliver Schneider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Also move some compile-fail tests to fullmir-only
上级
b001b553
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
14 deletion
+24
-14
tests/compile-fail-fullmir/undefined_byte_read.rs
tests/compile-fail-fullmir/undefined_byte_read.rs
+0
-0
tests/compiletest.rs
tests/compiletest.rs
+24
-14
未找到文件。
tests/compile-fail/undefined_byte_read.rs
→
tests/compile-fail
-fullmir
/undefined_byte_read.rs
浏览文件 @
a6cd7a2e
文件已移动
tests/compiletest.rs
浏览文件 @
a6cd7a2e
...
...
@@ -3,19 +3,24 @@
use
std
::
path
::{
PathBuf
,
Path
};
use
std
::
io
::
Write
;
fn
compile_fail
(
sysroot
:
&
Path
)
{
let
flags
=
format!
(
"--sysroot {} -Dwarnings"
,
sysroot
.to_str
()
.expect
(
"non utf8 path"
));
for_all_targets
(
sysroot
,
|
target
|
{
let
mut
config
=
compiletest
::
default_config
();
config
.host_rustcflags
=
Some
(
flags
.clone
());
config
.mode
=
"compile-fail"
.parse
()
.expect
(
"Invalid mode"
);
config
.run_lib_path
=
Path
::
new
(
sysroot
)
.join
(
"lib"
)
.join
(
"rustlib"
)
.join
(
&
target
)
.join
(
"lib"
);
config
.rustc_path
=
"target/debug/miri"
.into
();
config
.src_base
=
PathBuf
::
from
(
"tests/compile-fail"
.to_string
());
config
.target
=
target
.to_owned
();
config
.target_rustcflags
=
Some
(
flags
.clone
());
compiletest
::
run_tests
(
&
config
);
});
fn
compile_fail
(
sysroot
:
&
Path
,
path
:
&
str
,
target
:
&
str
,
host
:
&
str
,
fullmir
:
bool
)
{
let
mut
config
=
compiletest
::
default_config
();
config
.mode
=
"compile-fail"
.parse
()
.expect
(
"Invalid mode"
);
config
.rustc_path
=
"target/debug/miri"
.into
();
if
fullmir
{
if
host
!=
target
{
// skip fullmir on nonhost
return
;
}
let
sysroot
=
Path
::
new
(
&
std
::
env
::
var
(
"HOME"
)
.unwrap
())
.join
(
".xargo"
)
.join
(
"HOST"
);
config
.target_rustcflags
=
Some
(
format!
(
"--sysroot {}"
,
sysroot
.to_str
()
.unwrap
()));
config
.src_base
=
PathBuf
::
from
(
path
.to_string
());
}
else
{
config
.target_rustcflags
=
Some
(
format!
(
"--sysroot {}"
,
sysroot
.to_str
()
.unwrap
()));
config
.src_base
=
PathBuf
::
from
(
path
.to_string
());
}
config
.target
=
target
.to_owned
();
compiletest
::
run_tests
(
&
config
);
}
fn
run_pass
()
{
...
...
@@ -35,6 +40,10 @@ fn miri_pass(path: &str, target: &str, host: &str, fullmir: bool) {
config
.host
=
host
.to_owned
();
config
.rustc_path
=
PathBuf
::
from
(
"target/debug/miri"
);
if
fullmir
{
if
host
!=
target
{
// skip fullmir on nonhost
return
;
}
let
sysroot
=
Path
::
new
(
&
std
::
env
::
var
(
"HOME"
)
.unwrap
())
.join
(
".xargo"
)
.join
(
"HOST"
);
config
.target_rustcflags
=
Some
(
format!
(
"--sysroot {}"
,
sysroot
.to_str
()
.unwrap
()));
}
...
...
@@ -203,9 +212,10 @@ fn compile_test() {
run_pass
();
for_all_targets
(
sysroot
,
|
target
|
{
miri_pass
(
"tests/run-pass"
,
&
target
,
host
,
false
);
compile_fail
(
sysroot
,
"tests/compile-fail"
,
&
target
,
host
,
false
);
});
miri_pass
(
"tests/run-pass-fullmir"
,
host
,
host
,
true
);
compile_fail
(
sysroot
);
compile_fail
(
sysroot
,
"tests/compile-fail-fullmir"
,
host
,
host
,
true
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录