Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
e26ca35b
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,发现更多精彩内容 >>
提交
e26ca35b
编写于
12月 27, 2012
作者:
P
Patrick Walton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
librustc: Fix the test runner, the condition system, and core test. rs=bustage
上级
84ce55e5
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
91 addition
and
13 deletion
+91
-13
src/libcore/bool.rs
src/libcore/bool.rs
+1
-0
src/libcore/char.rs
src/libcore/char.rs
+1
-0
src/libcore/dlist.rs
src/libcore/dlist.rs
+4
-0
src/libcore/flate.rs
src/libcore/flate.rs
+3
-2
src/libcore/float.rs
src/libcore/float.rs
+1
-0
src/libcore/int-template.rs
src/libcore/int-template.rs
+1
-0
src/libcore/io.rs
src/libcore/io.rs
+6
-0
src/libcore/oldcomm.rs
src/libcore/oldcomm.rs
+2
-0
src/libcore/option.rs
src/libcore/option.rs
+2
-0
src/libcore/os.rs
src/libcore/os.rs
+7
-0
src/libcore/path.rs
src/libcore/path.rs
+4
-1
src/libcore/pipes.rs
src/libcore/pipes.rs
+3
-0
src/libcore/private.rs
src/libcore/private.rs
+9
-0
src/libcore/ptr.rs
src/libcore/ptr.rs
+3
-0
src/libcore/rand.rs
src/libcore/rand.rs
+3
-0
src/libcore/result.rs
src/libcore/result.rs
+3
-0
src/libcore/run.rs
src/libcore/run.rs
+2
-0
src/libcore/send_map.rs
src/libcore/send_map.rs
+2
-0
src/libcore/str.rs
src/libcore/str.rs
+5
-1
src/libcore/sys.rs
src/libcore/sys.rs
+1
-0
src/libcore/task/local_data.rs
src/libcore/task/local_data.rs
+1
-0
src/libcore/task/mod.rs
src/libcore/task/mod.rs
+6
-0
src/libcore/task/spawn.rs
src/libcore/task/spawn.rs
+2
-0
src/libcore/uint-template.rs
src/libcore/uint-template.rs
+1
-0
src/libcore/uint-template/uint.rs
src/libcore/uint-template/uint.rs
+1
-0
src/libcore/vec.rs
src/libcore/vec.rs
+5
-1
src/librustc/front/test.rs
src/librustc/front/test.rs
+9
-5
src/libsyntax/ext/expand.rs
src/libsyntax/ext/expand.rs
+3
-3
未找到文件。
src/libcore/bool.rs
浏览文件 @
e26ca35b
...
...
@@ -16,6 +16,7 @@
//! Boolean logic
use
bool
;
use
cmp
;
use
cmp
::
Eq
;
...
...
src/libcore/char.rs
浏览文件 @
e26ca35b
...
...
@@ -14,6 +14,7 @@
#[forbid(deprecated_mode)]
;
#[forbid(deprecated_pattern)]
;
use
char
;
use
cmp
::
Eq
;
use
str
;
use
u32
;
...
...
src/libcore/dlist.rs
浏览文件 @
e26ca35b
...
...
@@ -473,6 +473,10 @@ fn pop_tail() -> Option<T> { self.pop_tail_n().map (|nobe| nobe.data) }
#[cfg(test)]
mod
tests
{
#[legacy_exports]
;
use
iter
;
use
vec
;
#[test]
fn
test_dlist_concat
()
{
let
a
=
from_vec
(
~
[
1
,
2
]);
...
...
src/libcore/flate.rs
浏览文件 @
e26ca35b
...
...
@@ -21,6 +21,7 @@
use
libc
;
use
libc
::{
c_void
,
size_t
,
c_int
};
use
ptr
;
use
rand
;
use
vec
;
extern
mod
rustrt
{
...
...
@@ -91,8 +92,8 @@ fn test_flate_round_trip() {
}
debug!
(
"de/inflate of %u bytes of random word-sequences"
,
in
.len
());
let
cmp
=
flate
::
deflate_bytes
(
in
);
let
out
=
flate
::
inflate_bytes
(
cmp
);
let
cmp
=
deflate_bytes
(
in
);
let
out
=
inflate_bytes
(
cmp
);
debug!
(
"%u bytes deflated to %u (%.1f%% size)"
,
in
.len
(),
cmp
.len
(),
100.0
*
((
cmp
.len
()
as
float
)
/
(
in
.len
()
as
float
)));
...
...
src/libcore/float.rs
浏览文件 @
e26ca35b
...
...
@@ -27,6 +27,7 @@
use
m_float
=
f64
;
use
cmp
::{
Eq
,
Ord
};
use
cmp
;
use
f64
;
use
num
;
use
num
::
Num
::
from_int
;
...
...
src/libcore/int-template.rs
浏览文件 @
e26ca35b
...
...
@@ -16,6 +16,7 @@
use
char
;
use
cmp
::{
Eq
,
Ord
};
use
cmp
;
use
from_str
::
FromStr
;
use
iter
;
use
num
;
...
...
src/libcore/io.rs
浏览文件 @
e26ca35b
...
...
@@ -1113,6 +1113,12 @@ pub fn obj_sync(o: FSyncable, opt_level: Option<Level>,
#[cfg(test)]
mod
tests
{
use
i32
;
use
io
;
use
result
;
use
str
;
use
u64
;
use
vec
;
#[test]
fn
test_simple
()
{
...
...
src/libcore/oldcomm.rs
浏览文件 @
e26ca35b
...
...
@@ -49,9 +49,11 @@
use
cast
;
use
either
;
use
either
::
Either
;
use
iter
;
use
libc
;
use
libc
::
size_t
;
use
ptr
;
use
result
;
use
sys
;
use
task
;
use
vec
;
...
...
src/libcore/option.rs
浏览文件 @
e26ca35b
...
...
@@ -46,6 +46,8 @@
use
cmp
::
Eq
;
use
option
;
use
ptr
;
use
str
;
use
util
;
/// The option type
...
...
src/libcore/os.rs
浏览文件 @
e26ca35b
...
...
@@ -920,6 +920,13 @@ pub fn arch() -> str { ~"arm" }
#[cfg(test)]
#[allow(non_implicitly_copyable_typarams)]
mod
tests
{
use
libc
;
use
option
;
use
os
;
use
rand
;
use
run
;
use
str
;
use
vec
;
#[test]
pub
fn
last_os_error
()
{
...
...
src/libcore/path.rs
浏览文件 @
e26ca35b
...
...
@@ -748,7 +748,7 @@ impl WindowsPath : GenericPath {
}
// Various windows helpers, and tests for the impl.
mod
windows
{
pub
mod
windows
{
use
libc
;
#[inline(always)]
...
...
@@ -792,6 +792,9 @@ mod windows {
#[cfg(test)]
mod
tests
{
use
path
::
windows
;
use
str
;
#[test]
fn
test_double_slash_collapsing
()
{
let
path
=
PosixPath
(
"tmp/"
);
...
...
src/libcore/pipes.rs
浏览文件 @
e26ca35b
...
...
@@ -1246,6 +1246,9 @@ pub fn make_none<T>() -> Option<T> { None }
#[cfg(test)]
pub
mod
test
{
use
pipes
::
oneshot
;
use
pipes
;
#[test]
pub
fn
test_select2
()
{
let
(
p1
,
c1
)
=
pipes
::
stream
();
...
...
src/libcore/private.rs
浏览文件 @
e26ca35b
...
...
@@ -16,13 +16,16 @@
#[doc(hidden)]
;
use
cast
;
use
iter
;
use
libc
;
use
oldcomm
;
use
option
;
use
pipes
;
use
ptr
;
use
result
;
use
task
;
use
task
::{
TaskBuilder
,
atomically
};
use
uint
;
extern
mod
rustrt
{
#[legacy_exports]
;
...
...
@@ -577,6 +580,12 @@ pub fn unwrap_exclusive<T: Owned>(arc: Exclusive<T>) -> T {
#[cfg(test)]
pub
mod
tests
{
use
option
;
use
pipes
;
use
result
;
use
task
;
use
uint
;
#[test]
pub
fn
exclusive_arc
()
{
let
mut
futures
=
~
[];
...
...
src/libcore/ptr.rs
浏览文件 @
e26ca35b
...
...
@@ -17,7 +17,10 @@
use
cmp
::{
Eq
,
Ord
};
use
libc
;
use
libc
::{
c_void
,
size_t
};
use
ptr
;
use
str
;
use
sys
;
use
vec
;
#[nolink]
#[abi
=
"cdecl"
]
...
...
src/libcore/rand.rs
浏览文件 @
e26ca35b
...
...
@@ -362,6 +362,9 @@ pub fn random() -> uint {
#[cfg(test)]
pub
mod
tests
{
use
option
::
Option
;
use
rand
;
#[test]
pub
fn
rng_seeded
()
{
let
seed
=
rand
::
seed
();
...
...
src/libcore/result.rs
浏览文件 @
e26ca35b
...
...
@@ -381,6 +381,9 @@ pub fn iter_vec2<S,T,U:Copy>(ss: &[S], ts: &[T],
#[allow(non_implicitly_copyable_typarams)]
mod
tests
{
#[legacy_exports]
;
use
result
;
fn
op1
()
->
result
::
Result
<
int
,
~
str
>
{
result
::
Ok
(
666
)
}
fn
op2
(
i
:
int
)
->
result
::
Result
<
uint
,
~
str
>
{
...
...
src/libcore/run.rs
浏览文件 @
e26ca35b
...
...
@@ -418,6 +418,8 @@ fn WEXITSTATUS(status: i32) -> i32 {
#[cfg(test)]
mod
tests
{
use
io
::
WriterUtil
;
use
os
;
use
run
;
// Regression test for memory leaks
#[ignore(cfg(windows))]
// FIXME (#2626)
...
...
src/libcore/send_map.rs
浏览文件 @
e26ca35b
...
...
@@ -458,6 +458,8 @@ impl<K:Hash IterBytes Eq, V: Eq> LinearMap<K, V>: cmp::Eq {
#[test]
pub
mod
test
{
use
send_map
::
linear
::
LinearMap
;
use
send_map
::
linear
;
use
uint
;
#[test]
pub
fn
inserts
()
{
...
...
src/libcore/str.rs
浏览文件 @
e26ca35b
...
...
@@ -2307,8 +2307,12 @@ impl &str: StrSlice {
#[cfg(test)]
mod
tests
{
use
char
;
use
libc
::
c_char
;
use
libc
;
use
ptr
;
use
str
::
raw
;
use
vec
;
#[test]
fn
test_eq
()
{
...
...
src/libcore/sys.rs
浏览文件 @
e26ca35b
...
...
@@ -145,6 +145,7 @@ pub struct Closure {
#[cfg(test)]
pub
mod
tests
{
use
cast
;
#[test]
pub
fn
size_of_basic
()
{
...
...
src/libcore/task/local_data.rs
浏览文件 @
e26ca35b
...
...
@@ -28,6 +28,7 @@
use
rt
;
use
task
::
local_data_priv
::{
local_get
,
local_pop
,
local_modify
,
local_set
};
use
task
;
/**
* Indexes a task-local data slot. The function's code pointer is used for
...
...
src/libcore/task/mod.rs
浏览文件 @
e26ca35b
...
...
@@ -38,15 +38,21 @@
* ~~~
*/
use
cast
;
use
cmp
;
use
cmp
::
Eq
;
use
iter
;
use
libc
;
use
oldcomm
;
use
option
;
use
result
::
Result
;
use
pipes
::{
stream
,
Chan
,
Port
};
use
pipes
;
use
ptr
;
use
result
;
use
task
::
local_data_priv
::{
local_get
,
local_set
};
use
task
::
rt
::{
task_id
,
rust_task
};
use
task
;
use
util
;
use
util
::
replace
;
...
...
src/libcore/task/spawn.rs
浏览文件 @
e26ca35b
...
...
@@ -74,7 +74,9 @@
#[warn(deprecated_mode)]
;
use
cast
;
use
oldcomm
;
use
option
;
use
pipes
;
use
private
;
use
ptr
;
use
send_map
;
...
...
src/libcore/uint-template.rs
浏览文件 @
e26ca35b
...
...
@@ -20,6 +20,7 @@
use
iter
;
use
num
;
use
str
;
use
uint
;
use
vec
;
pub
const
bits
:
uint
=
inst
::
bits
;
...
...
src/libcore/uint-template/uint.rs
浏览文件 @
e26ca35b
...
...
@@ -17,6 +17,7 @@
mod
inst
{
use
sys
;
use
uint
;
pub
type
T
=
uint
;
...
...
src/libcore/vec.rs
浏览文件 @
e26ca35b
...
...
@@ -2245,6 +2245,8 @@ impl<A:Copy> @[A] : iter::CopyableNonstrictIter<A> {
#[cfg(test)]
mod
tests
{
use
option
;
use
vec
::
raw
;
fn
square
(
n
:
uint
)
->
uint
{
return
n
*
n
;
}
...
...
@@ -2597,7 +2599,9 @@ fn test_filter_map() {
fn
halve
(
i
:
&
int
)
->
Option
<
int
>
{
if
*
i
%
2
==
0
{
return
option
::
Some
::
<
int
>
(
*
i
/
2
);
}
else
{
return
option
::
None
::
<
int
>
;
}
}
else
{
return
option
::
None
::
<
int
>
;
}
}
fn
halve_for_sure
(
i
:
&
int
)
->
int
{
return
*
i
/
2
;
}
let
all_even
:
~
[
int
]
=
~
[
0
,
2
,
8
,
6
];
...
...
src/librustc/front/test.rs
浏览文件 @
e26ca35b
...
...
@@ -238,6 +238,10 @@ fn nospan<T: Copy>(t: T) -> ast::spanned<T> {
}
fn
path_node
(
ids
:
~
[
ast
::
ident
])
->
@
ast
::
path
{
@
{
span
:
dummy_sp
(),
global
:
false
,
idents
:
ids
,
rp
:
None
,
types
:
~
[]}
}
fn
path_node_global
(
ids
:
~
[
ast
::
ident
])
->
@
ast
::
path
{
@
{
span
:
dummy_sp
(),
global
:
true
,
idents
:
ids
,
rp
:
None
,
types
:
~
[]}
}
...
...
@@ -284,8 +288,8 @@ fn mk_path(cx: test_ctxt, path: ~[ast::ident]) -> ~[ast::ident] {
// The ast::Ty of ~[std::test::test_desc]
fn
mk_test_desc_vec_ty
(
cx
:
test_ctxt
)
->
@
ast
::
Ty
{
let
test_desc_ty_path
=
path_node
(
mk_path
(
cx
,
~
[
cx
.sess
.ident_of
(
~
"test"
),
cx
.sess
.ident_of
(
~
"TestDesc"
)]));
path_node
_global
(
mk_path
(
cx
,
~
[
cx
.sess
.ident_of
(
~
"test"
),
cx
.sess
.ident_of
(
~
"TestDesc"
)]));
let
test_desc_ty
:
ast
::
Ty
=
{
id
:
cx
.sess
.next_node_id
(),
...
...
@@ -345,7 +349,7 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr {
nospan
({
mutbl
:
ast
::
m_imm
,
ident
:
cx
.sess
.ident_of
(
~
"name"
),
expr
:
@
name_expr
});
let
fn_path
=
path_node
(
path
);
let
fn_path
=
path_node
_global
(
path
);
let
fn_expr
:
ast
::
expr
=
{
id
:
cx
.sess
.next_node_id
(),
...
...
@@ -464,7 +468,7 @@ fn mk_main(cx: test_ctxt) -> @ast::item {
fn
mk_test_main_call
(
cx
:
test_ctxt
)
->
@
ast
::
expr
{
// Call os::args to generate the vector of test_descs
let
args_path
=
path_node
(
~
[
let
args_path
=
path_node
_global
(
~
[
cx
.sess
.ident_of
(
~
"os"
),
cx
.sess
.ident_of
(
~
"args"
)
]);
...
...
@@ -497,7 +501,7 @@ fn mk_test_main_call(cx: test_ctxt) -> @ast::expr {
node
:
test_call_expr_
,
span
:
dummy_sp
()};
// Call std::test::test_main
let
test_main_path
=
path_node
(
let
test_main_path
=
path_node
_global
(
mk_path
(
cx
,
~
[
cx
.sess
.ident_of
(
~
"test"
),
cx
.sess
.ident_of
(
~
"test_main"
)]));
...
...
src/libsyntax/ext/expand.rs
浏览文件 @
e26ca35b
...
...
@@ -298,10 +298,10 @@ fn core_macros() -> ~str {
{ $c:ident: $in:ty -> $out:ty; } => {
mod $c {
fn key(_x: @core::condition::Handler<$in,$out>) { }
fn key(_x: @
::
core::condition::Handler<$in,$out>) { }
pub const cond : core::condition::Condition<$in,$out> =
core::condition::Condition {
pub const cond :
::
core::condition::Condition<$in,$out> =
::
core::condition::Condition {
name: stringify!(c),
key: key
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录