Skip to content

Commit a73a4d9

Browse files
committed
---
yaml --- r: 151693 b: refs/heads/try2 c: 6a2b3d1 h: refs/heads/master i: 151691: 5449b13 v: v3
1 parent c882bf4 commit a73a4d9

File tree

402 files changed

+7405
-3895
lines changed

Some content is hidden

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

402 files changed

+7405
-3895
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: 779875591681eea522e780f44ef5e30c429f513f
8+
refs/heads/try2: 6a2b3d14711771a02b1247ce664c67de1b68f2e6
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/man/rustc.1

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ A space-separated list of arguments to pass through to LLVM.
138138
If specified, the compiler will save more files (.bc, .o, .no-opt.bc) generated
139139
throughout compilation in the output directory.
140140
.TP
141-
\fBandroid-cross-path\fR=path/to/ndk/bin
142-
Directory to find the Android NDK cross-compilation tools
143-
.TP
144141
\fBno-rpath\fR
145142
If specified, then the rpath value for dynamic libraries will not be set in
146143
either dynamic library or executable outputs.

branches/try2/mk/docs.mk

Lines changed: 1 addition & 1 deletion
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
33+
guide-unsafe not_found
3434

3535
PDF_DOCS := tutorial rust
3636

branches/try2/mk/platform.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ CFG_LDPATH_arm-linux-androideabi :=
307307
CFG_RUN_arm-linux-androideabi=
308308
CFG_RUN_TARG_arm-linux-androideabi=
309309
RUSTC_FLAGS_arm-linux-androideabi :=
310-
RUSTC_CROSS_FLAGS_arm-linux-androideabi :=-C android-cross-path=$(CFG_ANDROID_CROSS_PATH)
310+
RUSTC_CROSS_FLAGS_arm-linux-androideabi :=
311311

312312
# arm-unknown-linux-gnueabihf configuration
313313
CROSS_PREFIX_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-

branches/try2/mk/tests.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
601601
--stage-id stage$(1)-$(2) \
602602
--target $(2) \
603603
--host $(3) \
604+
--android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
604605
--adb-path=$(CFG_ADB) \
605606
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
606607
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \

branches/try2/src/compiletest/common.rs

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,52 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use std::from_str::FromStr;
12+
use std::fmt;
13+
1114
#[deriving(Clone, Eq)]
12-
pub enum mode {
13-
mode_compile_fail,
14-
mode_run_fail,
15-
mode_run_pass,
16-
mode_pretty,
17-
mode_debug_info_gdb,
18-
mode_debug_info_lldb,
19-
mode_codegen
15+
pub enum Mode {
16+
CompileFail,
17+
RunFail,
18+
RunPass,
19+
Pretty,
20+
DebugInfoGdb,
21+
DebugInfoLldb,
22+
Codegen
23+
}
24+
25+
impl FromStr for Mode {
26+
fn from_str(s: &str) -> Option<Mode> {
27+
match s {
28+
"compile-fail" => Some(CompileFail),
29+
"run-fail" => Some(RunFail),
30+
"run-pass" => Some(RunPass),
31+
"pretty" => Some(Pretty),
32+
"debuginfo-lldb" => Some(DebugInfoLldb),
33+
"debuginfo-gdb" => Some(DebugInfoGdb),
34+
"codegen" => Some(Codegen),
35+
_ => None,
36+
}
37+
}
38+
}
39+
40+
impl fmt::Show for Mode {
41+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
42+
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",
50+
};
51+
write!(f.buf, "{}", msg)
52+
}
2053
}
2154

