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());
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
}
}
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,
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,