diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2012-10-01 17:32:50 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-10-01 18:00:14 -0700 |
| commit | 13979eb7e2fddd3f46f4e83fbc41ed656636ce80 (patch) | |
| tree | 2c915fd3a4174d66dbb9d2666f4d91795b1832d9 /src/libstd/test.rs | |
| parent | 7ead3c04112c77e6e6078e99ab19b9e28c172098 (diff) | |
| download | rust-13979eb7e2fddd3f46f4e83fbc41ed656636ce80.tar.gz rust-13979eb7e2fddd3f46f4e83fbc41ed656636ce80.zip | |
De-export std::test. Part of #3583.
Diffstat (limited to 'src/libstd/test.rs')
| -rw-r--r-- | src/libstd/test.rs | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/libstd/test.rs b/src/libstd/test.rs index 691f0e840e6..1df10a4d799 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<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) { |