2255
#[deriving(Clone)]
23-
pub struct config {
56+
pub struct Config {
2457
// The library paths required for running the compiler
2558
pub compile_lib_path: ~str,
2659

@@ -49,7 +82,7 @@ pub struct config {
4982
pub stage_id: ~str,
5083

5184
// The test mode, compile-fail, run-fail, run-pass
52-
pub mode: mode,
85+
pub mode: Mode,
5386

5487
// Run ignored tests
5588
pub run_ignored: bool,
@@ -93,6 +126,9 @@ pub struct config {
93126
// Host triple for the compiler being invoked
94127
pub host: ~str,
95128

129+
// Path to the android tools
130+
pub android_cross_path: Path,
131+
96132
// Extra parameter to run adb on arm-linux-androideabi
97133
pub adb_path: ~str,
98134

branches/try2/src/compiletest/compiletest.rs

Lines changed: 32 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
// we use our own (green) start below; do not link in libnative; issue #13247.
1515
#![no_start]
1616

17-
#![allow(non_camel_case_types)]
1817
#![deny(warnings)]
1918

2019
extern crate test;
@@ -27,9 +26,10 @@ extern crate rustuv;
2726
use std::os;
2827
use std::io;
2928
use std::io::fs;
29+
use std::from_str::FromStr;
3030
use getopts::{optopt, optflag, reqopt};
31-
use common::{config, mode_run_pass, mode_run_fail, mode_compile_fail, mode_pretty,
32-
mode_debug_info_gdb, mode_debug_info_lldb, mode_codegen, mode};
31+
use common::Config;
32+
use common::{Pretty, DebugInfoGdb, Codegen};
3333
use util::logv;
3434

3535
pub mod procsrv;
@@ -51,7 +51,7 @@ pub fn main() {
5151
run_tests(&config);
5252
}
5353

54-
pub fn parse_config(args: Vec<~str> ) -> config {
54+
pub fn parse_config(args: Vec<~str> ) -> Config {
5555

5656
let groups : Vec<getopts::OptGroup> =
5757
vec!(reqopt("", "compile-lib-path", "path to host shared libraries", "PATH"),
@@ -79,6 +79,7 @@ pub fn parse_config(args: Vec<~str> ) -> config {
7979
optflag("", "jit", "run tests under the JIT"),
8080
optopt("", "target", "the target to build for", "TARGET"),
8181
optopt("", "host", "the host to build for", "HOST"),
82+
optopt("", "android-cross-path", "Android NDK standalone path", "PATH"),
8283
optopt("", "adb-path", "path to the android debugger", "PATH"),
8384
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
8485
optopt("", "lldb-python-dir", "directory containing LLDB's python module", "PATH"),
@@ -112,7 +113,7 @@ pub fn parse_config(args: Vec<~str> ) -> config {
112113
Path::new(m.opt_str(nm).unwrap())
113114
}
114115

115-
config {
116+
Config {
116117
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
117118
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
118119
rustc_path: opt_path(matches, "rustc-path"),
@@ -122,7 +123,7 @@ pub fn parse_config(args: Vec<~str> ) -> config {
122123
build_base: opt_path(matches, "build-base"),
123124
aux_base: opt_path(matches, "aux-base"),
124125
stage_id: matches.opt_str("stage-id").unwrap(),
125-
mode: str_mode(matches.opt_str("mode").unwrap()),
126+
mode: FromStr::from_str(matches.opt_str("mode").unwrap()).expect("invalid mode"),
126127
run_ignored: matches.opt_present("ignored"),
127128
filter:
128129
if !matches.free.is_empty() {
@@ -142,6 +143,7 @@ pub fn parse_config(args: Vec<~str> ) -> config {
142143
jit: matches.opt_present("jit"),
143144
target: opt_str2(matches.opt_str("target")).to_str(),
144145
host: opt_str2(matches.opt_str("host")).to_str(),
146+
android_cross_path: opt_path(matches, "android-cross-path"),
145147
adb_path: opt_str2(matches.opt_str("adb-path")).to_str(),
146148
adb_test_dir:
147149
opt_str2(matches.opt_str("adb-test-dir")).to_str(),
@@ -150,12 +152,13 @@ pub fn parse_config(args: Vec<~str> ) -> config {
150152
"(none)" != opt_str2(matches.opt_str("adb-test-dir")) &&
151153
!opt_str2(matches.opt_str("adb-test-dir")).is_empty(),
152154
lldb_python_dir: matches.opt_str("lldb-python-dir"),
153-
test_shard: test::opt_shard(matches.opt_str("test-shard")),
155+
test_shard: test::opt_shard(matches.opt_str("test-shard")
156+
.map(|x| x.to_strbuf())),
154157
verbose: matches.opt_present("verbose")
155158
}
156159
}
157160

158-
pub fn log_config(config: &config) {
161+
pub fn log_config(config: &Config) {
159162
let c = config;
160163
logv(c, format!("configuration:"));
161164
logv(c, format!("compile_lib_path: {}", config.compile_lib_path));
@@ -164,7 +167,7 @@ pub fn log_config(config: &config) {
164167
logv(c, format!("src_base: {}", config.src_base.display()));
165168
logv(c, format!("build_base: {}", config.build_base.display()));
166169
logv(c, format!("stage_id: {}", config.stage_id));
167-
logv(c, format!("mode: {}", mode_str(config.mode)));
170+
logv(c, format!("mode: {}", config.mode));
168171
logv(c, format!("run_ignored: {}", config.run_ignored));
169172
logv(c, format!("filter: {}", opt_str(&config.filter)));
170173
logv(c, format!("runtool: {}", opt_str(&config.runtool)));
@@ -173,6 +176,7 @@ pub fn log_config(config: &config) {
173176
logv(c, format!("jit: {}", config.jit));
174177
logv(c, format!("target: {}", config.target));
175178
logv(c, format!("host: {}", config.host));
179+
logv(c, format!("android-cross-path: {}", config.android_cross_path.display()));
176180
logv(c, format!("adb_path: {}", config.adb_path));
177181
logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
178182
logv(c, format!("adb_device_status: {}", config.adb_device_status));
@@ -198,35 +202,10 @@ pub fn opt_str2(maybestr: Option<~str>) -> ~str {
198202
match maybestr { None => "(none)".to_owned(), Some(s) => { s } }
199203
}
200204

201-
pub fn str_mode(s: ~str) -> mode {
202-
match s.as_slice() {
203-
"compile-fail" => mode_compile_fail,
204-
"run-fail" => mode_run_fail,
205-
"run-pass" => mode_run_pass,
206-
"pretty" => mode_pretty,
207-
"debuginfo-gdb" => mode_debug_info_gdb,
208-
"debuginfo-lldb" => mode_debug_info_lldb,
209-
"codegen" => mode_codegen,
210-
s => fail!("invalid mode: " + s)
211-
}
212-
}
213-
214-
pub fn mode_str(mode: mode) -> ~str {
215-
match mode {
216-
mode_compile_fail => "compile-fail".to_owned(),
217-
mode_run_fail => "run-fail".to_owned(),
218-
mode_run_pass => "run-pass".to_owned(),
219-
mode_pretty => "pretty".to_owned(),
220-
mode_debug_info_gdb => "debuginfo-gdb".to_owned(),
221-
mode_debug_info_lldb => "debuginfo-lldb".to_owned(),
222-
mode_codegen => "codegen".to_owned(),
223-
}
224-
}
225-
226-
pub fn run_tests(config: &config) {
205+
pub fn run_tests(config: &Config) {
227206
if config.target == "arm-linux-androideabi".to_owned() {
228-
match config.mode{
229-
mode_debug_info_gdb => {
207+
match config.mode {
208+
DebugInfoGdb => {
230209
println!("arm-linux-androideabi debug-info \
231210
test uses tcp 5039 port. please reserve it");
232211
}
@@ -255,9 +234,12 @@ pub fn run_tests(config: &config) {
255234
}
256235
}
257236

258-
pub fn test_opts(config: &config) -> test::TestOpts {
237+
pub fn test_opts(config: &Config) -> test::TestOpts {
259238
test::TestOpts {
260-
filter: config.filter.clone(),
239+
filter: match config.filter {
240+
None => None,
241+
Some(ref filter) => Some(filter.to_strbuf()),
242+
},
261243
run_ignored: config.run_ignored,
262244
logfile: config.logfile.clone(),
263245
run_tests: true,
@@ -270,7 +252,7 @@ pub fn test_opts(config: &config) -> test::TestOpts {
270252
}
271253
}
272254

273-
pub fn make_tests(config: &config) -> Vec<test::TestDescAndFn> {
255+
pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
274256
debug!("making tests from {}",
275257
config.src_base.display());
276258
let mut tests = Vec::new();
@@ -281,7 +263,7 @@ pub fn make_tests(config: &config) -> Vec<test::TestDescAndFn> {
281263
if is_test(config, &file) {
282264
let t = make_test(config, &file, || {
283265
match config.mode {
284-
mode_codegen => make_metrics_test_closure(config, &file),
266+
Codegen => make_metrics_test_closure(config, &file),
285267
_ => make_test_closure(config, &file)
286268
}
287269
});
@@ -291,11 +273,11 @@ pub fn make_tests(config: &config) -> Vec<test::TestDescAndFn> {
291273
tests
292274
}
293275

294-
pub fn is_test(config: &config, testfile: &Path) -> bool {
276+
pub fn is_test(config: &Config, testfile: &Path) -> bool {
295277
// Pretty-printer does not work with .rc files yet
296278
let valid_extensions =
297279
match config.mode {
298-
mode_pretty => vec!(".rs".to_owned()),
280+
Pretty => vec!(".rs".to_owned()),
299281
_ => vec!(".rc".to_owned(), ".rs".to_owned())
300282
};
301283
let invalid_prefixes = vec!(".".to_owned(), "#".to_owned(), "~".to_owned());
@@ -314,7 +296,7 @@ pub fn is_test(config: &config, testfile: &Path) -> bool {
314296
return valid;
315297
}
316298

317-
pub fn make_test(config: &config, testfile: &Path, f: || -> test::TestFn)
299+
pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
318300
-> test::TestDescAndFn {
319301
test::TestDescAndFn {
320302
desc: test::TestDesc {
@@ -326,7 +308,7 @@ pub fn make_test(config: &config, testfile: &Path, f: || -> test::TestFn)
326308
}
327309
}
328310

329-
pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
311+
pub fn make_test_name(config: &Config, testfile: &Path) -> test::TestName {
330312

331313
// Try to elide redundant long paths
332314
fn shorten(path: &Path) -> ~str {
@@ -336,19 +318,19 @@ pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
336318
format!("{}/{}", dir.unwrap_or(""), filename.unwrap_or(""))
337319
}
338320

339-
test::DynTestName(format!("[{}] {}",
340-
mode_str(config.mode),
341-
shorten(testfile)))
321+
test::DynTestName(format_strbuf!("[{}] {}",
322+
config.mode,
323+
shorten(testfile)))
342324
}
343325

344-
pub fn make_test_closure(config: &config, testfile: &Path) -> test::TestFn {
326+
pub fn make_test_closure(config: &Config, testfile: &Path) -> test::TestFn {
345327
let config = (*config).clone();
346328
// FIXME (#9639): This needs to handle non-utf8 paths
347329
let testfile = testfile.as_str().unwrap().to_owned();
348330
test::DynTestFn(proc() { runtest::run(config, testfile) })
349331
}
350332

351-
pub fn make_metrics_test_closure(config: &config, testfile: &Path) -> test::TestFn {
333+
pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::TestFn {
352334
let config = (*config).clone();
353335
// FIXME (#9639): This needs to handle non-utf8 paths
354336
let testfile = testfile.as_str().unwrap().to_owned();

0 commit comments

Comments
 (0)