Skip to content

Commit b491494

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 b491494

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 adding it's own test crate is less confusing
2791+
// for users. We still keep core itself for doctests.
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)