test: Make manual changes to deal with the fallout from removal of

`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
This commit is contained in:
Patrick Walton
2014-03-05 15:28:08 -08:00
committed by Huon Wilson
parent 579eb2400b
commit af79a5aa7d
236 changed files with 1435 additions and 1311 deletions

View File

@@ -33,7 +33,7 @@ use html::markdown;
use passes;
use visit_ast::RustdocVisitor;
pub fn run(input: &str, libs: HashSet<Path>, mut test_args: ~[~str]) -> int {
pub fn run(input: &str, libs: HashSet<Path>, mut test_args: Vec<~str>) -> int {
let input_path = Path::new(input);
let input = driver::FileInput(input_path.clone());
@@ -71,13 +71,16 @@ pub fn run(input: &str, libs: HashSet<Path>, mut test_args: ~[~str]) -> int {
let (krate, _) = passes::unindent_comments(krate);
let (krate, _) = passes::collapse_docs(krate);
let mut collector = Collector::new(krate.name.to_owned(), libs, false, false);
let mut collector = Collector::new(krate.name.to_owned(),
libs,
false,
false);
collector.fold_crate(krate);
test_args.unshift(~"rustdoctest");
testing::test_main(test_args, collector.tests);
testing::test_main(test_args.as_slice(),
collector.tests.move_iter().collect());
0
}
@@ -187,8 +190,8 @@ fn maketest(s: &str, cratename: &str, loose_feature_gating: bool) -> ~str {
}
pub struct Collector {
tests: ~[testing::TestDescAndFn],
priv names: ~[~str],
tests: Vec<testing::TestDescAndFn>,
priv names: Vec<~str>,
priv libs: HashSet<Path>,
priv cnt: uint,
priv use_headers: bool,
@@ -202,8 +205,8 @@ impl Collector {
pub fn new(cratename: ~str, libs: HashSet<Path>,
use_headers: bool, loose_feature_gating: bool) -> Collector {
Collector {
tests: ~[],
names: ~[],
tests: Vec::new(),
names: Vec::new(),
libs: libs,
cnt: 0,
use_headers: use_headers,