Skip to content

Commit e8a503c

Browse files
committed
---
yaml --- r: 61285 b: refs/heads/try c: 01b7b7d h: refs/heads/master i: 61283: 608ca03 v: v3
1 parent dfdc30f commit e8a503c

File tree

255 files changed

+2319
-2540
lines changed

Some content is hidden

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

255 files changed

+2319
-2540
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: 043d02213e19c5a5cffb781e5a11accbe28bf0de
5+
refs/heads/try: 01b7b7d5a0feeb88b5dba1e295925a7564473685
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/configure

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,9 +695,6 @@ 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-
701698
# target bin dir
702699
make_dir $h/stage$i/$CFG_LIBDIR/rustc/$t/bin
703700

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)/stage$(1)/test/coretest-$(2)$$(X_$(2)): \
292+
$(3)/test/coretest.stage$(1)-$(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)/stage$(1)/test/stdtest-$(2)$$(X_$(2)): \
298+
$(3)/test/stdtest.stage$(1)-$(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)/stage$(1)/test/syntaxtest-$(2)$$(X_$(2)): \
304+
$(3)/test/syntaxtest.stage$(1)-$(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)/stage$(1)/test/rustctest-$(2)$$(X_$(2)): \
310+
$(3)/test/rustctest.stage$(1)-$(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)/stage$(1)/test/rustpkgtest-$(2)$$(X_$(2)): \
317+
$(3)/test/rustpkgtest.stage$(1)-$(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)/stage$(1)/test/rustitest-$(2)$$(X_$(2)): \
323+
$(3)/test/rustitest.stage$(1)-$(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)/stage$(1)/test/rusttest-$(2)$$(X_$(2)): \
329+
$(3)/test/rusttest.stage$(1)-$(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)/stage$(1)/test/rustdoctest-$(2)$$(X_$(2)): \
335+
$(3)/test/rustdoctest.stage$(1)-$(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)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
352+
$(3)/test/$(4)test.stage$(1)-$(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)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
363+
$(3)/test/$(4)test.stage$(1)-$(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)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
388+
$(3)/test/$(4)test.stage$(1)-$(2)$$(X_$(2))
389389
@$$(call E, run: skipped $$< )
390390
@touch $$@
391391
endef

branches/try/src/compiletest/compiletest.rc

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

1111
#[crate_type = "bin"];
1212

13+
#[allow(vecs_implicitly_copyable)];
1314
#[allow(non_camel_case_types)];
15+
#[allow(deprecated_pattern)];
1416

1517
extern mod std(vers = "0.7-pre");
1618

@@ -41,8 +43,8 @@ pub mod errors;
4143
pub fn main() {
4244
let args = os::args();
4345
let config = parse_config(args);
44-
log_config(&config);
45-
run_tests(&config);
46+
log_config(config);
47+
run_tests(config);
4648
}
4749

4850
pub fn parse_config(args: ~[~str]) -> config {
@@ -87,31 +89,30 @@ pub fn parse_config(args: ~[~str]) -> config {
8789
run_ignored: getopts::opt_present(matches, ~"ignored"),
8890
filter:
8991
if vec::len(matches.free) > 0u {
90-
option::Some(copy matches.free[0])
92+
option::Some(matches.free[0])
9193
} else { option::None },
9294
logfile: getopts::opt_maybe_str(matches, ~"logfile").map(|s| Path(*s)),
9395
runtool: getopts::opt_maybe_str(matches, ~"runtool"),
9496
rustcflags: getopts::opt_maybe_str(matches, ~"rustcflags"),
9597
jit: getopts::opt_present(matches, ~"jit"),
9698
newrt: getopts::opt_present(matches, ~"newrt"),
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(),
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")),
101102
adb_device_status:
102-
if (opt_str2(getopts::opt_maybe_str(matches, ~"target")) ==
103+
if (opt_str(getopts::opt_maybe_str(matches, ~"target")) ==
103104
~"arm-linux-androideabi") {
104-
if (opt_str2(getopts::opt_maybe_str(matches, ~"adb-test-dir")) !=
105+
if (opt_str(getopts::opt_maybe_str(matches, ~"adb-test-dir")) !=
105106
~"(none)" &&
106-
opt_str2(getopts::opt_maybe_str(matches, ~"adb-test-dir")) !=
107+
opt_str(getopts::opt_maybe_str(matches, ~"adb-test-dir")) !=
107108
~"") { true }
108109
else { false }
109110
} else { false },
110111
verbose: getopts::opt_present(matches, ~"verbose")
111112
}
112113
}
113114

114-
pub fn log_config(config: &config) {
115+
pub fn log_config(config: config) {
115116
let c = config;
116117
logv(c, fmt!("configuration:"));
117118
logv(c, fmt!("compile_lib_path: %s", config.compile_lib_path));
@@ -122,9 +123,9 @@ pub fn log_config(config: &config) {
122123
logv(c, fmt!("stage_id: %s", config.stage_id));
123124
logv(c, fmt!("mode: %s", mode_str(config.mode)));
124125
logv(c, fmt!("run_ignored: %b", config.run_ignored));
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)));
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)));
128129
logv(c, fmt!("jit: %b", config.jit));
129130
logv(c, fmt!("newrt: %b", config.newrt));
130131
logv(c, fmt!("target: %s", config.target));
@@ -135,18 +136,8 @@ pub fn log_config(config: &config) {
135136
logv(c, fmt!("\n"));
136137
}
137138

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 } }
139+
pub fn opt_str(maybestr: Option<~str>) -> ~str {
140+
match maybestr { option::Some(s) => s, option::None => ~"(none)" }
150141
}
151142

