Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.

This commit is contained in:
Josh Matthews 2015-01-15 13:26:44 -05:00 committed by Glenn Watson
parent ff8cbff810
commit 95fc29fa0d
255 changed files with 3550 additions and 3362 deletions

View file

@ -21,9 +21,10 @@ use std::{os, str};
use std::io::fs;
use std::io::Reader;
use std::io::process::{Command, Ignored, CreatePipe, InheritFd, ExitStatus};
use std::thunk::Thunk;
use regex::Regex;
#[deriving(Clone)]
#[derive(Clone)]
struct Config {
source_dir: String,
filter: Option<Regex>
@ -51,7 +52,7 @@ fn parse_config(args: Vec<String>) -> Config {
Config {
source_dir: matches.opt_str("source-dir").unwrap(),
filter: matches.free.as_slice().head().map(|s| Regex::new(s.as_slice()).unwrap())
filter: matches.free.as_slice().first().map(|&:s| Regex::new(s.as_slice()).unwrap())
}
}
@ -91,7 +92,7 @@ fn make_test(file: String) -> TestDescAndFn {
ignore: false,
should_fail: ShouldFail::No,
},
testfn: DynTestFn(proc() { run_test(file) })
testfn: DynTestFn(Thunk::new(move |:| { run_test(file) }))
}
}
@ -135,6 +136,6 @@ fn run_test(file: String) {
let retval = prc.wait();
if retval != Ok(ExitStatus(0)) {
panic!("Servo exited with non-zero status {}", retval);
panic!("Servo exited with non-zero status {:?}", retval);
}
}

View file

@ -22,6 +22,7 @@ use std::io::process::ExitStatus;
use std::io::fs::PathExtensions;
use std::os;
use std::path::Path;
use std::thunk::Thunk;
use test::{AutoColor, DynTestName, DynTestFn, TestDesc, TestOpts, TestDescAndFn, ShouldFail};
use test::run_tests_console;
use regex::Regex;
@ -29,7 +30,6 @@ use url::Url;
bitflags!(
#[deriving(Copy)]
flags RenderMode: u32 {
const CPU_RENDERING = 0x00000001,
const GPU_RENDERING = 0x00000010,
@ -37,7 +37,7 @@ bitflags!(
const MACOS_TARGET = 0x00001000,
const ANDROID_TARGET = 0x00010000
}
)
);
fn main() {
@ -75,7 +75,7 @@ fn main() {
let maybe_extension = file.extension_str();
match maybe_extension {
Some(extension) => {
if extension.to_ascii_lower().as_slice() == "list" && file.is_file() {
if extension.to_ascii_lowercase().as_slice() == "list" && file.is_file() {
let tests = parse_lists(&file, servo_args, render_mode, all_tests.len());
println!("\t{} [{} tests]", file.display(), tests.len());
all_tests.extend(tests.into_iter());
@ -131,7 +131,7 @@ fn run(test_opts: TestOpts, all_tests: Vec<TestDescAndFn>,
run_tests_console(&test_opts, all_tests)
}
#[deriving(PartialEq)]
#[derive(PartialEq)]
enum ReftestKind {
Same,
Different,
@ -140,7 +140,7 @@ enum ReftestKind {
struct Reftest {
name: String,
kind: ReftestKind,
files: [Path, ..2],
files: [Path; 2],
id: uint,
servo_args: Vec<String>,
render_mode: RenderMode,
@ -245,9 +245,9 @@ fn make_test(reftest: Reftest) -> TestDescAndFn {
ignore: false,
should_fail: ShouldFail::No,
},
testfn: DynTestFn(proc() {
testfn: DynTestFn(Thunk::new(move || {
check_reftest(reftest);
}),
})),
}
}
@ -282,7 +282,8 @@ fn capture(reftest: &Reftest, side: uint) -> (u32, u32, Vec<u8>) {
};
assert_eq!(retval, ExitStatus(0));
let image = png::load_png(&from_str::<Path>(png_filename.as_slice()).unwrap()).unwrap();
let path = png_filename.parse::<Path>().unwrap();
let image = png::load_png(&path).unwrap();
let rgba8_bytes = match image.pixels {
png::PixelsByColorType::RGBA8(pixels) => pixels,
_ => panic!(),
@ -319,7 +320,7 @@ fn check_reftest(reftest: Reftest) {
if pixels.iter().any(|&a| a < 255) {
let output_str = format!("/tmp/servo-reftest-{:06}-diff.png", reftest.id);
let output = from_str::<Path>(output_str.as_slice()).unwrap();
let output = output_str.parse::<Path>().unwrap();
let mut img = png::Image {
width: left_width,

View file

@ -0,0 +1,4 @@
[send-accept.htm]
type: testharness
[XMLHttpRequest: send() - Accept]
expected: FAIL