Skip to content

Commit 12963af

Browse files
committed
---
yaml --- r: 113470 b: refs/heads/snap-stage3 c: 6ce7dfb h: refs/heads/master v: v3
1 parent afb9628 commit 12963af

File tree

142 files changed

+2240
-3860
lines changed

Some content is hidden

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

142 files changed

+2240
-3860
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: abdacecdf86b4b5a4f432560445a24e1c5f4751b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 03053580cafaded02e1ab450b6d5c5ff36ab3fa7
4+
refs/heads/snap-stage3: 6ce7dfb996e238e42af068f2d870087088c32675
55
refs/heads/try: 7c6c492fb2af9a85f21ff952942df3523b22fd17
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/man/rustc.1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ 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
141144
\fBno-rpath\fR
142145
If specified, then the rpath value for dynamic libraries will not be set in
143146
either dynamic library or executable outputs.

branches/snap-stage3/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 not_found
33+
guide-unsafe
3434

3535
PDF_DOCS := tutorial rust
3636

branches/snap-stage3/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 :=
310+
RUSTC_CROSS_FLAGS_arm-linux-androideabi :=-C android-cross-path=$(CFG_ANDROID_CROSS_PATH)
311311

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

branches/snap-stage3/mk/tests.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,6 @@ 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) \
605604
--adb-path=$(CFG_ADB) \
606605
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
607606
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \

branches/snap-stage3/src/compiletest/common.rs

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,19 @@
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-
1411
#[deriving(Clone, Eq)]
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-
}
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
5320
}
5421

5522
#[deriving(Clone)]
56-
pub struct Config {
23+
pub struct config {
5724
// The library paths required for running the compiler
5825
pub compile_lib_path: ~str,
5926

@@ -82,7 +49,7 @@ pub struct Config {
8249
pub stage_id: ~str,
8350

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

8754
// Run ignored tests
8855
pub run_ignored: bool,
@@ -126,9 +93,6 @@ pub struct Config {
12693
// Host triple for the compiler being invoked
12794
pub host: ~str,
12895

129-
// Path to the android tools
130-
pub android_cross_path: Path,
131-
13296
// Extra parameter to run adb on arm-linux-androideabi
13397
pub adb_path: ~str,
13498

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
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)]
1718
#![deny(warnings)]
1819

1920
extern crate test;
@@ -26,10 +27,9 @@ extern crate rustuv;
2627
use std::os;
2728
use std::io;
2829
use std::io::fs;
29-
use std::from_str::FromStr;
3030
use getopts::{optopt, optflag, reqopt};
31-
use common::Config;
32-
use common::{Pretty, DebugInfoGdb, Codegen};
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};
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,7 +79,6 @@ 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"),
8382
optopt("", "adb-path", "path to the android debugger", "PATH"),
8483
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
8584
optopt("", "lldb-python-dir", "directory containing LLDB's python module", "PATH"),
@@ -113,7 +112,7 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
113112
Path::new(m.opt_str(nm).unwrap())
114113
}
115114

