Skip to content

Commit 9303837

Browse files
committed
---
yaml --- r: 102007 b: refs/heads/master c: 35c6e22 h: refs/heads/master i: 102005: 403b9d5 102003: 3bbd4a9 101999: 906ffcf v: v3
1 parent a3153db commit 9303837

Some content is hidden

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

92 files changed

+597
-810
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 47b05278d0679802f271e3f73cb22979dfc229de
2+
refs/heads/master: 35c6e22fab2d8b9c0911fb795532ca853d124ff1
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/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

trunk/mk/tests.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,6 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
537537
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
538538
CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
539539

540-
# There's no need our entire test suite to take up gigabytes of space on disk
541-
# including copies of libstd/libextra all over the place
542-
CTEST_RUSTC_FLAGS := $$(CTEST_RUSTC_FLAGS) -C prefer-dynamic
543-
544540
# The tests can not be optimized while the rest of the compiler is optimized, so
545541
# filter out the optimization (if any) from rustc and then figure out if we need
546542
# to be optimized

trunk/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;

trunk/src/compiletest/header.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ pub struct TestProps {
3232
force_host: bool,
3333
// Check stdout for error-pattern output as well as stderr
3434
check_stdout: bool,
35+
// Don't force a --crate-type=dylib flag on the command line
36+
no_prefer_dynamic: bool,
3537
}
3638

3739
// Load any test directives embedded in the file
@@ -45,6 +47,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
4547
let mut check_lines = ~[];
4648
let mut force_host = false;
4749
let mut check_stdout = false;
50+
let mut no_prefer_dynamic = false;
4851
iter_header(testfile, |ln| {
4952
match parse_error_pattern(ln) {
5053
Some(ep) => error_patterns.push(ep),
@@ -67,6 +70,10 @@ pub fn load_props(testfile: &Path) -> TestProps {
6770
check_stdout = parse_check_stdout(ln);
6871
}
6972

73+
if !no_prefer_dynamic {
74+
no_prefer_dynamic = parse_no_prefer_dynamic(ln);
75+
}
76+
7077
match parse_aux_build(ln) {
7178
Some(ab) => { aux_builds.push(ab); }
7279
None => {}
@@ -99,6 +106,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
99106
check_lines: check_lines,
100107
force_host: force_host,
101108
check_stdout: check_stdout,
109+
no_prefer_dynamic: no_prefer_dynamic,
102110
};
103111
}
104112

@@ -167,6 +175,10 @@ fn parse_check_stdout(line: &str) -> bool {
167175
parse_name_directive(line, "check-stdout")
168176
}
169177

178+
fn parse_no_prefer_dynamic(line: &str) -> bool {
179+
parse_name_directive(line, "no-prefer-dynamic")
180+
}
181+
170182
fn parse_exec_env(line: &str) -> Option<(~str, ~str)> {
171183
parse_name_value_directive(line, ~"exec-env").map(|nv| {
172184
// nv is either FOO or FOO=BAR

trunk/src/compiletest/runtest.rs

Lines changed: 11 additions & 3 deletions
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

@@ -704,9 +704,13 @@ fn compose_and_run_compiler(
704704
for rel_ab in props.aux_builds.iter() {
705705
let abs_ab = config.aux_base.join(rel_ab.as_slice());
706706
let aux_props = load_props(&abs_ab);
707+
let crate_type = if aux_props.no_prefer_dynamic {
708+
~[]
709+
} else {
710+
~[~"--crate-type=dylib"]
711+
};
707712
let aux_args =
708-
make_compile_args(config, &aux_props, ~[~"--crate-type=dylib"]
709-
+ extra_link_args,
713+
make_compile_args(config, &aux_props, crate_type + extra_link_args,
710714
|a,b| {
711715
let f = make_lib_name(a, b, testfile);
712716
ThisDirectory(f.dir_path())
@@ -770,6 +774,10 @@ fn make_compile_args(config: &config,
770774
~"-L", config.build_base.as_str().unwrap().to_owned(),
771775
~"--target=" + target]
772776
+ extras;
777+
if !props.no_prefer_dynamic {
778+
args.push(~"-C");
779+
args.push(~"prefer-dynamic");
780+
}
773781
let path = match xform_file {
774782
ThisFile(path) => { args.push(~"-o"); path }
775783
ThisDirectory(path) => { args.push(~"--out-dir"); path }

trunk/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

trunk/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

trunk/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,

trunk/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};

trunk/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,

trunk/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

trunk/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;

trunk/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;

trunk/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

trunk/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

trunk/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-

trunk/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)