// Copyright 2014 The HTML5 for Rust Project Developers. See the
// COPYRIGHT file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![crate_name="html5-external-test"]
#![crate_type="bin"]

#![feature(macro_rules)]

extern crate test;
extern crate serialize;
extern crate debug;

extern crate html5;

use std::os;
use std::from_str::FromStr;
use test::test_main;

mod tokenizer;
mod tree_builder;
mod util;

fn main() {
    let src_dir: Path = FromStr::from_str(
        os::getenv("HTML5_SRC_DIR").expect("HTML5_SRC_DIR not set").as_slice()
    ).expect("HTML5_SRC_DIR invalid");

    let mut tests = vec!();

    tests.push_all_move(tokenizer::tests(src_dir.clone()));
    tests.push_all_move(tree_builder::tests(src_dir));

    let args: Vec<String> = os::args().move_iter().collect();
    test_main(args.as_slice(), tests);
}

// Copyright 2014 The HTML5 for Rust Project Developers. See the
// COPYRIGHT file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![crate_name="html5-external-test"]
#![crate_type="bin"]

#![feature(macro_rules)]

extern crate test;
extern crate serialize;
extern crate debug;

extern crate html5;

use std::os;
use std::from_str::FromStr;
use test::test_main;

mod tokenizer;
mod tree_builder;
mod util;

fn main() {
    let src_dir: Path = FromStr::from_str(
        os::getenv("HTML5_SRC_DIR").expect("HTML5_SRC_DIR not set").as_slice()
    ).expect("HTML5_SRC_DIR invalid");

    let mut tests = vec!();

    if os::getenv("HTML5_NO_TOK_TEST").is_none() {
        tests.push_all_move(tokenizer::tests(src_dir.clone()));
    }

    if os::getenv("HTM5_NO_TB_TEST").is_none() {
        tests.push_all_move(tree_builder::tests(src_dir));
    }

    let args: Vec<String> = os::args().move_iter().collect();
    test_main(args.as_slice(), tests);
}

Add env vars to control which tests we load
Add env vars to control which tests we load

Loading consumes a fair amount of time before the point where the built-in test
infrastructure can filter which tests to run.
