]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/test.rs
test: Make manual changes to deal with the fallout from removal of
[rust.git] / src / librustdoc / test.rs
index 0a472a0ccaf2fe88970cc0eb33e207a3bb24c483..09a1b1fc81abd486616147e4baee05e0d1e945b6 100644 (file)
@@ -33,7 +33,7 @@
 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,