Skip to content

Commit 54d3dce

Browse files
committed
Configure test execution for the build_helper crate in bootstrap
To enable the previously moved `DropBomb` tests.
1 parent 7a23019 commit 54d3dce

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,53 @@ impl Step for CrateRunMakeSupport {
13521352
}
13531353
}
13541354

1355+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1356+
pub struct CrateBuildHelper {
1357+
host: TargetSelection,
1358+
}
1359+
1360+
impl Step for CrateBuildHelper {
1361+
type Output = ();
1362+
const ONLY_HOSTS: bool = true;
1363+
1364+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
1365+
run.path("src/tools/build_helper")
1366+
}
1367+
1368+
fn make_run(run: RunConfig<'_>) {
1369+
run.builder.ensure(CrateBuildHelper { host: run.target });
1370+
}
1371+
1372+
/// Runs `cargo test` for build_helper.
1373+
fn run(self, builder: &Builder<'_>) {
1374+
let host = self.host;
1375+
let compiler = builder.compiler(builder.top_stage, host);
1376+
1377+
builder.ensure(compile::Std::new(compiler, host));
1378+
let mut cargo = tool::prepare_tool_cargo(
1379+
builder,
1380+
compiler,
1381+
Mode::ToolStd,
1382+
host,
1383+
"test",
1384+
"src/tools/build_helper",
1385+
SourceType::InTree,
1386+
&[],
1387+
);
1388+
cargo.allow_features("test");
1389+
run_cargo_test(
1390+
cargo,
1391+
&[],
1392+
&[],
1393+
"build_helper",
1394+
"build_helper self test",
1395+
compiler,
1396+
host,
1397+
builder,
1398+
);
1399+
}
1400+
}
1401+
13551402
default_test!(Ui { path: "tests/ui", mode: "ui", suite: "ui" });
13561403

13571404
default_test!(Crashes { path: "tests/crashes", mode: "crashes", suite: "crashes" });

src/bootstrap/src/core/builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,7 @@ impl<'a> Builder<'a> {
861861
test::Clippy,
862862
test::CompiletestTest,
863863
test::CrateRunMakeSupport,
864+
test::CrateBuildHelper,
864865
test::RustdocJSStd,
865866
test::RustdocJSNotStd,
866867
test::RustdocGUI,

0 commit comments

Comments
 (0)