Skip to content

Commit 2146623

Browse files
committed
Also test coretests when running ./x.py test core
It is reasonable to expect that ./x.py test core is enough to run tests when you are working on core. In addition it seems like CI for wasm32 at least doesn't run coretests currently, which this commit fixes.
1 parent b60aeb0 commit 2146623

File tree

1 file changed

+9
-8
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+9
-8
lines changed

src/bootstrap/src/core/build_steps/test.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -2785,14 +2785,15 @@ impl Step for Crate {
27852785
_ => panic!("can only test libraries"),
27862786
};
27872787

2788-
run_cargo_test(
2789-
cargo,
2790-
&[],
2791-
&self.crates,
2792-
&*crate_description(&self.crates),
2793-
target,
2794-
builder,
2795-
);
2788+
let mut crates = self.crates.clone();
2789+
// The core crate can't directly be tested. We could silently
2790+
// ignore it, but replacing it with it's own test crate is less
2791+
// confusing for users.
2792+
if crates.iter().any(|crate_| crate_ == "core") {
2793+
crates.push("coretests".to_owned());
2794+
}
2795+
2796+
run_cargo_test(cargo, &[], &crates, &*crate_description(&self.crates), target, builder);
27962797
}
27972798
}
27982799

0 commit comments

Comments
 (0)