Skip to content

Commit 0d4ff31

Browse files
committed
---
yaml --- r: 142801 b: refs/heads/try2 c: 052c482 h: refs/heads/master i: 142799: fed6978 v: v3
1 parent 1a0a21f commit 0d4ff31

Some content is hidden

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

74 files changed

+984
-3062
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: 96453eb5c524fea0ee48b9a8e4b60c12dd0e9fc9
8+
refs/heads/try2: 052c482bbd87acc7ee824b6b8d2efb36c5b9917e
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/configure

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,6 @@ do
731731
make_dir $h/test/perf
732732
make_dir $h/test/pretty
733733
make_dir $h/test/debug-info
734-
make_dir $h/test/codegen
735734
make_dir $h/test/doc-tutorial
736735
make_dir $h/test/doc-tutorial-ffi
737736
make_dir $h/test/doc-tutorial-macros

branches/try2/doc/tutorial-container.md

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -205,104 +205,3 @@ println(fmt!("last: %?", it.next()));
205205
// the iterator is now fully consumed
206206
assert!(it.next().is_none());
207207
~~~
208-
209-
## Conversion
210-
211-
Iterators offer generic conversion to containers with the `collect` adaptor:
212-
213-
~~~
214-
let xs = [0, 1, 1, 2, 3, 5, 8];
215-
let ys = xs.rev_iter().skip(1).transform(|&x| x * 2).collect::<~[int]>();
216-
assert_eq!(ys, ~[10, 6, 4, 2, 2, 0]);
217-
~~~
218-
219-
The method requires a type hint for the container type, if the surrounding code
220-
does not provide sufficient information.
221-
222-
Containers can provide conversion from iterators through `collect` by
223-
implementing the `FromIterator` trait. For example, the implementation for
224-
vectors is as follows:
225-
226-
~~~
227-
impl<A, T: Iterator<A>> FromIterator<A, T> for ~[A] {
228-
pub fn from_iterator(iterator: &mut T) -> ~[A] {
229-
let (lower, _) = iterator.size_hint();
230-
let mut xs = with_capacity(lower);
231-
for iterator.advance |x| {
232-
xs.push(x);
233-
}
234-
xs
235-
}
236-
}
237-
~~~
238-
239-
### Size hints
240-
241-
The `Iterator` trait provides a `size_hint` default method, returning a lower
242-
bound and optionally on upper bound on the length of the iterator:
243-
244-
~~~
245-
fn size_hint(&self) -> (uint, Option<uint>) { (0, None) }
246-
~~~
247-
248-
The vector implementation of `FromIterator` from above uses the lower bound
249-
to pre-allocate enough space to hold the minimum number of elements the
250-
iterator will yield.
251-
252-
The default implementation is always correct, but it should be overridden if
253-
the iterator can provide better information.
254-
255-
The `ZeroStream` from earlier can provide an exact lower and upper bound:
256-
257-
~~~
258-
/// A stream of N zeroes
259-
struct ZeroStream {
260-
priv remaining: uint
261-
}
262-
263-
impl ZeroStream {
264-
fn new(n: uint) -> ZeroStream {
265-
ZeroStream { remaining: n }
266-
}
267-
268-
fn size_hint(&self) -> (uint, Option<uint>) {
269-
(self.remaining, Some(self.remaining))
270-
}
271-
}
272-
273-
impl Iterator<int> for ZeroStream {
274-
fn next(&mut self) -> Option<int> {
275-
if self.remaining == 0 {
276-
None
277-
} else {
278-
self.remaining -= 1;
279-
Some(0)
280-
}
281-
}
282-
}
283-
~~~
284-
285-
## Double-ended iterators
286-
287-
The `DoubleEndedIterator` trait represents an iterator able to yield elements
288-
from either end of a range. It inherits from the `Iterator` trait and extends
289-
it with the `next_back` function.
290-
291-
A `DoubleEndedIterator` can be flipped with the `invert` adaptor, returning
292-
another `DoubleEndedIterator` with `next` and `next_back` exchanged.
293-
294-
~~~
295-
let xs = [1, 2, 3, 4, 5, 6];
296-
let mut it = xs.iter();
297-
println(fmt!("%?", it.next())); // prints `Some(&1)`
298-
println(fmt!("%?", it.next())); // prints `Some(&2)`
299-
println(fmt!("%?", it.next_back())); // prints `Some(&6)`
300-
301-
// prints `5`, `4` and `3`
302-
for it.invert().advance |&x| {
303-
println(fmt!("%?", x))
304-
}
305-
~~~
306-
307-
The `rev_iter` and `mut_rev_iter` methods on vectors just return an inverted
308-
version of the standard immutable and mutable vector iterators.

branches/try2/mk/tests.mk

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
246246
check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
247247
check-stage$(1)-T-$(2)-H-$(3)-bench-exec \
248248
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-exec \
249-
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
250249
check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
251250
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
252251

