Skip to content

Commit 5312265

Browse files
committed
---
yaml --- r: 149391 b: refs/heads/try2 c: 765a4e9 h: refs/heads/master i: 149389: c9d7823 149387: 87ff9b7 149383: 64760cc 149375: 2679e90 v: v3
1 parent 9b6a1f2 commit 5312265

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+420
-710
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 25ba057fad54da946bb3d72925c9a93b0abe61ac
8+
refs/heads/try2: 765a4e9fe35014eed3c7f60f8c7030ecb537871b
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/crates.mk

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
################################################################################
5151

5252
TARGET_CRATES := std extra green rustuv native flate arena glob term semver \
53-
uuid serialize sync getopts collections num test
53+
uuid serialize sync getopts collections num
5454
HOST_CRATES := syntax rustc rustdoc fourcc
5555
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5656
TOOLS := compiletest rustdoc rustc
@@ -63,8 +63,7 @@ DEPS_native := std
6363
DEPS_syntax := std term serialize collections
6464
DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \
6565
collections extra
66-
DEPS_rustdoc := rustc native:sundown serialize sync getopts collections \
67-
test
66+
DEPS_rustdoc := rustc native:sundown serialize sync getopts collections
6867
DEPS_flate := std native:miniz
6968
DEPS_arena := std collections
7069
DEPS_glob := std
@@ -77,9 +76,8 @@ DEPS_getopts := std
7776
DEPS_collections := std serialize
7877
DEPS_fourcc := syntax std
7978
DEPS_num := std extra
80-
DEPS_test := std extra collections getopts serialize term
8179

82-
TOOL_DEPS_compiletest := test green rustuv getopts
80+
TOOL_DEPS_compiletest := extra green rustuv getopts
8381
TOOL_DEPS_rustdoc := rustdoc green rustuv
8482
TOOL_DEPS_rustc := rustc green rustuv
8583
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs

branches/try2/src/compiletest/compiletest.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@
1313
#[allow(non_camel_case_types)];
1414
#[deny(warnings)];
1515

16-
extern crate test;
16+
extern crate extra;
1717
extern crate getopts;
1818

1919
use std::os;
2020
use std::io;
2121
use std::io::fs;
22+
2223
use getopts::{optopt, optflag, reqopt};
24+
use extra::test;
25+
2326
use common::config;
2427
use common::mode_run_pass;
2528
use common::mode_run_fail;

branches/try2/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use std::str;
3434
use std::task;
3535
use std::vec;
3636

37-
use test::MetricMap;
37+
use extra::test::MetricMap;
3838

