Configure test execution for the build_helper crate in bootstrap

To enable the previously moved `DropBomb` tests.
This commit is contained in:
Jakub Beránek 2024-07-04 15:51:21 +02:00 committed by Jakub Beránek
parent 97990a4759
commit 49f54b8ee8
No known key found for this signature in database
GPG Key ID: 909CD0D26483516B
2 changed files with 48 additions and 0 deletions

View File

@ -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" });

View File

@ -860,6 +860,7 @@ impl<'a> Builder<'a> {
test::Clippy,
test::CompiletestTest,
test::CrateRunMakeSupport,
test::CrateBuildHelper,
test::RustdocJSStd,
test::RustdocJSNotStd,
test::RustdocGUI,