Skip to content

Commit 0f51e49

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 0f51e49

File tree

1 file changed

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

1 file changed

+13
-8
lines changed

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

+13-8
Original file line numberDiff line numberDiff line change
@@ -2785,14 +2785,19 @@ 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 crates = self
2789+
.crates
2790+
.iter()
2791+
.cloned()
2792+
.map(|crate_| {
2793+
// The core crate can't directly be tested. We could silently
2794+
// ignore it, but replacing it with it's own test crate is less
2795+
// confusing for users.
2796+
if crate_ == "core" { "coretests".to_owned() } else { crate_ }
2797+
})
2798+
.collect::<Vec<_>>();
2799+
2800+
run_cargo_test(cargo, &[], &crates, &*crate_description(&self.crates), target, builder);
27962801
}
27972802
}
27982803

0 commit comments

Comments
 (0)