diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-05-01 18:06:59 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-07 08:16:42 -0700 |
| commit | 104e285eb8f848867c2666765e2aa8221e8a97d1 (patch) | |
| tree | d261196dbf9c8006ce647799fcc743a3a350910c /src/libcore/lib.rs | |
| parent | f62c121eb0de35ac03a7860e6039202f2522e527 (diff) | |
| download | rust-104e285eb8f848867c2666765e2aa8221e8a97d1.tar.gz rust-104e285eb8f848867c2666765e2aa8221e8a97d1.zip | |
core: Get coretest working
This mostly involved frobbing imports between realstd, realcore, and the core being test. Some of the imports are a little counterintuitive, but it mainly focuses around libcore's types not implementing Show while libstd's types implement Show.
Diffstat (limited to 'src/libcore/lib.rs')
| -rw-r--r-- | src/libcore/lib.rs | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 550dcc1fed8..5aef169cd57 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -18,9 +18,21 @@ html_root_url = "http://static.rust-lang.org/doc/master")] #![no_std] -#![feature(globs, macro_rules, managed_boxes)] +#![feature(globs, macro_rules, managed_boxes, phase)] #![deny(missing_doc)] +#[cfg(test)] extern crate realcore = "core"; +#[cfg(test)] extern crate libc; +#[cfg(test)] extern crate native; +#[phase(syntax, link)] #[cfg(test)] extern crate realstd = "std"; +#[phase(syntax, link)] #[cfg(test)] extern crate log; + +#[cfg(test)] pub use kinds = realcore::kinds; +#[cfg(test)] pub use cmp = realcore::cmp; +#[cfg(test)] pub use ops = realcore::ops; +#[cfg(test)] pub use ty = realcore::ty; + +#[cfg(not(test))] mod macros; #[path = "num/float_macros.rs"] mod float_macros; @@ -44,6 +56,10 @@ mod macros; pub mod num; +/* The libcore prelude, not as all-encompassing as the libstd prelude */ + +pub mod prelude; + /* Core modules for ownership management */ pub mod cast; @@ -53,10 +69,10 @@ pub mod ptr; /* Core language traits */ -pub mod cmp; -pub mod kinds; -pub mod ops; -pub mod ty; +#[cfg(not(test))] pub mod kinds; +#[cfg(not(test))] pub mod ops; +#[cfg(not(test))] pub mod ty; +#[cfg(not(test))] pub mod cmp; pub mod clone; pub mod default; pub mod container; @@ -88,4 +104,9 @@ mod should_not_exist; mod std { pub use clone; pub use cmp; + + #[cfg(test)] pub use realstd::fmt; // needed for fail!() + #[cfg(test)] pub use realstd::rt; // needed for fail!() + #[cfg(test)] pub use realstd::option; // needed for assert!() + #[cfg(test)] pub use realstd::os; // needed for tests } |
