Skip to content

Commit c6524c5

Browse files
committed
---
yaml --- r: 114127 b: refs/heads/master c: 2a7a391 h: refs/heads/master i: 114125: 80847d5 114123: c9e1939 114119: f2d3594 114111: 242db8a v: v3
1 parent d8d014a commit c6524c5

File tree

150 files changed

+3494
-1931
lines changed

Some content is hidden

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

150 files changed

+3494
-1931
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 595e2910d8132170dab30fd31fc09800609188a8
2+
refs/heads/master: 2a7a39191a83fc2a63df6cb47acd344ae669d9c7
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ec0258a381b88b5574e3f8ce72ae553ac3a574b7
55
refs/heads/try: 7c6c492fb2af9a85f21ff952942df3523b22fd17

trunk/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.

trunk/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

trunk/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-

trunk/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))" \

trunk/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

trunk/src/compiletest/compiletest.rs

Lines changed: 24 additions & 48 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(),
@@ -155,7 +157,7 @@ pub fn parse_config(args: Vec<~str> ) -> config {
155157
}
156158
}
157159

158-
pub fn log_config(config: &config) {
160+
pub fn log_config(config: &Config) {
159161
let c = config;
160162
logv(c, format!("configuration:"));
161163
logv(c, format!("compile_lib_path: {}", config.compile_lib_path));
@@ -164,7 +166,7 @@ pub fn log_config(config: &config) {
164166
logv(c, format!("src_base: {}", config.src_base.display()));
165167
logv(c, format!("build_base: {}", config.build_base.display()));
166168
logv(c, format!("stage_id: {}", config.stage_id));
167-
logv(c, format!("mode: {}", mode_str(config.mode)));
169+
logv(c, format!("mode: {}", config.mode));
168170
logv(c, format!("run_ignored: {}", config.run_ignored));
169171
logv(c, format!("filter: {}", opt_str(&config.filter)));
170172
logv(c, format!("runtool: {}", opt_str(&config.runtool)));
@@ -173,6 +175,7 @@ pub fn log_config(config: &config) {
173175
logv(c, format!("jit: {}", config.jit));
174176
logv(c, format!("target: {}", config.target));
175177
logv(c, format!("host: {}", config.host));
178+
logv(c, format!("android-cross-path: {}", config.android_cross_path.display()));
176179
logv(c, format!("adb_path: {}", config.adb_path));
177180
logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
178181
logv(c, format!("adb_device_status: {}", config.adb_device_status));
@@ -198,35 +201,10 @@ pub fn opt_str2(maybestr: Option<~str>) -> ~str {
198201
match maybestr { None => "(none)".to_owned(), Some(s) => { s } }
199202
}
200203

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) {
204+
pub fn run_tests(config: &Config) {
227205
if config.target == "arm-linux-androideabi".to_owned() {
228-
match config.mode{
229-
mode_debug_info_gdb => {
206+
match config.mode {
207+
DebugInfoGdb => {
230208
println!("arm-linux-androideabi debug-info \
231209
test uses tcp 5039 port. please reserve it");
232210
}
@@ -255,7 +233,7 @@ pub fn run_tests(config: &config) {
255233
}
256234
}
257235

258-
pub fn test_opts(config: &config) -> test::TestOpts {
236+
pub fn test_opts(config: &Config) -> test::TestOpts {
259237
test::TestOpts {
260238
filter: config.filter.clone(),
261239
run_ignored: config.run_ignored,
@@ -270,7 +248,7 @@ pub fn test_opts(config: &config) -> test::TestOpts {
270248
}
271249
}
272250

273-
pub fn make_tests(config: &config) -> Vec<test::TestDescAndFn> {
251+
pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
274252
debug!("making tests from {}",
275253
config.src_base.display());
276254
let mut tests = Vec::new();
@@ -281,7 +259,7 @@ pub fn make_tests(config: &config) -> Vec<test::TestDescAndFn> {
281259
if is_test(config, &file) {
282260
let t = make_test(config, &file, || {
283261
match config.mode {
284-
mode_codegen => make_metrics_test_closure(config, &file),
262+
Codegen => make_metrics_test_closure(config, &file),
285263
_ => make_test_closure(config, &file)
286264
}
287265
});
@@ -291,11 +269,11 @@ pub fn make_tests(config: &config) -> Vec<test::TestDescAndFn> {
291269
tests
292270
}
293271

294-
pub fn is_test(config: &config, testfile: &Path) -> bool {
272+
pub fn is_test(config: &Config, testfile: &Path) -> bool {
295273
// Pretty-printer does not work with .rc files yet
296274
let valid_extensions =
297275
match config.mode {
298-
mode_pretty => vec!(".rs".to_owned()),
276+
Pretty => vec!(".rs".to_owned()),
299277
_ => vec!(".rc".to_owned(), ".rs".to_owned())
300278
};
301279
let invalid_prefixes = vec!(".".to_owned(), "#".to_owned(), "~".to_owned());
@@ -314,7 +292,7 @@ pub fn is_test(config: &config, testfile: &Path) -> bool {
314292
return valid;
315293
}
316294

317-
pub fn make_test(config: &config, testfile: &Path, f: || -> test::TestFn)
295+
pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
318296
-> test::TestDescAndFn {
319297
test::TestDescAndFn {
320298
desc: test::TestDesc {
@@ -326,7 +304,7 @@ pub fn make_test(config: &config, testfile: &Path, f: || -> test::TestFn)
326304
}
327305
}
328306

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

331309
// Try to elide redundant long paths
332310
fn shorten(path: &Path) -> ~str {
@@ -336,19 +314,17 @@ pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
336314
format!("{}/{}", dir.unwrap_or(""), filename.unwrap_or(""))
337315
}
338316

339-
test::DynTestName(format!("[{}] {}",
340-
mode_str(config.mode),
341-
shorten(testfile)))
317+
test::DynTestName(format!("[{}] {}", config.mode, shorten(testfile)))
342318
}
343319

344-
pub fn make_test_closure(config: &config, testfile: &Path) -> test::TestFn {
320+
pub fn make_test_closure(config: &Config, testfile: &Path) -> test::TestFn {
345321
let config = (*config).clone();
346322
// FIXME (#9639): This needs to handle non-utf8 paths
347323
let testfile = testfile.as_str().unwrap().to_owned();
348324
test::DynTestFn(proc() { runtest::run(config, testfile) })
349325
}
350326

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

0 commit comments

Comments
 (0)