From 13979eb7e2fddd3f46f4e83fbc41ed656636ce80 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Mon, 1 Oct 2012 17:32:50 -0700 Subject: [PATCH] De-export std::test. Part of #3583. --- src/libstd/std.rc | 1 - src/libstd/test.rs | 25 +++++++------------------ 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/libstd/std.rc b/src/libstd/std.rc index a38d9772b5cf..6f2c38b03fe6 100644 --- a/src/libstd/std.rc +++ b/src/libstd/std.rc @@ -121,7 +121,6 @@ mod unicode; // Compiler support modules -#[legacy_exports] mod test; #[legacy_exports] mod serialization; diff --git a/src/libstd/test.rs b/src/libstd/test.rs index 691f0e840e6b..1df10a4d7997 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -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; @@ -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) {