Skip to content

Commit c0652bd

Browse files
committed
---
yaml --- r: 61307 b: refs/heads/try c: c30414f h: refs/heads/master i: 61305: 1f12d1b 61303: e201b8e v: v3
1 parent 9d834c9 commit c0652bd

File tree

264 files changed

+3113
-3486
lines changed

Some content is hidden

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

264 files changed

+3113
-3486
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2d28d645422c1617be58c8ca7ad9a457264ca850
5-
refs/heads/try: ee0ce64d9db10aebc491454b6595d6edf69fe513
5+
refs/heads/try: c30414f980eb3e8010640f6c83a5ef6f8e6ab047
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/configure

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,9 @@ do
695695
# host lib dir
696696
make_dir $h/stage$i/$CFG_LIBDIR
697697

698+
# host test dir
699+
make_dir $h/stage$i/test
700+
698701
# target bin dir
699702
make_dir $h/stage$i/$CFG_LIBDIR/rustc/$t/bin
700703

branches/try/doc/rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,9 +2386,9 @@ enum List<X> { Nil, Cons(X, @List<X>) }
23862386
let x: List<int> = Cons(10, @Cons(11, @Nil));
23872387
23882388
match x {
2389-
Cons(_, @Nil) => fail!(~"singleton list"),
2389+
Cons(_, @Nil) => fail!("singleton list"),
23902390
Cons(*) => return,
2391-
Nil => fail!(~"empty list")
2391+
Nil => fail!("empty list")
23922392
}
23932393
~~~~
23942394

branches/try/doc/tutorial-macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ match x {
223223
// complicated stuff goes here
224224
return result + val;
225225
},
226-
_ => fail!(~"Didn't get good_2")
226+
_ => fail!("Didn't get good_2")
227227
}
228228
}
229229
_ => return 0 // default value
@@ -265,7 +265,7 @@ macro_rules! biased_match (
265265
biased_match!((x) ~ (good_1(g1, val)) else { return 0 };
266266
binds g1, val )
267267
biased_match!((g1.body) ~ (good_2(result) )
268-
else { fail!(~"Didn't get good_2") };
268+
else { fail!("Didn't get good_2") };
269269
binds result )
270270
// complicated stuff goes here
271271
return result + val;
@@ -366,7 +366,7 @@ macro_rules! biased_match (
366366
# fn f(x: t1) -> uint {
367367
biased_match!(
368368
(x) ~ (good_1(g1, val)) else { return 0 };
369-
(g1.body) ~ (good_2(result) ) else { fail!(~"Didn't get good_2") };
369+
(g1.body) ~ (good_2(result) ) else { fail!("Didn't get good_2") };
370370
binds val, result )
371371
// complicated stuff goes here
372372
return result + val;

branches/try/doc/tutorial-tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ let result: Result<int, ()> = do task::try {
325325
if some_condition() {
326326
calculate_result()
327327
} else {
328-
fail!(~"oops!");
328+
fail!("oops!");
329329
}
330330
};
331331
assert!(result.is_err());

branches/try/mk/tests.mk

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -289,50 +289,50 @@ else
289289
STDTESTDEP_$(1)_$(2)_$(3) =
290290
endif
291291

292-
$(3)/test/coretest.stage$(1)-$(2)$$(X_$(2)): \
292+
$(3)/stage$(1)/test/coretest-$(2)$$(X_$(2)): \
293293
$$(CORELIB_CRATE) $$(CORELIB_INPUTS) \
294294
$$(STDTESTDEP_$(1)_$(2)_$(3))
295295
@$$(call E, compile_and_link: $$@)
296296
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
297297

298-
$(3)/test/stdtest.stage$(1)-$(2)$$(X_$(2)): \
298+
$(3)/stage$(1)/test/stdtest-$(2)$$(X_$(2)): \
299299
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
300300
$$(STDTESTDEP_$(1)_$(2)_$(3))
301301
@$$(call E, compile_and_link: $$@)
302302
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
303303

304-
$(3)/test/syntaxtest.stage$(1)-$(2)$$(X_$(2)): \
304+
$(3)/stage$(1)/test/syntaxtest-$(2)$$(X_$(2)): \
305305
$$(LIBSYNTAX_CRATE) $$(LIBSYNTAX_INPUTS) \
306306
$$(STDTESTDEP_$(1)_$(2)_$(3))
307307
@$$(call E, compile_and_link: $$@)
308308
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
309309

310-
$(3)/test/rustctest.stage$(1)-$(2)$$(X_$(2)): \
310+
$(3)/stage$(1)/test/rustctest-$(2)$$(X_$(2)): \
311311
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
312312
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM_$(2)) \
313313
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBSYNTAX_$(2))
314314
@$$(call E, compile_and_link: $$@)
315315
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
316316

