De-export std::test. Part of #3583.

This commit is contained in:
Graydon Hoare 2012-10-01 17:32:50 -07:00
parent 7ead3c0411
commit 13979eb7e2
2 changed files with 7 additions and 19 deletions

View File

@ -121,7 +121,6 @@ mod unicode;
// Compiler support modules
#[legacy_exports]
mod test;
#[legacy_exports]
mod serialization;

View File

@ -15,17 +15,6 @@ use libc::size_t;
use task::TaskBuilder;
use comm = core::comm;
export TestName;
export TestFn;
export TestDesc;
export test_main;
export TestResult;
export TestOpts;
export TrOk;
export TrFailed;
export TrIgnored;
export run_tests_console;
#[abi = "cdecl"]
extern mod rustrt {
#[legacy_exports];
@ -36,17 +25,17 @@ extern mod rustrt {
// paths; i.e. it should be a series of identifiers seperated by double
// colons. This way if some test runner wants to arrange the tests
// hierarchically it may.
type TestName = ~str;
pub type TestName = ~str;
// A function that runs a test. If the function returns successfully,
// the test succeeds; if the function fails then the test fails. We
// may need to come up with a more clever definition of test in order
// to support isolation of tests into tasks.
type TestFn = fn~();
pub type TestFn = fn~();
// The definition of a single test. A test runner will run a list of
// these.
type TestDesc = {
pub type TestDesc = {
name: TestName,
testfn: TestFn,
ignore: bool,
@ -55,7 +44,7 @@ type TestDesc = {
// The default console test runner. It accepts the command line
// arguments and a vector of test_descs (generated at compile time).
fn test_main(args: &[~str], tests: &[TestDesc]) {
pub fn test_main(args: &[~str], tests: &[TestDesc]) {
let opts =
match parse_opts(args) {
either::Left(move o) => o,
@ -64,7 +53,7 @@ fn test_main(args: &[~str], tests: &[TestDesc]) {
if !run_tests_console(&opts, tests) { fail ~"Some tests failed"; }
}
type TestOpts = {filter: Option<~str>, run_ignored: bool,
pub type TestOpts = {filter: Option<~str>, run_ignored: bool,
logfile: Option<~str>};
type OptRes = Either<TestOpts, ~str>;
@ -93,7 +82,7 @@ fn parse_opts(args: &[~str]) -> OptRes {
return either::Left(test_opts);
}
enum TestResult { TrOk, TrFailed, TrIgnored, }
pub enum TestResult { TrOk, TrFailed, TrIgnored, }
impl TestResult : Eq {
pure fn eq(other: &TestResult) -> bool {
@ -113,7 +102,7 @@ type ConsoleTestState =
mut failures: ~[TestDesc]};
// A simple console test runner
fn run_tests_console(opts: &TestOpts,
pub fn run_tests_console(opts: &TestOpts,
tests: &[TestDesc]) -> bool {
fn callback(event: &TestEvent, st: ConsoleTestState) {