3939
pub fn run(config: config, testfile: ~str) {
4040

branches/try2/src/doc/guide-testing.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ runner.
170170

171171
The type signature of a benchmark function differs from a unit test:
172172
it takes a mutable reference to type
173-
`test::BenchHarness`. Inside the benchmark function, any
173+
`extra::test::BenchHarness`. Inside the benchmark function, any
174174
time-variable or "setup" code should execute first, followed by a call
175175
to `iter` on the benchmark harness, passing a closure that contains
176176
the portion of the benchmark you wish to actually measure the
@@ -185,10 +185,9 @@ amount.
185185
For example:
186186

187187
~~~
188-
extern crate test;
189-
188+
extern crate extra;
190189
use std::vec;
191-
use test::BenchHarness;
190+
use extra::test::BenchHarness;
192191
193192
#[bench]
194193
fn bench_sum_1024_ints(b: &mut BenchHarness) {
@@ -244,8 +243,8 @@ recognize that some calculation has no external effects and remove
244243
it entirely.
245244

246245
~~~
247-
extern crate test;
248-
use test::BenchHarness;
246+
extern crate extra;
247+
use extra::test::BenchHarness;
249248
250249
#[bench]
251250
fn bench_xor_1000_ints(bh: &mut BenchHarness) {
@@ -274,15 +273,15 @@ example above by adjusting the `bh.iter` call to
274273
bh.iter(|| range(0, 1000).fold(0, |old, new| old ^ new))
275274
~~~
276275

277-
Or, the other option is to call the generic `test::black_box`
276+
Or, the other option is to call the generic `extra::test::black_box`
278277
function, which is an opaque "black box" to the optimizer and so
279278
forces it to consider any argument as used.
280279

281280
~~~
282-
extern crate test;
281+
use extra::test::black_box
283282
284283
bh.iter(|| {
285-
test::black_box(range(0, 1000).fold(0, |old, new| old ^ new));
284+
black_box(range(0, 1000).fold(0, |old, new| old ^ new));
286285
});
287286
~~~
288287

branches/try2/src/doc/rustdoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ testing this code, the `fib` function will be included (so it can compile).
154154

155155
Running tests often requires some special configuration to filter tests, find
156156
libraries, or try running ignored examples. The testing framework that rustdoc
157-
uses is build on crate `test`, which is also used when you compile crates with
157+
uses is build on `extra::test`, which is also used when you compile crates with
158158
rustc's `--test` flag. Extra arguments can be passed to rustdoc's test harness
159159
with the `--test-args` flag.
160160

branches/try2/src/libarena/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,10 @@ impl<T> Drop for TypedArena<T> {
503503
}
504504

505505
#[cfg(test)]
506-
mod tests {
507-
extern crate test;
508-
use self::test::BenchHarness;
506+
mod test {
507+
extern crate extra;
509508
use super::{Arena, TypedArena};
509+
use self::extra::test::BenchHarness;
510510

511511
struct Point {
512512
x: int,

branches/try2/src/libcollections/bitv.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,7 @@ impl<'a> Iterator<uint> for BitPositions<'a> {
938938

939939
#[cfg(test)]
940940
mod tests {
941-
extern crate test;
942-
use self::test::BenchHarness;
941+
use extra::test::BenchHarness;
943942

944943
use bitv::{Bitv, SmallBitv, BigBitv, BitvSet, from_bools, from_fn,
945944
from_bytes};

branches/try2/src/libcollections/deque.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ pub trait Deque<T> : Mutable {
4141

4242
#[cfg(test)]
4343
pub mod bench {
44-
extern crate test;
45-
use self::test::BenchHarness;
4644
use std::container::MutableMap;
4745
use std::{vec, rand};
4846
use std::rand::Rng;
47+
use extra::test::BenchHarness;
4948

5049
pub fn insert_rand_n<M:MutableMap<uint,uint>>(n: uint,
5150
map: &mut M,

branches/try2/src/libcollections/dlist.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,9 +657,8 @@ impl<D:Decoder,T:Decodable<D>> Decodable<D> for DList<T> {
657657

658658
#[cfg(test)]
659659
mod tests {
660-
extern crate test;
661-
use self::test::BenchHarness;
662660
use deque::Deque;
661+
use extra::test;
663662
use std::rand;
664663
use super::{DList, Node, ListInsertion};
665664

branches/try2/src/libcollections/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#[feature(macro_rules, managed_boxes)];
2121

2222
extern crate serialize;
23-
#[cfg(test)] extern crate test;
23+
#[cfg(test)] extern crate extra; // benchmark tests need this
2424

2525
pub use bitv::Bitv;
2626
pub use btree::BTree;

branches/try2/src/libcollections/ringbuf.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,8 @@ impl<D:Decoder,T:Decodable<D>> Decodable<D> for RingBuf<T> {
431431

432432
#[cfg(test)]
433433
mod tests {
434-
extern crate test;
435-
use self::test::BenchHarness;
436434
use deque::Deque;
435+
use extra::test;
437436
use std::clone::Clone;
438437
use std::cmp::Eq;
439438
use super::RingBuf;

branches/try2/src/libcollections/smallintmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,9 @@ mod test_map {
470470

471471
#[cfg(test)]
472472
mod bench {
473-
extern crate test;
474-
use self::test::BenchHarness;
473+
475474
use super::SmallIntMap;
475+
use extra::test::BenchHarness;
476476
use deque::bench::{insert_rand_n, insert_seq_n, find_rand_n, find_seq_n};
477477

478478
// Find seq

branches/try2/src/libcollections/treemap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,9 +1494,9 @@ mod test_treemap {
14941494

14951495
#[cfg(test)]
14961496
mod bench {
1497-
extern crate test;
1498-
use self::test::BenchHarness;
1497+
14991498
use super::TreeMap;
1499+
use extra::test::BenchHarness;
15001500
use deque::bench::{insert_rand_n, insert_seq_n, find_rand_n, find_seq_n};
15011501

15021502
// Find seq

branches/try2/src/libextra/lib.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,15 @@ Rust extras are part of the standard Rust distribution.
3636

3737
extern crate sync;
3838
extern crate serialize;
39+
3940
extern crate collections;
4041

4142
// Utility modules
43+
4244
pub mod c_vec;
45+
46+
// And ... other stuff
47+
4348
pub mod url;
4449
pub mod json;
4550
pub mod tempfile;
@@ -51,11 +56,15 @@ pub mod stats;
5156
#[cfg(unicode)]
5257
mod unicode;
5358

59+
// Compiler support modules
60+
61+
pub mod test;
62+
5463
// A curious inner-module that's not exported that contains the binding
5564
// 'extra' so that macro-expanded references to extra::serialize and such
5665
// can be resolved within libextra.
5766
#[doc(hidden)]
5867
pub mod extra {
5968
pub use serialize;
69+
pub use test;
6070
}
61-

branches/try2/src/libextra/stats.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,8 +1025,7 @@ mod tests {
10251025

10261026
#[cfg(test)]
10271027
mod bench {
1028-
extern crate test;
1029-
use self::test::BenchHarness;
1028+
use extra::test::BenchHarness;
10301029
use std::vec;
10311030
use stats::Stats;
10321031

0 commit comments

Comments
 (0)