mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
parent
9cea3ce266
commit
41e50b043d
1 changed files with 23 additions and 2 deletions
|
@ -17,7 +17,7 @@ extern crate url;
|
||||||
|
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::io::{File, Reader, Command};
|
use std::io::{File, Reader, Command, IoResult};
|
||||||
use std::io::process::ExitStatus;
|
use std::io::process::ExitStatus;
|
||||||
use std::io::fs::PathExtensions;
|
use std::io::fs::PathExtensions;
|
||||||
use std::os;
|
use std::os;
|
||||||
|
@ -98,13 +98,34 @@ fn main() {
|
||||||
color: AutoColor
|
color: AutoColor
|
||||||
};
|
};
|
||||||
|
|
||||||
match run_tests_console(&test_opts, all_tests) {
|
match run(test_opts,
|
||||||
|
all_tests,
|
||||||
|
servo_args.iter().map(|x| x.clone()).collect()) {
|
||||||
Ok(false) => os::set_exit_status(1), // tests failed
|
Ok(false) => os::set_exit_status(1), // tests failed
|
||||||
Err(_) => os::set_exit_status(2), // I/O-related failure
|
Err(_) => os::set_exit_status(2), // I/O-related failure
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn run(test_opts: TestOpts, all_tests: Vec<TestDescAndFn>,
|
||||||
|
servo_args: Vec<String>) -> IoResult<bool> {
|
||||||
|
// Verify that we're passing in valid servo arguments. Otherwise, servo
|
||||||
|
// will exit before we've run any tests, and it will appear to us as if
|
||||||
|
// all the tests are failing.
|
||||||
|
let mut command = match Command::new("target/servo").args(servo_args.as_slice()).spawn() {
|
||||||
|
Ok(p) => p,
|
||||||
|
Err(e) => panic!("failed to execute process: {}", e),
|
||||||
|
};
|
||||||
|
let stderr = command.stderr.as_mut().unwrap().read_to_string().unwrap();
|
||||||
|
|
||||||
|
if stderr.as_slice().contains("Unrecognized") {
|
||||||
|
println!("Servo: {}", stderr.as_slice());
|
||||||
|
return Ok(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
run_tests_console(&test_opts, all_tests)
|
||||||
|
}
|
||||||
|
|
||||||
#[deriving(PartialEq)]
|
#[deriving(PartialEq)]
|
||||||
enum ReftestKind {
|
enum ReftestKind {
|
||||||
Same,
|
Same,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue