mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-05 03:24:06 +03:00
De-export std::test. Part of #3583.
This commit is contained in:
@@ -121,7 +121,6 @@ mod unicode;
|
||||
|
||||
// Compiler support modules
|
||||
|
||||
#[legacy_exports]
|
||||
mod test;
|
||||
#[legacy_exports]
|
||||
mod serialization;
|
||||
|
||||
+7
-18
@@ -15,17 +15,6 @@
|
||||
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 @@
|
||||
// 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 @@
|
||||
|
||||
// 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 @@ impl TestResult : Eq {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user