Skip to content

Commit cecff5f

Browse files
committed
---
yaml --- r: 15748 b: refs/heads/try c: 37f2330 h: refs/heads/master v: v3
1 parent 29d39e3 commit cecff5f

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 82d4fe3967a6e6b7bde5d70644cf3eca23763932
5+
refs/heads/try: 37f23303e63b16c1b9b2726d8dc464c44580abb1
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/compiletest/header.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn load_props(testfile: str) -> test_props {
2929
let mut exec_env = [];
3030
let mut compile_flags = option::none;
3131
let mut pp_exact = option::none;
32-
iter_header(testfile) {|ln|
32+
for iter_header(testfile) {|ln|
3333
alt parse_error_pattern(ln) {
3434
option::some(ep) { error_patterns += [ep]; }
3535
option::none { }
@@ -62,14 +62,11 @@ fn load_props(testfile: str) -> test_props {
6262

6363
fn is_test_ignored(config: config, testfile: str) -> bool {
6464
let mut found = false;
65-
iter_header(testfile) {|ln|
66-
// FIXME: Can't return or break from iterator
67-
// (Fix when Issue #1619 is resolved)
68-
found = found || parse_name_directive(ln, "xfail-test");
69-
found = found || parse_name_directive(ln, xfail_target());
70-
if (config.mode == common::mode_pretty) {
71-
found = found || parse_name_directive(ln, "xfail-pretty");
72-
}
65+
for iter_header(testfile) {|ln|
66+
if parse_name_directive(ln, "xfail-test") { ret true; }
67+
if parse_name_directive(ln, xfail_target()) { ret true; }
68+
if config.mode == common::mode_pretty &&
69+
parse_name_directive(ln, "xfail-pretty") { ret true; }
7370
};
7471
ret found;
7572

@@ -78,7 +75,7 @@ fn is_test_ignored(config: config, testfile: str) -> bool {
7875
}
7976
}
8077

81-
fn iter_header(testfile: str, it: fn(str)) {
78+
fn iter_header(testfile: str, it: fn(str) -> bool) -> bool {
8279
let rdr = result::get(io::file_reader(testfile));
8380
while !rdr.eof() {
8481
let ln = rdr.read_line();
@@ -88,9 +85,10 @@ fn iter_header(testfile: str, it: fn(str)) {
8885
// with a warm page cache. Maybe with a cold one.
8986
if str::starts_with(ln, "fn")
9087
|| str::starts_with(ln, "mod") {
91-
break;
92-
} else { it(ln); }
88+
ret false;
89+
} else { if !(it(ln)) { ret false; } }
9390
}
91+
ret true;
9492
}
9593

9694
fn parse_error_pattern(line: str) -> option<str> {

0 commit comments

Comments
 (0)