mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19.
This commit is contained in:
parent
cf616b90a2
commit
16c7060bc8
153 changed files with 2095 additions and 1298 deletions
|
@ -15,6 +15,7 @@ extern crate regex;
|
|||
extern crate test;
|
||||
|
||||
use test::{AutoColor, TestOpts, run_tests_console, TestDesc, TestDescAndFn, DynTestFn, DynTestName};
|
||||
use test::ShouldFail;
|
||||
use getopts::{getopts, reqopt};
|
||||
use std::{os, str};
|
||||
use std::io::fs;
|
||||
|
@ -66,7 +67,10 @@ fn test_options(config: Config) -> TestOpts {
|
|||
test_shard: None,
|
||||
logfile: None,
|
||||
nocapture: false,
|
||||
color: AutoColor
|
||||
color: AutoColor,
|
||||
show_boxplot: false,
|
||||
boxplot_width: 0,
|
||||
show_all_stats: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,14 +89,14 @@ fn make_test(file: String) -> TestDescAndFn {
|
|||
desc: TestDesc {
|
||||
name: DynTestName(file.clone()),
|
||||
ignore: false,
|
||||
should_fail: false
|
||||
should_fail: ShouldFail::No,
|
||||
},
|
||||
testfn: DynTestFn(proc() { run_test(file) })
|
||||
}
|
||||
}
|
||||
|
||||
fn run_test(file: String) {
|
||||
let path = os::make_absolute(&Path::new(file));
|
||||
let path = os::make_absolute(&Path::new(file)).unwrap();
|
||||
// FIXME (#1094): not the right way to transform a path
|
||||
let infile = format!("file://{}", path.display());
|
||||
let stdout = CreatePipe(false, true);
|
||||
|
@ -100,7 +104,7 @@ fn run_test(file: String) {
|
|||
let args = ["-z", "-f", infile.as_slice()];
|
||||
|
||||
let mut prc = match Command::new(os::self_exe_path().unwrap().join("servo"))
|
||||
.args(args)
|
||||
.args(args.as_slice())
|
||||
.stdin(Ignored)
|
||||
.stdout(stdout)
|
||||
.stderr(stderr)
|
||||
|
|
|
@ -22,13 +22,14 @@ use std::io::process::ExitStatus;
|
|||
use std::io::fs::PathExtensions;
|
||||
use std::os;
|
||||
use std::path::Path;
|
||||
use test::{AutoColor, DynTestName, DynTestFn, TestDesc, TestOpts, TestDescAndFn};
|
||||
use test::{AutoColor, DynTestName, DynTestFn, TestDesc, TestOpts, TestDescAndFn, ShouldFail};
|
||||
use test::run_tests_console;
|
||||
use regex::Regex;
|
||||
use url::Url;
|
||||
|
||||
|
||||
bitflags!(
|
||||
#[deriving(Copy)]
|
||||
flags RenderMode: u32 {
|
||||
const CPU_RENDERING = 0x00000001,
|
||||
const GPU_RENDERING = 0x00000010,
|
||||
|
@ -95,7 +96,10 @@ fn main() {
|
|||
save_metrics: None,
|
||||
test_shard: None,
|
||||
nocapture: false,
|
||||
color: AutoColor
|
||||
color: AutoColor,
|
||||
show_boxplot: false,
|
||||
boxplot_width: 0,
|
||||
show_all_stats: false,
|
||||
};
|
||||
|
||||
match run(test_opts,
|
||||
|
@ -191,7 +195,7 @@ fn parse_lists(file: &Path, servo_args: &[String], render_mode: RenderMode, id_o
|
|||
// If we're running this directly, file.dir_path() might be relative.
|
||||
// (see issue #3521)
|
||||
let base = match file.dir_path().is_relative() {
|
||||
true => os::getcwd().join(file.dir_path()),
|
||||
true => os::getcwd().unwrap().join(file.dir_path()),
|
||||
false => file.dir_path()
|
||||
};
|
||||
|
||||
|
@ -239,7 +243,7 @@ fn make_test(reftest: Reftest) -> TestDescAndFn {
|
|||
desc: TestDesc {
|
||||
name: DynTestName(name),
|
||||
ignore: false,
|
||||
should_fail: false,
|
||||
should_fail: ShouldFail::No,
|
||||
},
|
||||
testfn: DynTestFn(proc() {
|
||||
check_reftest(reftest);
|
||||
|
@ -255,7 +259,7 @@ fn capture(reftest: &Reftest, side: uint) -> (u32, u32, Vec<u8>) {
|
|||
// Allows pixel perfect rendering of Ahem font for reftests.
|
||||
.arg("-Z")
|
||||
.arg("disable-text-aa")
|
||||
.args(["-f", "-o"])
|
||||
.args(["-f", "-o"].as_slice())
|
||||
.arg(png_filename.as_slice())
|
||||
.arg({
|
||||
let mut url = Url::from_file_path(&reftest.files[side]).unwrap();
|
||||
|
@ -280,7 +284,7 @@ fn capture(reftest: &Reftest, side: uint) -> (u32, u32, Vec<u8>) {
|
|||
|
||||
let image = png::load_png(&from_str::<Path>(png_filename.as_slice()).unwrap()).unwrap();
|
||||
let rgba8_bytes = match image.pixels {
|
||||
png::RGBA8(pixels) => pixels,
|
||||
png::PixelsByColorType::RGBA8(pixels) => pixels,
|
||||
_ => panic!(),
|
||||
};
|
||||
(image.width, image.height, rgba8_bytes)
|
||||
|
@ -320,7 +324,7 @@ fn check_reftest(reftest: Reftest) {
|
|||
let mut img = png::Image {
|
||||
width: left_width,
|
||||
height: left_height,
|
||||
pixels: png::RGBA8(pixels),
|
||||
pixels: png::PixelsByColorType::RGBA8(pixels),
|
||||
};
|
||||
let res = png::store_png(&mut img, &output);
|
||||
assert!(res.is_ok());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue