Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
88a12193
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,发现更多精彩内容 >>
提交
88a12193
编写于
5月 23, 2013
作者:
E
Erick Tryzelaar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup warnings from compiletest
上级
d7e43aa7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
53 addition
and
54 deletion
+53
-54
src/compiletest/compiletest.rc
src/compiletest/compiletest.rc
+36
-36
src/compiletest/header.rs
src/compiletest/header.rs
+3
-4
src/compiletest/runtest.rs
src/compiletest/runtest.rs
+14
-14
未找到文件。
src/compiletest/compiletest.rc
浏览文件 @
88a12193
...
...
@@ -50,20 +50,20 @@ pub fn main() {
pub fn parse_config(args: ~[~str]) -> config {
let opts =
~[getopts::reqopt(
~
"compile-lib-path"),
getopts::reqopt(
~
"run-lib-path"),
getopts::reqopt(
~"rustc-path"), getopts::reqopt(~
"src-base"),
getopts::reqopt(
~"build-base"), getopts::reqopt(~
"aux-base"),
getopts::reqopt(
~
"stage-id"),
getopts::reqopt(
~"mode"), getopts::optflag(~
"ignored"),
getopts::optopt(
~"runtool"), getopts::optopt(~
"rustcflags"),
getopts::optflag(
~
"verbose"),
getopts::optopt(
~
"logfile"),
getopts::optflag(
~
"jit"),
getopts::optflag(
~
"newrt"),
getopts::optopt(
~
"target"),
getopts::optopt(
~
"adb-path"),
getopts::optopt(
~
"adb-test-dir")
~[getopts::reqopt("compile-lib-path"),
getopts::reqopt("run-lib-path"),
getopts::reqopt(
"rustc-path"), getopts::reqopt(
"src-base"),
getopts::reqopt(
"build-base"), getopts::reqopt(
"aux-base"),
getopts::reqopt("stage-id"),
getopts::reqopt(
"mode"), getopts::optflag(
"ignored"),
getopts::optopt(
"runtool"), getopts::optopt(
"rustcflags"),
getopts::optflag("verbose"),
getopts::optopt("logfile"),
getopts::optflag("jit"),
getopts::optflag("newrt"),
getopts::optopt("target"),
getopts::optopt("adb-path"),
getopts::optopt("adb-test-dir")
];
assert!(!args.is_empty());
...
...
@@ -74,43 +74,43 @@ pub fn parse_config(args: ~[~str]) -> config {
Err(f) => fail!(getopts::fail_str(f))
};
fn opt_path(m: &getopts::Matches, nm:
~
str) -> Path {
fn opt_path(m: &getopts::Matches, nm:
&
str) -> Path {
Path(getopts::opt_str(m, nm))
}
config {
compile_lib_path: getopts::opt_str(matches,
~
"compile-lib-path"),
run_lib_path: getopts::opt_str(matches,
~
"run-lib-path"),
rustc_path: opt_path(matches,
~
"rustc-path"),
src_base: opt_path(matches,
~
"src-base"),
build_base: opt_path(matches,
~
"build-base"),
aux_base: opt_path(matches,
~
"aux-base"),
stage_id: getopts::opt_str(matches,
~
"stage-id"),
mode: str_mode(getopts::opt_str(matches,
~
"mode")),
run_ignored: getopts::opt_present(matches,
~
"ignored"),
compile_lib_path: getopts::opt_str(matches, "compile-lib-path"),
run_lib_path: getopts::opt_str(matches, "run-lib-path"),
rustc_path: opt_path(matches, "rustc-path"),
src_base: opt_path(matches, "src-base"),
build_base: opt_path(matches, "build-base"),
aux_base: opt_path(matches, "aux-base"),
stage_id: getopts::opt_str(matches, "stage-id"),
mode: str_mode(getopts::opt_str(matches, "mode")),
run_ignored: getopts::opt_present(matches, "ignored"),
filter:
if vec::len(matches.free) > 0u {
option::Some(copy matches.free[0])
} else { option::None },
logfile: getopts::opt_maybe_str(matches,
~
"logfile").map(|s| Path(*s)),
runtool: getopts::opt_maybe_str(matches,
~
"runtool"),
rustcflags: getopts::opt_maybe_str(matches,
~
"rustcflags"),
jit: getopts::opt_present(matches,
~
"jit"),
newrt: getopts::opt_present(matches,
~
"newrt"),
target: opt_str2(getopts::opt_maybe_str(matches,
~
"target")).to_str(),
adb_path: opt_str2(getopts::opt_maybe_str(matches,
~
"adb-path")).to_str(),
logfile: getopts::opt_maybe_str(matches, "logfile").map(|s| Path(*s)),
runtool: getopts::opt_maybe_str(matches, "runtool"),
rustcflags: getopts::opt_maybe_str(matches, "rustcflags"),
jit: getopts::opt_present(matches, "jit"),
newrt: getopts::opt_present(matches, "newrt"),
target: opt_str2(getopts::opt_maybe_str(matches, "target")).to_str(),
adb_path: opt_str2(getopts::opt_maybe_str(matches, "adb-path")).to_str(),
adb_test_dir:
opt_str2(getopts::opt_maybe_str(matches,
~
"adb-test-dir")).to_str(),
opt_str2(getopts::opt_maybe_str(matches, "adb-test-dir")).to_str(),
adb_device_status:
if (opt_str2(getopts::opt_maybe_str(matches,
~
"target")) ==
if (opt_str2(getopts::opt_maybe_str(matches, "target")) ==
~"arm-linux-androideabi") {
if (opt_str2(getopts::opt_maybe_str(matches,
~
"adb-test-dir")) !=
if (opt_str2(getopts::opt_maybe_str(matches, "adb-test-dir")) !=
~"(none)" &&
opt_str2(getopts::opt_maybe_str(matches,
~
"adb-test-dir")) !=
opt_str2(getopts::opt_maybe_str(matches, "adb-test-dir")) !=
~"") { true }
else { false }
} else { false },
verbose: getopts::opt_present(matches,
~
"verbose")
verbose: getopts::opt_present(matches, "verbose")
}
}
...
...
src/compiletest/header.rs
浏览文件 @
88a12193
...
...
@@ -87,10 +87,10 @@ pub fn load_props(testfile: &Path) -> TestProps {
pub
fn
is_test_ignored
(
config
:
&
config
,
testfile
:
&
Path
)
->
bool
{
for
iter_header
(
testfile
)
|
ln
|
{
if
parse_name_directive
(
ln
,
~
"xfail-test"
)
{
return
true
;
}
if
parse_name_directive
(
ln
,
"xfail-test"
)
{
return
true
;
}
if
parse_name_directive
(
ln
,
xfail_target
())
{
return
true
;
}
if
config
.mode
==
common
::
mode_pretty
&&
parse_name_directive
(
ln
,
~
"xfail-pretty"
)
{
return
true
;
}
parse_name_directive
(
ln
,
"xfail-pretty"
)
{
return
true
;
}
};
return
false
;
...
...
@@ -107,8 +107,7 @@ fn iter_header(testfile: &Path, it: &fn(~str) -> bool) -> bool {
// Assume that any directives will be found before the first
// module or function. This doesn't seem to be an optimization
// with a warm page cache. Maybe with a cold one.
if
str
::
starts_with
(
ln
,
~
"fn"
)
||
str
::
starts_with
(
ln
,
~
"mod"
)
{
if
str
::
starts_with
(
ln
,
"fn"
)
||
str
::
starts_with
(
ln
,
"mod"
)
{
return
false
;
}
else
{
if
!
(
it
(
ln
))
{
return
false
;
}
}
}
...
...
src/compiletest/runtest.rs
浏览文件 @
88a12193
...
...
@@ -25,7 +25,7 @@
pub
fn
run
(
config
:
config
,
testfile
:
~
str
)
{
if
config
.verbose
{
// We're going to be dumping a lot of info. Start on a new line.
io
::
stdout
()
.write_str
(
~
"
\n\n
"
);
io
::
stdout
()
.write_str
(
"
\n\n
"
);
}
let
testfile
=
Path
(
testfile
);
debug!
(
"running %s"
,
testfile
.to_str
());
...
...
@@ -231,7 +231,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
// do not optimize debuginfo tests
let
mut
config
=
match
config
.rustcflags
{
Some
(
ref
flags
)
=>
config
{
rustcflags
:
Some
(
str
::
replace
(
*
flags
,
~
"-O"
,
~
""
)),
rustcflags
:
Some
(
str
::
replace
(
*
flags
,
"-O"
,
""
)),
..
copy
*
config
},
None
=>
copy
*
config
...
...
@@ -249,19 +249,19 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
// write debugger script
let
script_str
=
str
::
append
(
cmds
,
"
\n
quit
\n
"
);
debug!
(
"script_str = %s"
,
script_str
);
dump_output_file
(
config
,
testfile
,
script_str
,
~
"debugger.script"
);
dump_output_file
(
config
,
testfile
,
script_str
,
"debugger.script"
);
// run debugger script with gdb
#[cfg(windows)]
fn
debugger
()
->
~
str
{
~
"gdb.exe"
}
#[cfg(unix)]
fn
debugger
()
->
~
str
{
~
"gdb"
}
let
debugger_script
=
make_out_name
(
config
,
testfile
,
~
"debugger.script"
);
let
debugger_script
=
make_out_name
(
config
,
testfile
,
"debugger.script"
);
let
debugger_opts
=
~
[
~
"-quiet"
,
~
"-batch"
,
~
"-nx"
,
~
"-command="
+
debugger_script
.to_str
(),
make_exe_name
(
config
,
testfile
)
.to_str
()];
let
ProcArgs
=
ProcArgs
{
prog
:
debugger
(),
args
:
debugger_opts
};
ProcRes
=
compose_and_run
(
config
,
testfile
,
ProcArgs
,
~
[],
~
""
,
None
);
ProcRes
=
compose_and_run
(
config
,
testfile
,
ProcArgs
,
~
[],
""
,
None
);
if
ProcRes
.status
!=
0
{
fatal
(
~
"gdb failed to execute"
);
}
...
...
@@ -368,7 +368,7 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
}
// ignore this msg which gets printed at the end
if
str
::
contains
(
line
,
~
"aborting due to"
)
{
if
str
::
contains
(
line
,
"aborting due to"
)
{
was_expected
=
true
;
}
...
...
@@ -643,7 +643,7 @@ fn program_output(config: &config, testfile: &Path, lib_path: &str, prog: ~str,
#[cfg(target_os
=
"macos"
)]
#[cfg(target_os
=
"freebsd"
)]
fn
make_cmdline
(
_
libpath
:
&
str
,
prog
:
&
str
,
args
:
&
[
~
str
])
->
~
str
{
fmt!
(
"%s %s"
,
prog
,
str
::
connect
(
args
,
~
" "
))
fmt!
(
"%s %s"
,
prog
,
str
::
connect
(
args
,
" "
))
}
#[cfg(target_os
=
"win32"
)]
...
...
@@ -668,7 +668,7 @@ fn dump_output_file(config: &config, testfile: &Path,
out
:
&
str
,
extension
:
&
str
)
{
let
outfile
=
make_out_name
(
config
,
testfile
,
extension
);
let
writer
=
io
::
file_writer
(
&
outfile
,
~
[
io
::
Create
,
io
::
Truncate
])
.get
();
io
::
file_writer
(
&
outfile
,
[
io
::
Create
,
io
::
Truncate
])
.get
();
writer
.write_str
(
out
);
}
...
...
@@ -692,8 +692,8 @@ fn output_base_name(config: &config, testfile: &Path) -> Path {
fn
maybe_dump_to_stdout
(
config
:
&
config
,
out
:
&
str
,
err
:
&
str
)
{
if
config
.verbose
{
let
sep1
=
fmt!
(
"------%s------------------------------"
,
~
"stdout"
);
let
sep2
=
fmt!
(
"------%s------------------------------"
,
~
"stderr"
);
let
sep1
=
fmt!
(
"------%s------------------------------"
,
"stdout"
);
let
sep2
=
fmt!
(
"------%s------------------------------"
,
"stderr"
);
let
sep3
=
~
"------------------------------------------"
;
io
::
stdout
()
.write_line
(
sep1
);
io
::
stdout
()
.write_line
(
out
);
...
...
@@ -781,10 +781,10 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
newargs_err
.push
(
newcmd_err
);
let
procsrv
::
Result
{
out
:
out_out
,
err
:
_
out_err
,
status
:
out_status
}
=
procsrv
::
run
(
~
""
,
config
.adb_path
,
newargs_out
,
~
[(
~
""
,
~
""
)],
procsrv
::
run
(
""
,
config
.adb_path
,
newargs_out
,
~
[(
~
""
,
~
""
)],
Some
(
~
""
));
let
procsrv
::
Result
{
out
:
err_out
,
err
:
_
err_err
,
status
:
_
err_status
}
=
procsrv
::
run
(
~
""
,
config
.adb_path
,
newargs_err
,
~
[(
~
""
,
~
""
)],
procsrv
::
run
(
""
,
config
.adb_path
,
newargs_err
,
~
[(
~
""
,
~
""
)],
Some
(
~
""
));
dump_output
(
config
,
testfile
,
out_out
,
err_out
);
...
...
@@ -818,8 +818,8 @@ fn _arm_push_aux_shared_library(config: &config, testfile: &Path) {
if
(
file
.filetype
()
==
Some
(
~
".so"
))
{
let
copy_result
=
procsrv
::
run
(
~
""
,
config
.adb_path
,
~
[
~
"push"
,
file
.to_str
(),
copy
config
.adb_test_dir
],
let
copy_result
=
procsrv
::
run
(
""
,
config
.adb_path
,
[
~
"push"
,
file
.to_str
(),
copy
config
.adb_test_dir
],
~
[(
~
""
,
~
""
)],
Some
(
~
""
));
if
config
.verbose
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录