Skip to content

Commit df7fac2

Browse files
committed
---
yaml --- r: 104391 b: refs/heads/try c: fda6716 h: refs/heads/master i: 104389: 13fc57c 104387: 66dba4a 104383: 4e66141 v: v3
1 parent 3bb9844 commit df7fac2

File tree

146 files changed

+1966
-2704
lines changed

Some content is hidden

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

146 files changed

+1966
-2704
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 62f1d68439dcfd509eaca29887afa97f22938373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
5-
refs/heads/try: d70f909fa3bdc1c8231f127882cc30f274b263d1
5+
refs/heads/try: fda671683ec27454416a76a3c2456b0de2f1bfc0
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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/try/mk/tests.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,10 @@ 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+
540544
# The tests can not be optimized while the rest of the compiler is optimized, so
541545
# filter out the optimization (if any) from rustc and then figure out if we need
542546
# to be optimized

branches/try/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/try/src/compiletest/header.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ 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,
3735
}
3836

3937
// Load any test directives embedded in the file
@@ -47,7 +45,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
4745
let mut check_lines = ~[];
4846
let mut force_host = false;
4947
let mut check_stdout = false;
50-
let mut no_prefer_dynamic = false;
5148
iter_header(testfile, |ln| {
5249
match parse_error_pattern(ln) {
5350
Some(ep) => error_patterns.push(ep),
@@ -70,10 +67,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
7067
check_stdout = parse_check_stdout(ln);
7168
}
7269

73-
if !no_prefer_dynamic {
74-
no_prefer_dynamic = parse_no_prefer_dynamic(ln);
75-
}
76-
7770
match parse_aux_build(ln) {
7871
Some(ab) => { aux_builds.push(ab); }
7972
None => {}
@@ -106,7 +99,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
10699
check_lines: check_lines,
107100
force_host: force_host,
108101
check_stdout: check_stdout,
109-
no_prefer_dynamic: no_prefer_dynamic,
110102
};
111103
}
112104

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

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

branches/try/src/compiletest/runtest.rs

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

@@ -258,12 +258,15 @@ actual:\n\
258258
}
259259

260260
fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
261-
let mut config = config {
262-
target_rustcflags: cleanup_debug_info_options(&config.target_rustcflags),
263-
host_rustcflags: cleanup_debug_info_options(&config.host_rustcflags),
264-
.. config.clone()
265-
};
266261

262+
// do not optimize debuginfo tests
263+
let mut config = match config.target_rustcflags {
264+
Some(ref flags) => config {
265+
target_rustcflags: Some(flags.replace("-O", "")),
266+
.. (*config).clone()
267+
},
268+
None => (*config).clone()
269+
};
267270
let config = &mut config;
268271
let check_lines = &props.check_lines;
269272
let mut cmds = props.debugger_cmds.connect("\n");
@@ -433,20 +436,6 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
433436
check_lines[i]), &ProcRes);
434437
}
435438
}
436-
437-
fn cleanup_debug_info_options(options: &Option<~str>) -> Option<~str> {
438-
if options.is_none() {
439-
return None;
440-
}
441-
442-
// Remove options that are either unwanted (-O) or may lead to duplicates due to RUSTFLAGS.
443-
let options_to_remove = [~"-O", ~"-g", ~"--debuginfo"];
444-
let new_options = split_maybe_args(options).move_iter()
445-
.filter(|x| !options_to_remove.contains(x))
446-
.to_owned_vec()
447-
.connect(" ");
448-
Some(new_options)
449-
}
450439
}
451440

452441
fn check_error_patterns(props: &TestProps,
@@ -715,13 +704,9 @@ fn compose_and_run_compiler(
715704
for rel_ab in props.aux_builds.iter() {
716705
let abs_ab = config.aux_base.join(rel_ab.as_slice());
717706
let aux_props = load_props(&abs_ab);
718-
let crate_type = if aux_props.no_prefer_dynamic {
719-
~[]
720-
} else {
721-
~[~"--crate-type=dylib"]
722-
};
723707
let aux_args =
724-
make_compile_args(config, &aux_props, crate_type + extra_link_args,
708+
make_compile_args(config, &aux_props, ~[~"--crate-type=dylib"]
709+
+ extra_link_args,
725710
|a,b| {
726711
let f = make_lib_name(a, b, testfile);
727712
ThisDirectory(f.dir_path())
@@ -785,10 +770,6 @@ fn make_compile_args(config: &config,
785770
~"-L", config.build_base.as_str().unwrap().to_owned(),
786771
~"--target=" + target]
787772
+ extras;
788-
if !props.no_prefer_dynamic {
789-
args.push(~"-C");
790-
args.push(~"prefer-dynamic");
791-
}
792773
let path = match xform_file {
793774
ThisFile(path) => { args.push(~"-o"); path }
794775
ThisDirectory(path) => { args.push(~"--out-dir"); path }

branches/try/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/try/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/try/src/doc/tutorial.md

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -582,32 +582,6 @@ loop {
582582
This code prints out a weird sequence of numbers and stops as soon as
583583
it finds one that can be divided by five.
584584

585-
There is also a for-loop that can be used to iterate over a range of numbers:
586-
587-
~~~~
588-
for n in range(0, 5) {
589-
println!("{}", n);
590-
}
591-
~~~~
592-
593-
The snippet above prints integer numbers under 5 starting at 0.
594-
595-
More generally, a for loop works with anything implementing the `Iterator` trait.
596-
Data structures can provide one or more methods that return iterators over
597-
their contents. For example, strings support iteration over their contents in
598-
various ways:
599-
600-
~~~~
601-
let s = "Hello";
602-
for c in s.chars() {
603-
println!("{}", c);
604-
}
605-
~~~~
606-
607-
The snippet above prints the characters in "Hello" vertically, adding a new
608-
line after each character.
609-
610-
611585
# Data structures
612586

613587
## Structs

branches/try/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/try/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/try/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/try/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/try/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/try/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/try/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/try/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

0 commit comments

Comments
 (0)