Skip to content

Commit 0fea676

Browse files
committed
---
yaml --- r: 67300 b: refs/heads/master c: c3417b8 h: refs/heads/master v: v3
1 parent c1a3fca commit 0fea676

File tree

4 files changed

+26
-15
lines changed

4 files changed

+26
-15
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: b30a16c9aefbc568f67c8121f170b6d478102c5f
2+
refs/heads/master: c3417b88aa20f835a5c19dc5d8539eb33f2802b9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/mk/tests.mk

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,6 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
537537

538538
# Rules for the cfail/rfail/rpass/bench/perf test runner
539539

540-
# The tests select when to use debug configuration on their own;
541-
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
542-
CTEST_RUSTC_FLAGS = $$(subst --cfg debug,,$$(CFG_RUSTC_FLAGS))
543-
544540
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
545541
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
546542
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
@@ -552,7 +548,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
552548
--target $(2) \
553549
--adb-path=$(CFG_ADB) \
554550
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
555-
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) --target=$(2)" \
551+
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CFG_RUSTC_FLAGS) --target=$(2)" \
556552
$$(CTEST_TESTARGS)
557553

558554
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)

trunk/src/libsyntax/parse/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,10 @@ mod test {
384384
span:sp(0,6)})
385385
}
386386

387-
// FIXME (#6416): For some reason, this fails and causes a test failure, even though it's
388-
// marked as `#[should_fail]`.
389-
/*#[should_fail]
387+
#[should_fail]
390388
#[test] fn bad_path_expr_1() {
391389
string_to_expr(@"::abc::def::return");
392-
}*/
390+
}
393391

394392
#[test] fn string_to_tts_1 () {
395393
let (tts,_ps) = string_to_tts_and_sess(@"fn a (b : int) { b; }");

trunk/src/libsyntax/util/parser_testing.rs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,46 @@ pub fn string_to_parser(source_str: @str) -> Parser {
3333
p
3434
}
3535

36+
fn with_error_checking_parse<T>(s: @str, f: &fn(&mut Parser) -> T) -> T {
37+
let mut p = string_to_parser(s);
38+
let x = f(&mut p);
39+
p.abort_if_errors();
40+
x
41+
}
42+
3643
pub fn string_to_crate (source_str : @str) -> @ast::Crate {
37-
string_to_parser(source_str).parse_crate_mod()
44+
do with_error_checking_parse(source_str) |p| {
45+
p.parse_crate_mod()
46+
}
3847
}
3948

4049
// parse a string, return an expr
4150
pub fn string_to_expr (source_str : @str) -> @ast::expr {
42-
string_to_parser(source_str).parse_expr()
51+
do with_error_checking_parse(source_str) |p| {
52+
p.parse_expr()
53+
}
4354
}
4455

4556
// parse a string, return an item
4657
pub fn string_to_item (source_str : @str) -> Option<@ast::item> {
47-
string_to_parser(source_str).parse_item(~[])
58+
do with_error_checking_parse(source_str) |p| {
59+
p.parse_item(~[])
60+
}
4861
}
4962

5063
// parse a string, return an item and the ParseSess
5164
pub fn string_to_item_and_sess (source_str : @str) -> (Option<@ast::item>,@mut ParseSess) {
5265
let (p,ps) = string_to_parser_and_sess(source_str);
53-
(p.parse_item(~[]),ps)
66+
let io = p.parse_item(~[]);
67+
p.abort_if_errors();
68+
(io,ps)
5469
}
5570

5671
// parse a string, return a stmt
5772
pub fn string_to_stmt(source_str : @str) -> @ast::stmt {
58-
string_to_parser(source_str).parse_stmt(~[])
73+
do with_error_checking_parse(source_str) |p| {
74+
p.parse_stmt(~[])
75+
}
5976
}
6077

6178
// parse a string, return a pat. Uses "irrefutable"... which doesn't

0 commit comments

Comments
 (0)