@@ -431,8 +430,6 @@ CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
431430
BENCH_RS := $(wildcard $(S)src/test/bench/*.rs)
432431
PRETTY_RS := $(wildcard $(S)src/test/pretty/*.rs)
433432
DEBUGINFO_RS := $(wildcard $(S)src/test/debug-info/*.rs)
434-
CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
435-
CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
436433

437434
# perf tests are the same as bench tests only they run under
438435
# a performance monitor.
@@ -446,7 +443,6 @@ BENCH_TESTS := $(BENCH_RS)
446443
PERF_TESTS := $(PERF_RS)
447444
PRETTY_TESTS := $(PRETTY_RS)
448445
DEBUGINFO_TESTS := $(DEBUGINFO_RS)
449-
CODEGEN_TESTS := $(CODEGEN_RS) $(CODEGEN_CC)
450446

451447
CTEST_SRC_BASE_rpass = run-pass
452448
CTEST_BUILD_BASE_rpass = run-pass
@@ -483,19 +479,10 @@ CTEST_BUILD_BASE_debuginfo = debug-info
483479
CTEST_MODE_debuginfo = debug-info
484480
CTEST_RUNTOOL_debuginfo = $(CTEST_RUNTOOL)
485481

486-
CTEST_SRC_BASE_codegen = codegen
487-
CTEST_BUILD_BASE_codegen = codegen
488-
CTEST_MODE_codegen = codegen
489-
CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
490-
491482
ifeq ($(CFG_GDB),)
492483
CTEST_DISABLE_debuginfo = "no gdb found"
493484
endif
494485

495-
ifeq ($(CFG_CLANG),)
496-
CTEST_DISABLE_codegen = "no clang found"
497-
endif
498-
499486
ifeq ($(CFG_OSTYPE),apple-darwin)
500487
CTEST_DISABLE_debuginfo = "gdb on darwing needs root"
501488
endif
@@ -520,8 +507,6 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
520507
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
521508
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
522509
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
523-
--clang-path $(if $(CFG_CLANG),$(CFG_CLANG),clang) \
524-
--llvm-bin-path $(CFG_LLVM_INST_DIR_$(CFG_BUILD_TRIPLE))/bin \
525510
--aux-base $$(S)src/test/auxiliary/ \
526511
--stage-id stage$(1)-$(2) \
527512
--target $(2) \
@@ -537,7 +522,6 @@ CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
537522
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
538523
CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
539524
CTEST_DEPS_debuginfo_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_TESTS)
540-
CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
541525

542526
endef
543527

@@ -581,7 +565,7 @@ endif
581565

582566
endef
583567

584-
CTEST_NAMES = rpass rpass-full rfail cfail bench perf debuginfo codegen
568+
CTEST_NAMES = rpass rpass-full rfail cfail bench perf debuginfo
585569

586570
$(foreach host,$(CFG_HOST_TRIPLES), \
587571
$(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
@@ -690,7 +674,6 @@ TEST_GROUPS = \
690674
bench \
691675
perf \
692676
debuginfo \
693-
codegen \
694677
doc \
695678
$(foreach docname,$(DOC_TEST_NAMES),doc-$(docname)) \
696679
pretty \

branches/try2/src/compiletest/common.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub enum mode {
1515
mode_run_pass,
1616
mode_pretty,
1717
mode_debug_info,
18-
mode_codegen
1918
}
2019

2120
pub struct config {
@@ -28,12 +27,6 @@ pub struct config {
2827
// The rustc executable
2928
rustc_path: Path,
3029

31-
// The clang executable
32-
clang_path: Option<Path>,
33-
34-
// The llvm binaries path
35-
llvm_bin_path: Option<Path>,
36-
3730
// The directory containing the tests to run
3831
src_base: Path,
3932

branches/try2/src/compiletest/compiletest.rs

Lines changed: 18 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ extern mod extra;
1919
use std::os;
2020

2121
use extra::getopts;
22-
use extra::getopts::groups::{optopt, optflag, reqopt};
2322
use extra::test;
2423

2524
use common::config;
@@ -28,7 +27,6 @@ use common::mode_run_fail;
2827
use common::mode_compile_fail;
2928
use common::mode_pretty;
3029
use common::mode_debug_info;
31-
use common::mode_codegen;
3230
use common::mode;
3331
use util::logv;
3432

@@ -47,54 +45,31 @@ pub fn main() {
4745
}
4846

4947
pub fn parse_config(args: ~[~str]) -> config {
50-
51-
let groups : ~[getopts::groups::OptGroup] =
52-
~[reqopt("", "compile-lib-path", "path to host shared libraries", "PATH"),
53-
reqopt("", "run-lib-path", "path to target shared libraries", "PATH"),
54-
reqopt("", "rustc-path", "path to rustc to use for compiling", "PATH"),
55-
optopt("", "clang-path", "path to executable for codegen tests", "PATH"),
56-
optopt("", "llvm-bin-path", "path to directory holding llvm binaries", "DIR"),
57-
reqopt("", "src-base", "directory to scan for test files", "PATH"),
58-
reqopt("", "build-base", "directory to deposit test outputs", "PATH"),
59-
reqopt("", "aux-base", "directory to find auxiliary test files", "PATH"),
60-
reqopt("", "stage-id", "the target-stage identifier", "stageN-TARGET"),
61-
reqopt("", "mode", "which sort of compile tests to run",
62-
"(compile-fail|run-fail|run-pass|pretty|debug-info)"),
63-
optflag("", "ignored", "run tests marked as ignored / xfailed"),
64-
optopt("", "runtool", "supervisor program to run tests under \
65-
(eg. emulator, valgrind)", "PROGRAM"),
66-
optopt("", "rustcflags", "flags to pass to rustc", "FLAGS"),
67-
optflag("", "verbose", "run tests verbosely, showing all output"),
68-
optopt("", "logfile", "file to log test execution to", "FILE"),
69-
optflag("", "jit", "run tests under the JIT"),
70-
optflag("", "newrt", "run tests on the new runtime / scheduler"),
71-
optopt("", "target", "the target to build for", "TARGET"),
72-
optopt("", "adb-path", "path to the android debugger", "PATH"),
73-
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
74-
optflag("h", "help", "show this message"),
48+
let opts =
49+
~[getopts::reqopt("compile-lib-path"),
50+
getopts::reqopt("run-lib-path"),
51+
getopts::reqopt("rustc-path"), getopts::reqopt("src-base"),
52+
getopts::reqopt("build-base"), getopts::reqopt("aux-base"),
53+
getopts::reqopt("stage-id"),
54+
getopts::reqopt("mode"), getopts::optflag("ignored"),
55+
getopts::optopt("runtool"), getopts::optopt("rustcflags"),
56+
getopts::optflag("verbose"),
57+
getopts::optopt("logfile"),
58+
getopts::optflag("jit"),
59+
getopts::optflag("newrt"),
60+
getopts::optopt("target"),
61+
getopts::optopt("adb-path"),
62+
getopts::optopt("adb-test-dir")
7563
];
7664

7765
assert!(!args.is_empty());
78-
let argv0 = copy args[0];
7966
let args_ = args.tail();
80-
if args[1] == ~"-h" || args[1] == ~"--help" {
81-
let message = fmt!("Usage: %s [OPTIONS] [TESTNAME...]", argv0);
82-
println(getopts::groups::usage(message, groups));
83-
fail!()
84-
}
85-
8667
let matches =
87-
&match getopts::groups::getopts(args_, groups) {
68+
&match getopts::getopts(args_, opts) {
8869
Ok(m) => m,
8970
Err(f) => fail!(getopts::fail_str(f))
9071
};
9172

92-
if getopts::opt_present(matches, "h") || getopts::opt_present(matches, "help") {
93-
let message = fmt!("Usage: %s [OPTIONS] [TESTNAME...]", argv0);
94-
println(getopts::groups::usage(message, groups));
95-
fail!()
96-
}
97-
9873
fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
9974
Path(getopts::opt_str(m, nm))
10075
}
@@ -103,8 +78,6 @@ pub fn parse_config(args: ~[~str]) -> config {
10378
compile_lib_path: getopts::opt_str(matches, "compile-lib-path"),
10479
run_lib_path: getopts::opt_str(matches, "run-lib-path"),
10580
rustc_path: opt_path(matches, "rustc-path"),
106-
clang_path: getopts::opt_maybe_str(matches, "clang-path").map(|s| Path(*s)),
107-
llvm_bin_path: getopts::opt_maybe_str(matches, "llvm-bin-path").map(|s| Path(*s)),
10881
src_base: opt_path(matches, "src-base"),
10982
build_base: opt_path(matches, "build-base"),
11083
aux_base: opt_path(matches, "aux-base"),
@@ -186,7 +159,6 @@ pub fn str_mode(s: ~str) -> mode {
186159
~"run-pass" => mode_run_pass,
187160
~"pretty" => mode_pretty,
188161
~"debug-info" => mode_debug_info,
189-
~"codegen" => mode_codegen,
190162
_ => fail!("invalid mode")
191163
}
192164
}
@@ -198,7 +170,6 @@ pub fn mode_str(mode: mode) -> ~str {
198170
mode_run_pass => ~"run-pass",
199171
mode_pretty => ~"pretty",
200172
mode_debug_info => ~"debug-info",
201-
mode_codegen => ~"codegen",
202173
}
203174
}
204175

@@ -216,9 +187,8 @@ pub fn test_opts(config: &config) -> test::TestOpts {
216187
logfile: copy config.logfile,
217188
run_tests: true,
218189
run_benchmarks: false,
219-
ratchet_metrics: None,
220-
ratchet_noise_percent: None,
221-
save_metrics: None,
190+
save_results: None,
191+
compare_results: None
222192
}
223193
}
224194

0 commit comments

Comments
 (0)