317-
$(3)/test/rustpkgtest.stage$(1)-$(2)$$(X_$(2)): \
317+
$(3)/stage$(1)/test/rustpkgtest-$(2)$$(X_$(2)): \
318318
$$(RUSTPKG_LIB) $$(RUSTPKG_INPUTS) \
319319
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC_$(2))
320320
@$$(call E, compile_and_link: $$@)
321321
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
322322

323-
$(3)/test/rustitest.stage$(1)-$(2)$$(X_$(2)): \
323+
$(3)/stage$(1)/test/rustitest-$(2)$$(X_$(2)): \
324324
$$(RUSTI_LIB) $$(RUSTI_INPUTS) \
325325
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC_$(2))
326326
@$$(call E, compile_and_link: $$@)
327327
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
328328

329-
$(3)/test/rusttest.stage$(1)-$(2)$$(X_$(2)): \
329+
$(3)/stage$(1)/test/rusttest-$(2)$$(X_$(2)): \
330330
$$(RUST_LIB) $$(RUST_INPUTS) \
331331
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC_$(2))
332332
@$$(call E, compile_and_link: $$@)
333333
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
334334

335-
$(3)/test/rustdoctest.stage$(1)-$(2)$$(X_$(2)): \
335+
$(3)/stage$(1)/test/rustdoctest-$(2)$$(X_$(2)): \
336336
$$(RUSTDOC_LIB) $$(RUSTDOC_INPUTS) \
337337
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC_$(2))
338338
@$$(call E, compile_and_link: $$@)
@@ -349,7 +349,7 @@ define DEF_TEST_CRATE_RULES
349349
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
350350

351351
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
352-
$(3)/test/$(4)test.stage$(1)-$(2)$$(X_$(2))
352+
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
353353
@$$(call E, run: $$<)
354354
$$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(2),$(3)) $$(TESTARGS) \
355355
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
@@ -360,7 +360,7 @@ define DEF_TEST_CRATE_RULES_arm-linux-androideabi
360360
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
361361

362362
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
363-
$(3)/test/$(4)test.stage$(1)-$(2)$$(X_$(2))
363+
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
364364
@$$(call E, run: $$< via adb)
365365
@$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
366366
@$(CFG_ADB) shell LD_LIBRARY_PATH=$(CFG_ADB_TEST_DIR) \
@@ -385,7 +385,7 @@ define DEF_TEST_CRATE_RULES_null
385385
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
386386

387387
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
388-
$(3)/test/$(4)test.stage$(1)-$(2)$$(X_$(2))
388+
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
389389
@$$(call E, run: skipped $$< )
390390
@touch $$@
391391
endef

branches/try/src/compiletest/compiletest.rc

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

1111
#[crate_type = "bin"];
1212

13-
#[allow(vecs_implicitly_copyable)];
1413
#[allow(non_camel_case_types)];
15-
#[allow(deprecated_pattern)];
1614

1715
extern mod std(vers = "0.7-pre");
1816

@@ -43,8 +41,8 @@ pub mod errors;
4341
pub fn main() {
4442
let args = os::args();
4543
let config = parse_config(args);
46-
log_config(config);
47-
run_tests(config);
44+
log_config(&config);
45+
run_tests(&config);
4846
}
4947

