Skip to content

Commit 40b7775

Browse files
committed
---
yaml --- r: 67215 b: refs/heads/master c: 6f4e2b2 h: refs/heads/master i: 67213: 5d77b69 67211: a754c8a 67207: 031cc39 67199: 30c83ab v: v3
1 parent c1c8fd0 commit 40b7775

File tree

22 files changed

+687
-659
lines changed

22 files changed

+687
-659
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: 8990f8be5480ac572c0a108df5312290cc937364
2+
refs/heads/master: 6f4e2b2147bbe91218c5836109011af4fc66e38c
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/compiletest/runtest.rs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use util::logv;
2222

2323
use std::io;
2424
use std::os;
25+
use std::str;
2526
use std::uint;
2627
use std::vec;
2728

@@ -355,6 +356,30 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
355356
fmt!("%s:%u:", testfile.to_str(), ee.line)
356357
}).collect::<~[~str]>();
357358

359+
fn to_lower( s : &str ) -> ~str {
360+
let i = s.iter();
361+
let c : ~[char] = i.transform( |c| {
362+
if c.is_ascii() {
363+
c.to_ascii().to_lower().to_char()
364+
} else {
365+
c
366+
}
367+
} ).collect();
368+
str::from_chars( c )
369+
}
370+
371+
#[cfg(target_os = "win32")]
372+
fn prefix_matches( line : &str, prefix : &str ) -> bool {
373+
to_lower(line).starts_with( to_lower(prefix) )
374+
}
375+
376+
#[cfg(target_os = "linux")]
377+
#[cfg(target_os = "macos")]
378+
#[cfg(target_os = "freebsd")]
379+
fn prefix_matches( line : &str, prefix : &str ) -> bool {
380+
line.starts_with( prefix )
381+
}
382+
358383
// Scan and extract our error/warning messages,
359384
// which look like:
360385
// filename:line1:col1: line2:col2: *error:* msg
@@ -367,7 +392,7 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
367392
if !found_flags[i] {
368393
debug!("prefix=%s ee.kind=%s ee.msg=%s line=%s",
369394
prefixes[i], ee.kind, ee.msg, line);
370-
if (line.starts_with(prefixes[i]) &&
395+
if (prefix_matches(line, prefixes[i]) &&
371396
line.contains(ee.kind) &&
372397
line.contains(ee.msg)) {
373398
found_flags[i] = true;

0 commit comments

Comments
 (0)