Configure test execution for the build_helper
crate in bootstrap
To enable the previously moved `DropBomb` tests.
This commit is contained in:
parent
97990a4759
commit
49f54b8ee8
@ -1352,6 +1352,53 @@ impl Step for CrateRunMakeSupport {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct CrateBuildHelper {
|
||||
host: TargetSelection,
|
||||
}
|
||||
|
||||
impl Step for CrateBuildHelper {
|
||||
type Output = ();
|
||||
const ONLY_HOSTS: bool = true;
|
||||
|
||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||
run.path("src/tools/build_helper")
|
||||
}
|
||||
|
||||
fn make_run(run: RunConfig<'_>) {
|
||||
run.builder.ensure(CrateBuildHelper { host: run.target });
|
||||
}
|
||||
|
||||
/// Runs `cargo test` for build_helper.
|
||||
fn run(self, builder: &Builder<'_>) {
|
||||
let host = self.host;
|
||||
let compiler = builder.compiler(builder.top_stage, host);
|
||||
|
||||
builder.ensure(compile::Std::new(compiler, host));
|
||||
let mut cargo = tool::prepare_tool_cargo(
|
||||
builder,
|
||||
compiler,
|
||||
Mode::ToolStd,
|
||||
host,
|
||||
"test",
|
||||
"src/tools/build_helper",
|
||||
SourceType::InTree,
|
||||
&[],
|
||||
);
|
||||
cargo.allow_features("test");
|
||||
run_cargo_test(
|
||||
cargo,
|
||||
&[],
|
||||
&[],
|
||||
"build_helper",
|
||||
"build_helper self test",
|
||||
compiler,
|
||||
host,
|
||||
builder,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
default_test!(Ui { path: "tests/ui", mode: "ui", suite: "ui" });
|
||||
|
||||
default_test!(Crashes { path: "tests/crashes", mode: "crashes", suite: "crashes" });
|
||||
|
@ -860,6 +860,7 @@ impl<'a> Builder<'a> {
|
||||
test::Clippy,
|
||||
test::CompiletestTest,
|
||||
test::CrateRunMakeSupport,
|
||||
test::CrateBuildHelper,
|
||||
test::RustdocJSStd,
|
||||
test::RustdocJSNotStd,
|
||||
test::RustdocGUI,
|
||||
|
Loading…
x
Reference in New Issue
Block a user