5048
pub fn parse_config(args: ~[~str]) -> config {
@@ -89,30 +87,31 @@ pub fn parse_config(args: ~[~str]) -> config {
8987
run_ignored: getopts::opt_present(matches, ~"ignored"),
9088
filter:
9189
if vec::len(matches.free) > 0u {
92-
option::Some(matches.free[0])
90+
option::Some(copy matches.free[0])
9391
} else { option::None },
9492
logfile: getopts::opt_maybe_str(matches, ~"logfile").map(|s| Path(*s)),
9593
runtool: getopts::opt_maybe_str(matches, ~"runtool"),
9694
rustcflags: getopts::opt_maybe_str(matches, ~"rustcflags"),
9795
jit: getopts::opt_present(matches, ~"jit"),
9896
newrt: getopts::opt_present(matches, ~"newrt"),
99-
target: opt_str(getopts::opt_maybe_str(matches, ~"target")),
100-
adb_path: opt_str(getopts::opt_maybe_str(matches, ~"adb-path")),
101-
adb_test_dir: opt_str(getopts::opt_maybe_str(matches, ~"adb-test-dir")),
97+
target: opt_str2(getopts::opt_maybe_str(matches, ~"target")).to_str(),
98+
adb_path: opt_str2(getopts::opt_maybe_str(matches, ~"adb-path")).to_str(),
99+
adb_test_dir:
100+
opt_str2(getopts::opt_maybe_str(matches, ~"adb-test-dir")).to_str(),
102101
adb_device_status:
103-
if (opt_str(getopts::opt_maybe_str(matches, ~"target")) ==
102+
if (opt_str2(getopts::opt_maybe_str(matches, ~"target")) ==
104103
~"arm-linux-androideabi") {
105-
if (opt_str(getopts::opt_maybe_str(matches, ~"adb-test-dir")) !=
104+
if (opt_str2(getopts::opt_maybe_str(matches, ~"adb-test-dir")) !=
106105
~"(none)" &&
107-
opt_str(getopts::opt_maybe_str(matches, ~"adb-test-dir")) !=
106+
opt_str2(getopts::opt_maybe_str(matches, ~"adb-test-dir")) !=
108107
~"") { true }
109108
else { false }
110109
} else { false },
111110
verbose: getopts::opt_present(matches, ~"verbose")
112111
}
113112
}
114113

115-
pub fn log_config(config: config) {
114+
pub fn log_config(config: &config) {
116115
let c = config;
117116
logv(c, fmt!("configuration:"));
118117
logv(c, fmt!("compile_lib_path: %s", config.compile_lib_path));
@@ -123,9 +122,9 @@ pub fn log_config(config: config) {
123122
logv(c, fmt!("stage_id: %s", config.stage_id));
124123
logv(c, fmt!("mode: %s", mode_str(config.mode)));
125124
logv(c, fmt!("run_ignored: %b", config.run_ignored));
126-
logv(c, fmt!("filter: %s", opt_str(config.filter)));
127-
logv(c, fmt!("runtool: %s", opt_str(config.runtool)));
128-
logv(c, fmt!("rustcflags: %s", opt_str(config.rustcflags)));
125+
logv(c, fmt!("filter: %s", opt_str(&config.filter)));
126+
logv(c, fmt!("runtool: %s", opt_str(&config.runtool)));
127+
logv(c, fmt!("rustcflags: %s", opt_str(&config.rustcflags)));
129128
logv(c, fmt!("jit: %b", config.jit));
130129
logv(c, fmt!("newrt: %b", config.newrt));
131130
logv(c, fmt!("target: %s", config.target));
@@ -136,8 +135,18 @@ pub fn log_config(config: config) {
136135
logv(c, fmt!("\n"));
137136
}
138137

139-
pub fn opt_str(maybestr: Option<~str>) -> ~str {
140-
match maybestr { option::Some(s) => s, option::None => ~"(none)" }
138+
pub fn opt_str<'a>(maybestr: &'a Option<~str>) -> &'a str {
139+
match *maybestr {
140+
option::None => "(none)",
141+
option::Some(ref s) => {
142+
let s: &'a str = *s;
143+
s
144+
}
145+
}
146+
}
147+
148+
pub fn opt_str2(maybestr: Option<~str>) -> ~str {
149+
match maybestr { None => ~"(none)", Some(s) => { s } }
141150
}
142151

143152
pub fn str_opt(maybestr: ~str) -> Option<~str> {
@@ -151,7 +160,7 @@ pub fn str_mode(s: ~str) -> mode {
151160
~"run-pass" => mode_run_pass,
152161
~"pretty" => mode_pretty,
153162
~"debug-info" => mode_debug_info,
154-
_ => fail!(~"invalid mode")
163+
_ => fail!("invalid mode")
155164
}
156165
}
157166

@@ -165,16 +174,16 @@ pub fn mode_str(mode: mode) -> ~str {
165174
}
166175
}
167176

168-
pub fn run_tests(config: config) {
177+
pub fn run_tests(config: &config) {
169178
let opts = test_opts(config);
170179
let tests = make_tests(config);
171180
let res = test::run_tests_console(&opts, tests);
172-
if !res { fail!(~"Some tests failed"); }
181+
if !res { fail!("Some tests failed"); }
173182
}
174183

175-
pub fn test_opts(config: config) -> test::TestOpts {
184+
pub fn test_opts(config: &config) -> test::TestOpts {
176185
test::TestOpts {
177-
filter: config.filter,
186+
filter: copy config.filter,
178187
run_ignored: config.run_ignored,
179188
logfile: copy config.logfile,
180189
run_tests: true,
@@ -184,7 +193,7 @@ pub fn test_opts(config: config) -> test::TestOpts {
184193
}
185194
}
186195

187-
pub fn make_tests(config: config) -> ~[test::TestDescAndFn] {
196+
pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
188197
debug!("making tests from %s",
189198
config.src_base.to_str());
190199
let mut tests = ~[];
@@ -198,7 +207,7 @@ pub fn make_tests(config: config) -> ~[test::TestDescAndFn] {
198207
tests
199208
}
200209

201-
pub fn is_test(config: config, testfile: &Path) -> bool {
210+
pub fn is_test(config: &config, testfile: &Path) -> bool {
202211
// Pretty-printer does not work with .rc files yet
203212
let valid_extensions =
204213
match config.mode {
@@ -221,7 +230,7 @@ pub fn is_test(config: config, testfile: &Path) -> bool {
221230
return valid;
222231
}
223232

224-
pub fn make_test(config: config, testfile: &Path) -> test::TestDescAndFn {
233+
pub fn make_test(config: &config, testfile: &Path) -> test::TestDescAndFn {
225234
test::TestDescAndFn {
226235
desc: test::TestDesc {
227236
name: make_test_name(config, testfile),
@@ -232,13 +241,15 @@ pub fn make_test(config: config, testfile: &Path) -> test::TestDescAndFn {
232241
}
233242
}
234243

235-
pub fn make_test_name(config: config, testfile: &Path) -> test::TestName {
244+
pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
236245
test::DynTestName(fmt!("[%s] %s",
237246
mode_str(config.mode),
238247
testfile.to_str()))
239248
}
240249

241-
pub fn make_test_closure(config: config, testfile: &Path) -> test::TestFn {
242-
let testfile = testfile.to_str();
243-
test::DynTestFn(|| runtest::run(config, testfile))
250+
pub fn make_test_closure(config: &config, testfile: &Path) -> test::TestFn {
251+
use core::cell::Cell;
252+
let config = Cell(copy *config);
253+
let testfile = Cell(testfile.to_str());
254+
test::DynTestFn(|| { runtest::run(config.take(), testfile.take()) })
244255
}

0 commit comments

Comments
 (0)