Skip to content

Commit 23eff9e

Browse files
committed
---
yaml --- r: 151754 b: refs/heads/try2 c: d92926c h: refs/heads/master v: v3
1 parent 75745c1 commit 23eff9e

File tree

212 files changed

+5537
-3530
lines changed

Some content is hidden

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

212 files changed

+5537
-3530
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: 5f4de7197fa7a65d27e16d306a74257f525d8d95
8+
refs/heads/try2: d92926ca3b984d7f58b685322083ff309f73c0bd
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#
6969
# * `TESTNAME=...` - Specify the name of tests to run
7070
# * `CHECK_IGNORED=1` - Run normally-ignored tests
71-
# * `NO_BENCH=1` - Don't run crate benchmarks (disable `--bench` flag)
71+
# * `PLEASE_BENCH=1` - Run crate benchmarks (enable `--bench` flag)
7272
#
7373
# * `CFG_ENABLE_VALGRIND=1` - Run tests under valgrind
7474
# * `VALGRIND_COMPILE=1` - Run the compiler itself under valgrind

branches/try2/mk/crates.mk

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,21 @@
5151

5252
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
54-
workcache url log regex graphviz core
54+
workcache url log regex graphviz core rlibc
5555
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
5858

5959
DEPS_core :=
60+
DEPS_rlibc :=
6061
DEPS_std := core libc native:rustrt native:compiler-rt native:backtrace native:jemalloc
62+
DEPS_graphviz := std
6163
DEPS_green := std rand native:context_switch
6264
DEPS_rustuv := std native:uv native:uv_support
6365
DEPS_native := std
6466
DEPS_syntax := std term serialize collections log fmt_macros
6567
DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \
66-
collections time log
68+
collections time log graphviz
6769
DEPS_rustdoc := rustc native:hoedown serialize sync getopts collections \
6870
test time
6971
DEPS_flate := std native:miniz
@@ -80,7 +82,7 @@ DEPS_collections := std rand
8082
DEPS_fourcc := syntax std
8183
DEPS_hexfloat := syntax std
8284
DEPS_num := std rand
83-
DEPS_test := std collections getopts serialize term time
85+
DEPS_test := std collections getopts serialize term time regex
8486
DEPS_time := std serialize
8587
DEPS_rand := std
8688
DEPS_url := std collections
@@ -98,6 +100,7 @@ TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
98100
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
99101

100102
ONLY_RLIB_core := 1
103+
ONLY_RLIB_rlibc := 1
101104

102105
################################################################################
103106
# You should not need to edit below this line

branches/try2/mk/docs.mk

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ DOCS := index intro tutorial guide-ffi guide-macros guide-lifetimes \
3030
guide-tasks guide-container guide-pointers guide-testing \
3131
guide-runtime complement-bugreport complement-cheatsheet \
3232
complement-lang-faq complement-project-faq rust rustdoc \
33-
guide-unsafe not_found
33+
guide-unsafe
3434

3535
PDF_DOCS := tutorial rust
3636

@@ -42,10 +42,11 @@ L10N_LANGS := ja
4242
# Generally no need to edit below here.
4343

4444
# The options are passed to the documentation generators.
45-
RUSTDOC_HTML_OPTS = --markdown-css rust.css \
46-
--markdown-before-content=doc/version_info.html \
45+
RUSTDOC_HTML_OPTS_NO_CSS = --markdown-before-content=doc/version_info.html \
4746
--markdown-in-header=doc/favicon.inc --markdown-after-content=doc/footer.inc
4847

48+
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css
49+
4950
PANDOC_BASE_OPTS := --standalone --toc --number-sections
5051
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --include-before-body=doc/version.tex \
5152
--from=markdown --include-before-body=doc/footer.tex --to=latex
@@ -152,6 +153,11 @@ doc/footer.tex: $(D)/footer.inc | doc/
152153
@$(call E, pandoc: $@)
153154
$(CFG_PANDOC) --from=html --to=latex $< --output=$@
154155

