Make it possible to run cargo test for bootstrap

Note that this only runs bootstrap's self-tests, not compiler or library tests.
This commit is contained in:
Joshua Nelson
2022-03-23 18:23:26 -05:00
parent 5f4e067719
commit a0de44f469
3 changed files with 3 additions and 10 deletions

View File

@@ -442,7 +442,7 @@ impl Build {
.map(PathBuf::from)
.unwrap_or_else(|_| src.join("target"));
let bootstrap_out = workspace_target_dir.join("debug");
if !bootstrap_out.join("rustc").exists() {
if !bootstrap_out.join("rustc").exists() && !cfg!(test) {
// this restriction can be lifted whenever https://github.com/rust-lang/rfcs/pull/3028 is implemented
panic!("run `cargo build --bins` before `cargo run`")
}