Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
f8323397
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,发现更多精彩内容 >>
提交
f8323397
编写于
3月 19, 2013
作者:
H
Huon Wilson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
compiletest: Use lines_each instead of lines(..).each, or split(.., n).each
上级
429b8a9b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
11 deletion
+11
-11
src/compiletest/runtest.rs
src/compiletest/runtest.rs
+11
-11
未找到文件。
src/compiletest/runtest.rs
浏览文件 @
f8323397
...
@@ -267,7 +267,7 @@ fn debugger() -> ~str { ~"gdb" }
...
@@ -267,7 +267,7 @@ fn debugger() -> ~str { ~"gdb" }
// check if each line in props.check_lines appears in the
// check if each line in props.check_lines appears in the
// output (in order)
// output (in order)
let
mut
i
=
0u
;
let
mut
i
=
0u
;
for
str
::
lines
(
ProcRes
.stdout
)
.each
|
line
|
{
for
str
::
lines
_each
(
ProcRes
.stdout
)
|
line
|
{
if
props
.check_lines
[
i
]
.trim
()
==
line
.trim
()
{
if
props
.check_lines
[
i
]
.trim
()
==
line
.trim
()
{
i
+=
1u
;
i
+=
1u
;
}
}
...
@@ -297,8 +297,8 @@ fn check_error_patterns(props: TestProps,
...
@@ -297,8 +297,8 @@ fn check_error_patterns(props: TestProps,
let
mut
next_err_idx
=
0u
;
let
mut
next_err_idx
=
0u
;
let
mut
next_err_pat
=
props
.error_patterns
[
next_err_idx
];
let
mut
next_err_pat
=
props
.error_patterns
[
next_err_idx
];
let
mut
done
=
false
;
let
mut
done
=
false
;
for
str
::
split_char
(
ProcRes
.stderr
,
'\n'
)
.each
|
line
|
{
for
str
::
lines_each
(
ProcRes
.stderr
)
|
line
|
{
if
str
::
contains
(
*
line
,
next_err_pat
)
{
if
str
::
contains
(
line
,
next_err_pat
)
{
debug!
(
"found error pattern %s"
,
next_err_pat
);
debug!
(
"found error pattern %s"
,
next_err_pat
);
next_err_idx
+=
1u
;
next_err_idx
+=
1u
;
if
next_err_idx
==
vec
::
len
(
props
.error_patterns
)
{
if
next_err_idx
==
vec
::
len
(
props
.error_patterns
)
{
...
@@ -347,15 +347,15 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
...
@@ -347,15 +347,15 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
// filename:line1:col1: line2:col2: *warning:* msg
// filename:line1:col1: line2:col2: *warning:* msg
// where line1:col1: is the starting point, line2:col2:
// where line1:col1: is the starting point, line2:col2:
// is the ending point, and * represents ANSI color codes.
// is the ending point, and * represents ANSI color codes.
for
str
::
split_char
(
ProcRes
.stderr
,
'\n'
)
.each
|
line
|
{
for
str
::
lines_each
(
ProcRes
.stderr
)
|
line
|
{
let
mut
was_expected
=
false
;
let
mut
was_expected
=
false
;
for
vec
::
eachi
(
expected_errors
)
|
i
,
ee
|
{
for
vec
::
eachi
(
expected_errors
)
|
i
,
ee
|
{
if
!
found_flags
[
i
]
{
if
!
found_flags
[
i
]
{
debug!
(
"prefix=%s ee.kind=%s ee.msg=%s line=%s"
,
debug!
(
"prefix=%s ee.kind=%s ee.msg=%s line=%s"
,
prefixes
[
i
],
ee
.kind
,
ee
.msg
,
*
line
);
prefixes
[
i
],
ee
.kind
,
ee
.msg
,
line
);
if
(
str
::
starts_with
(
*
line
,
prefixes
[
i
])
&&
if
(
str
::
starts_with
(
line
,
prefixes
[
i
])
&&
str
::
contains
(
*
line
,
ee
.kind
)
&&
str
::
contains
(
line
,
ee
.kind
)
&&
str
::
contains
(
*
line
,
ee
.msg
))
{
str
::
contains
(
line
,
ee
.msg
))
{
found_flags
[
i
]
=
true
;
found_flags
[
i
]
=
true
;
was_expected
=
true
;
was_expected
=
true
;
break
;
break
;
...
@@ -364,13 +364,13 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
...
@@ -364,13 +364,13 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
}
}
// ignore this msg which gets printed at the end
// 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
;
was_expected
=
true
;
}
}
if
!
was_expected
&&
is_compiler_error_or_warning
(
*
line
)
{
if
!
was_expected
&&
is_compiler_error_or_warning
(
str
::
from_slice
(
line
)
)
{
fatal_ProcRes
(
fmt!
(
"unexpected compiler error or warning: '%s'"
,
fatal_ProcRes
(
fmt!
(
"unexpected compiler error or warning: '%s'"
,
*
line
),
line
),
ProcRes
);
ProcRes
);
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录