156+
# HTML (rustdoc)
157+
DOC_TARGETS += doc/not_found.html
158+
doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
159+
$(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css http://static.rust-lang.org/doc/master/rust.css $<
160+
155161
define DEF_DOC
156162

157163
# HTML (rustdoc)

branches/try2/mk/tests.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ ifdef CHECK_IGNORED
3232
TESTARGS += --ignored
3333
endif
3434

35-
TEST_BENCH = --bench
35+
TEST_BENCH =
3636

3737
# Arguments to the cfail/rfail/rpass/bench tests
3838
ifdef CFG_VALGRIND
3939
CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
4040
TEST_BENCH =
4141
endif
4242

43-
ifdef NO_BENCH
44-
TEST_BENCH =
43+
ifdef PLEASE_BENCH
44+
TEST_BENCH = --bench
4545
endif
4646

4747
# Arguments to the perf tests

branches/try2/src/compiletest/common.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use std::from_str::FromStr;
1212
use std::fmt;
13+
use regex::Regex;
1314

1415
#[deriving(Clone, Eq)]
1516
pub enum Mode {
@@ -40,15 +41,15 @@ impl FromStr for Mode {
4041
impl fmt::Show for Mode {
4142
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4243
let msg = match *self {
43-
CompileFail => "compile-fail",
44-
RunFail => "run-fail",
45-
RunPass => "run-pass",
46-
Pretty => "pretty",
47-
DebugInfoGdb => "debuginfo-gdb",
48-
DebugInfoLldb => "debuginfo-lldb",
49-
Codegen => "codegen",
44+
CompileFail => "compile-fail",
45+
RunFail => "run-fail",
46+
RunPass => "run-pass",
47+
Pretty => "pretty",
48+
DebugInfoGdb => "debuginfo-gdb",
49+
DebugInfoLldb => "debuginfo-lldb",
50+
Codegen => "codegen",
5051
};
51-
write!(f.buf, "{}", msg)
52+
msg.fmt(f)
5253
}
5354
}
5455

@@ -88,7 +89,7 @@ pub struct Config {
8889
pub run_ignored: bool,
8990

9091
// Only run tests that match this filter
91-
pub filter: Option<~str>,
92+
pub filter: Option<Regex>,
9293

9394
// Write out a parseable log of tests that were run
9495
pub logfile: Option<Path>,

branches/try2/src/compiletest/compiletest.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ extern crate log;
2323
extern crate green;
2424
extern crate rustuv;
2525

26+
extern crate regex;
27+
2628
use std::os;
2729
use std::io;
2830
use std::io::fs;
@@ -113,6 +115,19 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
113115
Path::new(m.opt_str(nm).unwrap())
114116
}
115117

118+
let filter = if !matches.free.is_empty() {
119+
let s = matches.free.get(0).as_slice();
120+
match regex::Regex::new(s) {
121+
Ok(re) => Some(re),
122+
Err(e) => {
123+
println!("failed to parse filter /{}/: {}", s, e);
124+
fail!()
125+
}
126+
}
127+
} else {
128+
None
129+
};
130+
116131
Config {
117132
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
118133
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
@@ -125,12 +140,7 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
125140
stage_id: matches.opt_str("stage-id").unwrap(),
126141
mode: FromStr::from_str(matches.opt_str("mode").unwrap()).expect("invalid mode"),
127142
run_ignored: matches.opt_present("ignored"),
128-
filter:
129-
if !matches.free.is_empty() {
130-
Some((*matches.free.get(0)).clone())
131-
} else {
132-
None
133-
},
143+
filter: filter,
134144
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
135145
save_metrics: matches.opt_str("save-metrics").map(|s| Path::new(s)),
136146
ratchet_metrics:
@@ -169,7 +179,7 @@ pub fn log_config(config: &Config) {
169179
logv(c, format!("stage_id: {}", config.stage_id));
170180
logv(c, format!("mode: {}", config.mode));
171181
logv(c, format!("run_ignored: {}", config.run_ignored));
172-
logv(c, format!("filter: {}", opt_str(&config.filter)));
182+
logv(c, format!("filter: {}", opt_str(&config.filter.as_ref().map(|re| re.to_str()))));
173183
logv(c, format!("runtool: {}", opt_str(&config.runtool)));
174184
logv(c, format!("host-rustcflags: {}", opt_str(&config.host_rustcflags)));
175185
logv(c, format!("target-rustcflags: {}", opt_str(&config.target_rustcflags)));
@@ -238,7 +248,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
238248
test::TestOpts {
239249
filter: match config.filter {
240250
None => None,
241-
Some(ref filter) => Some(filter.to_strbuf()),
251+
Some(ref filter) => Some(filter.clone()),
242252
},
243253
run_ignored: config.run_ignored,
244254
logfile: config.logfile.clone(),

branches/try2/src/doc/complement-cheatsheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To return an Owned String (~str) use the str helper function [`from_utf8_owned`]
6060
~~~
6161
use std::str;
6262
63-
let x: Option<~str> = str::from_utf8_owned(~[104u8,105u8]);
63+
let x: Result<~str,~[u8]> = str::from_utf8_owned(~[104u8,105u8]);
6464
let y: ~str = x.unwrap();
6565
~~~
6666

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

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,15 @@ fn test_out_of_bounds_failure() {
9090
~~~
9191

9292
A test runner built with the `--test` flag supports a limited set of
93-
arguments to control which tests are run: the first free argument
94-
passed to a test runner specifies a filter used to narrow down the set
95-
of tests being run; the `--ignored` flag tells the test runner to run
96-
only tests with the `ignore` attribute.
93+
arguments to control which tests are run:
94+
95+
- the first free argument passed to a test runner is interpreted as a
96+
regular expression
97+
([syntax reference](regex/index.html#syntax))
98+
and is used to narrow down the set of tests being run. Note: a plain
99+
string is a valid regular expression that matches itself.
100+
- the `--ignored` flag tells the test runner to run only tests with the
101+
`ignore` attribute.
97102

98103
## Parallelism
99104

@@ -146,16 +151,31 @@ result: FAILED. 1 passed; 1 failed; 0 ignored
146151

147152
### Running a subset of tests
148153

154+
Using a plain string:
155+
156+
~~~ {.notrust}
157+
$ mytests mytest23
158+
159+
running 1 tests
160+
running driver::tests::mytest23 ... ok
161+
162+
result: ok. 1 passed; 0 failed; 0 ignored
163+
~~~
164+
165+
Using some regular expression features:
166+
149167
~~~ {.notrust}
150-
$ mytests mytest1
168+
$ mytests 'mytest[145]'
151169
152-
running 11 tests
170+
running 13 tests
153171
running driver::tests::mytest1 ... ok
172+
running driver::tests::mytest4 ... ok
173+
running driver::tests::mytest5 ... ok
154174
running driver::tests::mytest10 ... ignored
155175
... snip ...
156176
running driver::tests::mytest19 ... ok
157177
158-
result: ok. 11 passed; 0 failed; 1 ignored
178+
result: ok. 13 passed; 0 failed; 1 ignored
159179
~~~
160180

161181
# Microbenchmarking

branches/try2/src/doc/rust.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,6 +1799,8 @@ type int8_t = i8;
17991799
- `no_start` - disable linking to the `native` crate, which specifies the
18001800
"start" language item.
18011801
- `no_std` - disable linking to the `std` crate.
1802+
- `no_builtins` - disable optimizing certain code patterns to invocations of
1803+
library functions that are assumed to exist
18021804

18031805
### Module-only attributes
18041806

branches/try2/src/libcollections/btree.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for Leaf<K, V> {
425425
///Returns a string representation of a Leaf.
426426
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
427427
for (i, s) in self.elts.iter().enumerate() {
428-
if i != 0 { try!(write!(f.buf, " // ")) }
429-
try!(write!(f.buf, "{}", *s))
428+
if i != 0 { try!(write!(f, " // ")) }
429+
try!(write!(f, "{}", *s))
430430
}
431431
Ok(())
432432
}
@@ -654,10 +654,10 @@ impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for Branch<K, V> {
654654
///Returns a string representation of a Branch.
655655
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
656656
for (i, s) in self.elts.iter().enumerate() {
657-
if i != 0 { try!(write!(f.buf, " // ")) }
658-
try!(write!(f.buf, "{}", *s))
657+
if i != 0 { try!(write!(f, " // ")) }
658+
try!(write!(f, "{}", *s))
659659
}
660-
write!(f.buf, " // rightmost child: ({}) ", *self.rightmost_child)
660+
write!(f, " // rightmost child: ({}) ", *self.rightmost_child)
661661
}
662662
}
663663

@@ -715,7 +715,7 @@ impl<K: TotalOrd, V: TotalEq> TotalOrd for LeafElt<K, V> {
715715
impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for LeafElt<K, V> {
716716
///Returns a string representation of a LeafElt.
717717
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
718-
write!(f.buf, "Key: {}, value: {};", self.key, self.value)
718+
write!(f, "Key: {}, value: {};", self.key, self.value)
719719
}
720720
}
721721

@@ -765,7 +765,7 @@ impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for BranchElt<K, V> {
765765
/// Returns string containing key, value, and child (which should recur to a
766766
/// leaf) Consider changing in future to be more readable.
767767
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
768-
write!(f.buf, "Key: {}, value: {}, (child: {})",
768+
write!(f, "Key: {}, value: {}, (child: {})",
769769
self.key, self.value, *self.left)
770770
}
771771
}

0 commit comments

Comments
 (0)