152143
pub fn str_opt(maybestr: ~str) -> Option<~str> {
@@ -160,7 +151,7 @@ pub fn str_mode(s: ~str) -> mode {
160151
~"run-pass" => mode_run_pass,
161152
~"pretty" => mode_pretty,
162153
~"debug-info" => mode_debug_info,
163-
_ => fail!("invalid mode")
154+
_ => fail!(~"invalid mode")
164155
}
165156
}
166157

@@ -174,16 +165,16 @@ pub fn mode_str(mode: mode) -> ~str {
174165
}
175166
}
176167

177-
pub fn run_tests(config: &config) {
168+
pub fn run_tests(config: config) {
178169
let opts = test_opts(config);
179170
let tests = make_tests(config);
180171
let res = test::run_tests_console(&opts, tests);
181-
if !res { fail!("Some tests failed"); }
172+
if !res { fail!(~"Some tests failed"); }
182173
}
183174

184-
pub fn test_opts(config: &config) -> test::TestOpts {
175+
pub fn test_opts(config: config) -> test::TestOpts {
185176
test::TestOpts {
186-
filter: copy config.filter,
177+
filter: config.filter,
187178
run_ignored: config.run_ignored,
188179
logfile: copy config.logfile,
189180
run_tests: true,
@@ -193,7 +184,7 @@ pub fn test_opts(config: &config) -> test::TestOpts {
193184
}
194185
}
195186

196-
pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
187+
pub fn make_tests(config: config) -> ~[test::TestDescAndFn] {
197188
debug!("making tests from %s",
198189
config.src_base.to_str());
199190
let mut tests = ~[];
@@ -207,7 +198,7 @@ pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
207198
tests
208199
}
209200

210-
pub fn is_test(config: &config, testfile: &Path) -> bool {
201+
pub fn is_test(config: config, testfile: &Path) -> bool {
211202
// Pretty-printer does not work with .rc files yet
212203
let valid_extensions =
213204
match config.mode {
@@ -230,7 +221,7 @@ pub fn is_test(config: &config, testfile: &Path) -> bool {
230221
return valid;
231222
}
232223

233-
pub fn make_test(config: &config, testfile: &Path) -> test::TestDescAndFn {
224+
pub fn make_test(config: config, testfile: &Path) -> test::TestDescAndFn {
234225
test::TestDescAndFn {
235226
desc: test::TestDesc {
236227
name: make_test_name(config, testfile),
@@ -241,15 +232,13 @@ pub fn make_test(config: &config, testfile: &Path) -> test::TestDescAndFn {
241232
}
242233
}
243234

244-
pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
235+
pub fn make_test_name(config: config, testfile: &Path) -> test::TestName {
245236
test::DynTestName(fmt!("[%s] %s",
246237
mode_str(config.mode),
247238
testfile.to_str()))
248239
}
249240

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()) })
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))
255244
}

0 commit comments

Comments
 (0)