bb9062a296
This commit adds support to rustbuild to run crate unit tests (those defined by `#[test]`) as well as documentation tests. All tests are powered by `cargo test` under the hood. Each step requires the `libtest` library is built for that corresponding stage. Ideally the `test` crate would be a dev-dependency, but for now it's just easier to ensure that we sequence everything in the right order. Currently no filtering is implemented, so there's not actually a method of testing *only* libstd or *only* libcore, but rather entire swaths of crates are tested all at once. A few points of note here are: * The `coretest` and `collectionstest` crates are just listed as `[[test]]` entires for `cargo test` to naturally pick up. This mean that `cargo test -p core` actually runs all the tests for libcore. * Libraries that aren't tested all mention `test = false` in their `Cargo.toml` * Crates aren't currently allowed to have dev-dependencies due to rust-lang/cargo#860, but we can likely alleviate this restriction once workspaces are implemented. cc #31590
34 lines
717 B
TOML
34 lines
717 B
TOML
[package]
|
|
authors = ["The Rust Project Developers"]
|
|
name = "rustc-main"
|
|
version = "0.0.0"
|
|
|
|
[[bin]]
|
|
name = "rustc"
|
|
path = "rustc.rs"
|
|
|
|
[[bin]]
|
|
name = "rustdoc"
|
|
path = "rustdoc.rs"
|
|
|
|
[profile.release]
|
|
opt-level = 2
|
|
[profile.bench]
|
|
opt-level = 2
|
|
|
|
# These options are controlled from our rustc wrapper script, so turn them off
|
|
# here and have them controlled elsewhere.
|
|
[profile.dev]
|
|
debug = false
|
|
debug-assertions = false
|
|
|
|
# All optional dependencies so the features passed to this Cargo.toml select
|
|
# what should actually be built.
|
|
[dependencies]
|
|
rustc_back = { path = "../librustc_back" }
|
|
rustc_driver = { path = "../librustc_driver" }
|
|
rustdoc = { path = "../librustdoc" }
|
|
|
|
[features]
|
|
jemalloc = ["rustc_back/jemalloc"]
|