mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Stop using old_path in contenttest.
This commit is contained in:
parent
385e472ca0
commit
e2c03510de
1 changed files with 10 additions and 10 deletions
|
@ -11,7 +11,6 @@
|
||||||
#![feature(core)]
|
#![feature(core)]
|
||||||
#![feature(exit_status)]
|
#![feature(exit_status)]
|
||||||
#![feature(old_io)]
|
#![feature(old_io)]
|
||||||
#![feature(old_path)]
|
|
||||||
#![feature(path)]
|
#![feature(path)]
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private)]
|
||||||
#![feature(std_misc)]
|
#![feature(std_misc)]
|
||||||
|
@ -24,10 +23,10 @@ use test::{AutoColor, TestOpts, run_tests_console, TestDesc, TestDescAndFn, DynT
|
||||||
use test::ShouldPanic;
|
use test::ShouldPanic;
|
||||||
use getopts::{getopts, reqopt};
|
use getopts::{getopts, reqopt};
|
||||||
use std::{str, env};
|
use std::{str, env};
|
||||||
use std::old_io::fs;
|
use std::ffi::OsStr;
|
||||||
|
use std::fs::read_dir;
|
||||||
use std::old_io::Reader;
|
use std::old_io::Reader;
|
||||||
use std::old_io::process::{Command, Ignored, CreatePipe, InheritFd, ExitStatus};
|
use std::old_io::process::{Command, Ignored, CreatePipe, InheritFd, ExitStatus};
|
||||||
use std::old_path::Path;
|
|
||||||
use std::thunk::Thunk;
|
use std::thunk::Thunk;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -75,13 +74,14 @@ fn test_options(config: Config) -> TestOpts {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn find_tests(config: Config) -> Vec<TestDescAndFn> {
|
fn find_tests(config: Config) -> Vec<TestDescAndFn> {
|
||||||
let files_res = fs::readdir(&Path::new(config.source_dir));
|
read_dir(&config.source_dir)
|
||||||
let mut files = match files_res {
|
.ok()
|
||||||
Ok(files) => files,
|
.expect("Error reading directory.")
|
||||||
_ => panic!("Error reading directory."),
|
.filter_map(Result::ok)
|
||||||
};
|
.map(|e| e.path())
|
||||||
files.retain(|file| file.extension_str() == Some("html") );
|
.filter(|file| file.extension().map_or(false, |e| e == OsStr::from_str("html")))
|
||||||
return files.iter().map(|file| make_test(file.display().to_string())).collect();
|
.map(|file| make_test(file.display().to_string()))
|
||||||
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_test(file: String) -> TestDescAndFn {
|
fn make_test(file: String) -> TestDescAndFn {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue