Skip to content

Commit 5ed8f7a

Browse files
committed
---
yaml --- r: 151791 b: refs/heads/try2 c: 6959b4f h: refs/heads/master i: 151789: 3b1cfe6 151787: d2c1b25 151783: 83b8b37 151775: 7803897 v: v3
1 parent 6d54e8d commit 5ed8f7a

File tree

53 files changed

+1357
-2326
lines changed

Some content is hidden

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

53 files changed

+1357
-2326
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: 1e0379f05b226c64b693d00228fec77b87dc5284
8+
refs/heads/try2: 6959b4f7b07e5d78e37092489868fb17c4d7c36e
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ DEPS_arena := std collections
7373
DEPS_graphviz := std
7474
DEPS_glob := std
7575
DEPS_serialize := std collections log
76-
DEPS_term := std collections log
76+
DEPS_term := std collections
7777
DEPS_semver := std
7878
DEPS_uuid := std serialize rand
7979
DEPS_sync := std
@@ -83,7 +83,7 @@ DEPS_fourcc := syntax std
8383
DEPS_hexfloat := syntax std
8484
DEPS_num := std rand
8585
DEPS_test := std collections getopts serialize term time regex
86-
DEPS_time := std serialize sync
86+
DEPS_time := std serialize
8787
DEPS_rand := std
8888
DEPS_url := std collections
8989
DEPS_workcache := std serialize collections log

branches/try2/src/compiletest/common.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ impl fmt::Show for Mode {
5656
#[deriving(Clone)]
5757
pub struct Config {
5858
// The library paths required for running the compiler
59-
pub compile_lib_path: StrBuf,
59+
pub compile_lib_path: ~str,
6060

6161
// The library paths required for running compiled programs
62-
pub run_lib_path: StrBuf,
62+
pub run_lib_path: ~str,
6363

6464
// The rustc executable
6565
pub rustc_path: Path,
@@ -80,7 +80,7 @@ pub struct Config {
8080
pub aux_base: Path,
8181

8282
// The name of the stage being built (stage1, etc)
83-
pub stage_id: StrBuf,
83+
pub stage_id: ~str,
8484

8585
// The test mode, compile-fail, run-fail, run-pass
8686
pub mode: Mode,
@@ -110,37 +110,37 @@ pub struct Config {
110110

111111
// A command line to prefix program execution with,
112112
// for running under valgrind
113-
pub runtool: Option<StrBuf>,
113+
pub runtool: Option<~str>,
114114

115115
// Flags to pass to the compiler when building for the host
116-
pub host_rustcflags: Option<StrBuf>,
116+
pub host_rustcflags: Option<~str>,
117117

118118
// Flags to pass to the compiler when building for the target
119-
pub target_rustcflags: Option<StrBuf>,
119+
pub target_rustcflags: Option<~str>,
120120

121121
// Run tests using the JIT
122122
pub jit: bool,
123123

124124
// Target system to be tested
125-
pub target: StrBuf,
125+
pub target: ~str,
126126

127127
// Host triple for the compiler being invoked
128-
pub host: StrBuf,
128+
pub host: ~str,
129129

130130
// Path to the android tools
131131
pub android_cross_path: Path,
132132

133133
// Extra parameter to run adb on arm-linux-androideabi
134-
pub adb_path: StrBuf,
134+
pub adb_path: ~str,
135135

136136
// Extra parameter to run test sute on arm-linux-androideabi
137-
pub adb_test_dir: StrBuf,
137+
pub adb_test_dir: ~str,
138138

139139
// status whether android device available or not
140140
pub adb_device_status: bool,
141141

142142
// the path containing LLDB's Python module
143-
pub lldb_python_dir: Option<StrBuf>,
143+
pub lldb_python_dir: Option<~str>,
144144

145145
// Explain what's going on
146146
pub verbose: bool

branches/try2/src/compiletest/compiletest.rs

Lines changed: 58 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,12 @@ fn start(argc: int, argv: **u8) -> int {
4848

4949
pub fn main() {
5050
let args = os::args();
51-
let config = parse_config(args.move_iter()
52-
.map(|x| x.to_strbuf())
53-
.collect());
51+
let config = parse_config(args.move_iter().collect());
5452
log_config(&config);
5553
run_tests(&config);
5654
}
5755

58-
pub fn parse_config(args: Vec<StrBuf> ) -> Config {
56+
pub fn parse_config(args: Vec<~str> ) -> Config {
5957

6058
let groups : Vec<getopts::OptGroup> =
6159
vec!(reqopt("", "compile-lib-path", "path to host shared libraries", "PATH"),
@@ -93,15 +91,15 @@ pub fn parse_config(args: Vec<StrBuf> ) -> Config {
9391
assert!(!args.is_empty());
9492
let argv0 = (*args.get(0)).clone();
9593
let args_ = args.tail();
96-
if args.get(1).as_slice() == "-h" || args.get(1).as_slice() == "--help" {
94+
if *args.get(1) == "-h".to_owned() || *args.get(1) == "--help".to_owned() {
9795
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
9896
println!("{}", getopts::usage(message, groups.as_slice()));
9997
println!("");
10098
fail!()
10199
}
102100

103101
let matches =
104-
&match getopts::getopts(args_.as_slice(), groups.as_slice()) {
102+
&match getopts::getopts(args_, groups.as_slice()) {
105103
Ok(m) => m,
106104
Err(f) => fail!("{}", f.to_err_msg())
107105
};
@@ -131,53 +129,39 @@ pub fn parse_config(args: Vec<StrBuf> ) -> Config {
131129
};
132130

133131
Config {
134-
compile_lib_path: matches.opt_str("compile-lib-path")
135-
.unwrap()
136-
.to_strbuf(),
137-
run_lib_path: matches.opt_str("run-lib-path").unwrap().to_strbuf(),
132+
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
133+
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
138134
rustc_path: opt_path(matches, "rustc-path"),
139135
clang_path: matches.opt_str("clang-path").map(|s| Path::new(s)),
140136
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| Path::new(s)),
141137
src_base: opt_path(matches, "src-base"),
142138
build_base: opt_path(matches, "build-base"),
143139
aux_base: opt_path(matches, "aux-base"),
144-
stage_id: matches.opt_str("stage-id").unwrap().to_strbuf(),
145-
mode: FromStr::from_str(matches.opt_str("mode")
146-
.unwrap()
147-
.as_slice()).expect("invalid mode"),
140+
stage_id: matches.opt_str("stage-id").unwrap(),
141+
mode: FromStr::from_str(matches.opt_str("mode").unwrap()).expect("invalid mode"),
148142
run_ignored: matches.opt_present("ignored"),
149143
filter: filter,
150144
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
151145
save_metrics: matches.opt_str("save-metrics").map(|s| Path::new(s)),
152146
ratchet_metrics:
153147
matches.opt_str("ratchet-metrics").map(|s| Path::new(s)),
154148
ratchet_noise_percent:
155-
matches.opt_str("ratchet-noise-percent")
156-
.and_then(|s| from_str::<f64>(s.as_slice())),
157-
runtool: matches.opt_str("runtool").map(|x| x.to_strbuf()),
158-
host_rustcflags: matches.opt_str("host-rustcflags")
159-
.map(|x| x.to_strbuf()),
160-
target_rustcflags: matches.opt_str("target-rustcflags")
161-
.map(|x| x.to_strbuf()),
149+
matches.opt_str("ratchet-noise-percent").and_then(|s| from_str::<f64>(s)),
150+
runtool: matches.opt_str("runtool"),
151+
host_rustcflags: matches.opt_str("host-rustcflags"),
152+
target_rustcflags: matches.opt_str("target-rustcflags"),
162153
jit: matches.opt_present("jit"),
163-
target: opt_str2(matches.opt_str("target").map(|x| x.to_strbuf())),
164-
host: opt_str2(matches.opt_str("host").map(|x| x.to_strbuf())),
154+
target: opt_str2(matches.opt_str("target")).to_str(),
155+
host: opt_str2(matches.opt_str("host")).to_str(),
165156
android_cross_path: opt_path(matches, "android-cross-path"),
166-
adb_path: opt_str2(matches.opt_str("adb-path")
167-
.map(|x| x.to_strbuf())),
168-
adb_test_dir: opt_str2(matches.opt_str("adb-test-dir")
169-
.map(|x| x.to_strbuf())),
157+
adb_path: opt_str2(matches.opt_str("adb-path")).to_str(),
158+
adb_test_dir:
159+
opt_str2(matches.opt_str("adb-test-dir")).to_str(),
170160
adb_device_status:
171-
"arm-linux-androideabi" ==
172-
opt_str2(matches.opt_str("target")
173-
.map(|x| x.to_strbuf())).as_slice() &&
174-
"(none)" !=
175-
opt_str2(matches.opt_str("adb-test-dir")
176-
.map(|x| x.to_strbuf())).as_slice() &&
177-
!opt_str2(matches.opt_str("adb-test-dir")
178-
.map(|x| x.to_strbuf())).is_empty(),
179-
lldb_python_dir: matches.opt_str("lldb-python-dir")
180-
.map(|x| x.to_strbuf()),
161+
"arm-linux-androideabi" == opt_str2(matches.opt_str("target")) &&
162+
"(none)" != opt_str2(matches.opt_str("adb-test-dir")) &&
163+
!opt_str2(matches.opt_str("adb-test-dir")).is_empty(),
164+
lldb_python_dir: matches.opt_str("lldb-python-dir"),
181165
test_shard: test::opt_shard(matches.opt_str("test-shard")
182166
.map(|x| x.to_strbuf())),
183167
verbose: matches.opt_present("verbose")
@@ -186,59 +170,50 @@ pub fn parse_config(args: Vec<StrBuf> ) -> Config {
186170

187171
pub fn log_config(config: &Config) {
188172
let c = config;
189-
logv(c, format_strbuf!("configuration:"));
190-
logv(c, format_strbuf!("compile_lib_path: {}", config.compile_lib_path));
191-
logv(c, format_strbuf!("run_lib_path: {}", config.run_lib_path));
192-
logv(c, format_strbuf!("rustc_path: {}", config.rustc_path.display()));
193-
logv(c, format_strbuf!("src_base: {}", config.src_base.display()));
194-
logv(c, format_strbuf!("build_base: {}", config.build_base.display()));
195-
logv(c, format_strbuf!("stage_id: {}", config.stage_id));
196-
logv(c, format_strbuf!("mode: {}", config.mode));
197-
logv(c, format_strbuf!("run_ignored: {}", config.run_ignored));
198-
logv(c, format_strbuf!("filter: {}",
199-
opt_str(&config.filter
200-
.as_ref()
201-
.map(|re| {
202-
re.to_str().into_strbuf()
203-
}))));
204-
logv(c, format_strbuf!("runtool: {}", opt_str(&config.runtool)));
205-
logv(c, format_strbuf!("host-rustcflags: {}",
206-
opt_str(&config.host_rustcflags)));
207-
logv(c, format_strbuf!("target-rustcflags: {}",
208-
opt_str(&config.target_rustcflags)));
209-
logv(c, format_strbuf!("jit: {}", config.jit));
210-
logv(c, format_strbuf!("target: {}", config.target));
211-
logv(c, format_strbuf!("host: {}", config.host));
212-
logv(c, format_strbuf!("android-cross-path: {}",
213-
config.android_cross_path.display()));
214-
logv(c, format_strbuf!("adb_path: {}", config.adb_path));
215-
logv(c, format_strbuf!("adb_test_dir: {}", config.adb_test_dir));
216-
logv(c, format_strbuf!("adb_device_status: {}",
217-
config.adb_device_status));
173+
logv(c, format!("configuration:"));
174+
logv(c, format!("compile_lib_path: {}", config.compile_lib_path));
175+
logv(c, format!("run_lib_path: {}", config.run_lib_path));
176+
logv(c, format!("rustc_path: {}", config.rustc_path.display()));
177+
logv(c, format!("src_base: {}", config.src_base.display()));
178+
logv(c, format!("build_base: {}", config.build_base.display()));
179+
logv(c, format!("stage_id: {}", config.stage_id));
180+
logv(c, format!("mode: {}", config.mode));
181+
logv(c, format!("run_ignored: {}", config.run_ignored));
182+
logv(c, format!("filter: {}", opt_str(&config.filter.as_ref().map(|re| re.to_str()))));
183+
logv(c, format!("runtool: {}", opt_str(&config.runtool)));
184+
logv(c, format!("host-rustcflags: {}", opt_str(&config.host_rustcflags)));
185+
logv(c, format!("target-rustcflags: {}", opt_str(&config.target_rustcflags)));
186+
logv(c, format!("jit: {}", config.jit));
187+
logv(c, format!("target: {}", config.target));
188+
logv(c, format!("host: {}", config.host));
189+
logv(c, format!("android-cross-path: {}", config.android_cross_path.display()));
190+
logv(c, format!("adb_path: {}", config.adb_path));
191+
logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
192+
logv(c, format!("adb_device_status: {}", config.adb_device_status));
218193
match config.test_shard {
219-
None => logv(c, "test_shard: (all)".to_strbuf()),
220-
Some((a,b)) => logv(c, format_strbuf!("test_shard: {}.{}", a, b))
194+
None => logv(c, "test_shard: (all)".to_owned()),
195+
Some((a,b)) => logv(c, format!("test_shard: {}.{}", a, b))
221196
}
222-
logv(c, format_strbuf!("verbose: {}", config.verbose));
223-
logv(c, format_strbuf!("\n"));
197+
logv(c, format!("verbose: {}", config.verbose));
198+
logv(c, format!("\n"));
224199
}
225200

226-
pub fn opt_str<'a>(maybestr: &'a Option<StrBuf>) -> &'a str {
201+
pub fn opt_str<'a>(maybestr: &'a Option<~str>) -> &'a str {
227202
match *maybestr {
228203
None => "(none)",
229-
Some(ref s) => s.as_slice(),
204+
Some(ref s) => {
205+
let s: &'a str = *s;
206+
s
207+
}
230208
}
231209
}
232210

233-
pub fn opt_str2(maybestr: Option<StrBuf>) -> StrBuf {
234-
match maybestr {
235-
None => "(none)".to_strbuf(),
236-
Some(s) => s,
237-
}
211+
pub fn opt_str2(maybestr: Option<~str>) -> ~str {
212+
match maybestr { None => "(none)".to_owned(), Some(s) => { s } }
238213
}
239214

240215
pub fn run_tests(config: &Config) {
241-
if config.target.as_slice() == "arm-linux-androideabi" {
216+
if config.target == "arm-linux-androideabi".to_owned() {
242217
match config.mode {
243218
DebugInfoGdb => {
244219
println!("arm-linux-androideabi debug-info \
@@ -346,11 +321,11 @@ pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
346321
pub fn make_test_name(config: &Config, testfile: &Path) -> test::TestName {
347322

348323
// Try to elide redundant long paths
349-
fn shorten(path: &Path) -> StrBuf {
324+
fn shorten(path: &Path) -> ~str {
350325
let filename = path.filename_str();
351326
let p = path.dir_path();
352327
let dir = p.filename_str();
353-
format_strbuf!("{}/{}", dir.unwrap_or(""), filename.unwrap_or(""))
328+
format!("{}/{}", dir.unwrap_or(""), filename.unwrap_or(""))
354329
}
355330

356331
test::DynTestName(format_strbuf!("[{}] {}",
@@ -361,16 +336,14 @@ pub fn make_test_name(config: &Config, testfile: &Path) -> test::TestName {
361336
pub fn make_test_closure(config: &Config, testfile: &Path) -> test::TestFn {
362337
let config = (*config).clone();
363338
// FIXME (#9639): This needs to handle non-utf8 paths
364-
let testfile = testfile.as_str().unwrap().to_strbuf();
365-
test::DynTestFn(proc() {
366-
runtest::run(config, testfile)
367-
})
339+
let testfile = testfile.as_str().unwrap().to_owned();
340+
test::DynTestFn(proc() { runtest::run(config, testfile) })
368341
}
369342

370343
pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::TestFn {
371344
let config = (*config).clone();
372345
// FIXME (#9639): This needs to handle non-utf8 paths
373-
let testfile = testfile.as_str().unwrap().to_strbuf();
346+
let testfile = testfile.as_str().unwrap().to_owned();
374347
test::DynMetricFn(proc(mm) {
375348
runtest::run_metrics(config, testfile, mm)
376349
})

0 commit comments

Comments
 (0)