116-
Config {
115+
config {
117116
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
118117
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
119118
rustc_path: opt_path(matches, "rustc-path"),
@@ -123,7 +122,7 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
123122
build_base: opt_path(matches, "build-base"),
124123
aux_base: opt_path(matches, "aux-base"),
125124
stage_id: matches.opt_str("stage-id").unwrap(),
126-
mode: FromStr::from_str(matches.opt_str("mode").unwrap()).expect("invalid mode"),
125+
mode: str_mode(matches.opt_str("mode").unwrap()),
127126
run_ignored: matches.opt_present("ignored"),
128127
filter:
129128
if !matches.free.is_empty() {
@@ -143,7 +142,6 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
143142
jit: matches.opt_present("jit"),
144143
target: opt_str2(matches.opt_str("target")).to_str(),
145144
host: opt_str2(matches.opt_str("host")).to_str(),
146-
android_cross_path: opt_path(matches, "android-cross-path"),
147145
adb_path: opt_str2(matches.opt_str("adb-path")).to_str(),
148146
adb_test_dir:
149147
opt_str2(matches.opt_str("adb-test-dir")).to_str(),
@@ -157,7 +155,7 @@ pub fn parse_config(args: Vec<~str> ) -> Config {
157155
}
158156
}
159157

160-
pub fn log_config(config: &Config) {
158+
pub fn log_config(config: &config) {
161159
let c = config;
162160
logv(c, format!("configuration:"));
163161
logv(c, format!("compile_lib_path: {}", config.compile_lib_path));
@@ -166,7 +164,7 @@ pub fn log_config(config: &Config) {
166164
logv(c, format!("src_base: {}", config.src_base.display()));
167165
logv(c, format!("build_base: {}", config.build_base.display()));
168166
logv(c, format!("stage_id: {}", config.stage_id));
169-
logv(c, format!("mode: {}", config.mode));
167+
logv(c, format!("mode: {}", mode_str(config.mode)));
170168
logv(c, format!("run_ignored: {}", config.run_ignored));
171169
logv(c, format!("filter: {}", opt_str(&config.filter)));
172170
logv(c, format!("runtool: {}", opt_str(&config.runtool)));
@@ -175,7 +173,6 @@ pub fn log_config(config: &Config) {
175173
logv(c, format!("jit: {}", config.jit));
176174
logv(c, format!("target: {}", config.target));
177175
logv(c, format!("host: {}", config.host));
178-
logv(c, format!("android-cross-path: {}", config.android_cross_path.display()));
179176
logv(c, format!("adb_path: {}", config.adb_path));
180177
logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
181178
logv(c, format!("adb_device_status: {}", config.adb_device_status));
@@ -201,10 +198,35 @@ pub fn opt_str2(maybestr: Option<~str>) -> ~str {
201198
match maybestr { None => "(none)".to_owned(), Some(s) => { s } }
202199
}
203200

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

236-
pub fn test_opts(config: &Config) -> test::TestOpts {
258+
pub fn test_opts(config: &config) -> test::TestOpts {
237259
test::TestOpts {
238260
filter: config.filter.clone(),
239261
run_ignored: config.run_ignored,
@@ -248,7 +270,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
248270
}
249271
}
250272

251-
pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
273+
pub fn make_tests(config: &config) -> Vec<test::TestDescAndFn> {
252274
debug!("making tests from {}",
253275
config.src_base.display());
254276
let mut tests = Vec::new();
@@ -259,7 +281,7 @@ pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
259281
if is_test(config, &file) {
260282
let t = make_test(config, &file, || {
261283
match config.mode {
262-
Codegen => make_metrics_test_closure(config, &file),
284+
mode_codegen => make_metrics_test_closure(config, &file),
263285
_ => make_test_closure(config, &file)
264286
}
265287
});
@@ -269,11 +291,11 @@ pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
269291
tests
270292
}
271293

272-
pub fn is_test(config: &Config, testfile: &Path) -> bool {
294+
pub fn is_test(config: &config, testfile: &Path) -> bool {
273295
// Pretty-printer does not work with .rc files yet
274296
let valid_extensions =
275297
match config.mode {
276-
Pretty => vec!(".rs".to_owned()),
298+
mode_pretty => vec!(".rs".to_owned()),
277299
_ => vec!(".rc".to_owned(), ".rs".to_owned())
278300
};
279301
let invalid_prefixes = vec!(".".to_owned(), "#".to_owned(), "~".to_owned());
@@ -292,7 +314,7 @@ pub fn is_test(config: &Config, testfile: &Path) -> bool {
292314
return valid;
293315
}
294316

295-
pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
317+
pub fn make_test(config: &config, testfile: &Path, f: || -> test::TestFn)
296318
-> test::TestDescAndFn {
297319
test::TestDescAndFn {
298320
desc: test::TestDesc {
@@ -304,7 +326,7 @@ pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
304326
}
305327
}
306328

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

309331
// Try to elide redundant long paths
310332
fn shorten(path: &Path) -> ~str {
@@ -314,17 +336,19 @@ pub fn make_test_name(config: &Config, testfile: &Path) -> test::TestName {
314336
format!("{}/{}", dir.unwrap_or(""), filename.unwrap_or(""))
315337
}
316338

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

320-
pub fn make_test_closure(config: &Config, testfile: &Path) -> test::TestFn {
344+
pub fn make_test_closure(config: &config, testfile: &Path) -> test::TestFn {
321345
let config = (*config).clone();
322346
// FIXME (#9639): This needs to handle non-utf8 paths
323347
let testfile = testfile.as_str().unwrap().to_owned();
324348
test::DynTestFn(proc() { runtest::run(config, testfile) })
325349
}
326350

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

0 commit comments

Comments
 (0)