Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
269cbc20
R
Rust
项目概览
int
/
Rust
10 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
269cbc20
编写于
8月 22, 2023
作者:
R
Ralf Jung
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
respect CARGO_EXTRA_FLAGS in more places
上级
95fe7ab2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
7 deletion
+18
-7
src/tools/miri/ci.sh
src/tools/miri/ci.sh
+1
-1
src/tools/miri/miri
src/tools/miri/miri
+1
-1
src/tools/miri/miri-script/src/commands.rs
src/tools/miri/miri-script/src/commands.rs
+3
-1
src/tools/miri/test-cargo-miri/run-test.py
src/tools/miri/test-cargo-miri/run-test.py
+3
-1
src/tools/miri/tests/compiletest.rs
src/tools/miri/tests/compiletest.rs
+10
-3
未找到文件。
src/tools/miri/ci.sh
浏览文件 @
269cbc20
...
...
@@ -52,7 +52,7 @@ function run_tests {
# Also run some many-seeds tests. 64 seeds means this takes around a minute per test.
for
FILE
in
tests/many-seeds/
*
.rs
;
do
MIRI_SEEDS
=
64
CARGO_EXTRA_FLAGS
=
"
$CARGO_EXTRA_FLAGS
-q"
./miri many-seeds ./miri run
"
$FILE
"
MIRI_SEEDS
=
64 ./miri many-seeds ./miri run
"
$FILE
"
done
# Check that the benchmarks build and run, but without actually benchmarking.
...
...
src/tools/miri/miri
浏览文件 @
269cbc20
...
...
@@ -2,5 +2,5 @@
set
-e
# Instead of doing just `cargo run --manifest-path .. $@`, we invoke miri-script binary directly. Invoking `cargo run` goes through
# rustup (that sets it's own environmental variables), which is undesirable.
cargo build
-q
--manifest-path
"
$(
dirname
"
$0
"
)
"
/miri-script/Cargo.toml
cargo build
$CARGO_EXTRA_FLAGS
-q
--manifest-path
"
$(
dirname
"
$0
"
)
"
/miri-script/Cargo.toml
"
$(
dirname
"
$0
"
)
"
/miri-script/target/debug/miri-script
"
$@
"
src/tools/miri/miri-script/src/commands.rs
浏览文件 @
269cbc20
...
...
@@ -319,6 +319,8 @@ fn bench(benches: Vec<OsString>) -> Result<()> {
let
Some
((
program_name
,
args
))
=
hyperfine
.split_first
()
else
{
bail!
(
"expected HYPERFINE environment variable to be non-empty"
);
};
// Extra flags to pass to cargo.
let
cargo_extra_flags
=
std
::
env
::
var
(
"CARGO_EXTRA_FLAGS"
)
.unwrap_or_default
();
// Make sure we have an up-to-date Miri installed and selected the right toolchain.
Self
::
install
(
vec!
[])
?
;
...
...
@@ -341,7 +343,7 @@ fn bench(benches: Vec<OsString>) -> Result<()> {
// That seems to make Windows CI happy.
cmd!
(
sh
,
"{program_name} {args...} 'cargo miri run --manifest-path
\"
'{current_bench}'
\"
'"
"{program_name} {args...} 'cargo miri run
'{cargo_extra_flags}'
--manifest-path
\"
'{current_bench}'
\"
'"
)
.run
()
?
;
}
...
...
src/tools/miri/test-cargo-miri/run-test.py
浏览文件 @
269cbc20
...
...
@@ -15,12 +15,14 @@ CGREEN = '\33[32m'
CBOLD
=
'
\33
[1m'
CEND
=
'
\33
[0m'
CARGO_EXTRA_FLAGS
=
os
.
environ
.
get
(
"CARGO_EXTRA_FLAGS"
,
""
).
split
()
def
fail
(
msg
):
print
(
"
\n
TEST FAIL: {}"
.
format
(
msg
))
sys
.
exit
(
1
)
def
cargo_miri
(
cmd
,
quiet
=
True
):
args
=
[
"cargo"
,
"miri"
,
cmd
]
args
=
[
"cargo"
,
"miri"
,
cmd
]
+
CARGO_EXTRA_FLAGS
if
quiet
:
args
+=
[
"-q"
]
if
'MIRI_TEST_TARGET'
in
os
.
environ
:
...
...
src/tools/miri/tests/compiletest.rs
浏览文件 @
269cbc20
...
...
@@ -16,6 +16,11 @@ fn get_host() -> String {
.host
}
pub
fn
flagsplit
(
flags
:
&
str
)
->
Vec
<
String
>
{
// This code is taken from `RUSTFLAGS` handling in cargo.
flags
.split
(
' '
)
.map
(
str
::
trim
)
.filter
(|
s
|
!
s
.is_empty
())
.map
(
str
::
to_string
)
.collect
()
}
// Build the shared object file for testing external C function calls.
fn
build_so_for_c_ffi_tests
()
->
PathBuf
{
let
cc
=
option_env!
(
"CC"
)
.unwrap_or
(
"cc"
);
...
...
@@ -100,14 +105,16 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
if
with_dependencies
&&
use_std
{
config
.dependencies_crate_manifest_path
=
Some
(
Path
::
new
(
"test_dependencies"
)
.join
(
"Cargo.toml"
));
config
.dependency_builder.args
=
vec!
[
"run"
.into
(),
let
mut
builder_args
=
vec!
[
"run"
.into
()];
builder_args
.extend
(
flagsplit
(
&
env
::
var
(
"CARGO_EXTRA_FLAGS"
)
.unwrap_or_default
()));
builder_args
.extend
([
"--manifest-path"
.into
(),
"cargo-miri/Cargo.toml"
.into
(),
"--"
.into
(),
"miri"
.into
(),
"run"
.into
(),
// There is no `cargo miri build` so we just use `cargo miri run`.
];
]);
config
.dependency_builder.args
=
builder_args
.into_iter
()
.map
(
Into
::
into
)
.collect
();
}
config
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录