Auto merge of #124321 - JoverZhang:run-make-support-tests, r=onur-ozkan
Some checks failed
CI / Calculate job matrix (push) Failing after 7s
CI / master (push) Has been skipped
CI / bors build finished (push) Has been skipped
CI / ${{ matrix.name }} (push) Has been skipped

Add support for run-make-support unit tests to be run with bootstrap

The `run-make-support` library needs to run its unit tests to ensure it is correct.

Close #124267
This commit is contained in:
bors 2024-04-26 13:22:13 +00:00
commit 9adafa7f8d
2 changed files with 49 additions and 0 deletions

View File

@ -1371,6 +1371,7 @@ fn make_run(run: RunConfig<'_>) {
run.builder.ensure(RunMakeSupport { compiler, target: run.build_triple() });
}
/// Builds run-make-support and returns the path to the resulting rlib.
fn run(self, builder: &Builder<'_>) -> PathBuf {
builder.ensure(compile::Std::new(self.compiler, self.target));
@ -1397,6 +1398,53 @@ fn run(self, builder: &Builder<'_>) -> PathBuf {
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct CrateRunMakeSupport {
host: TargetSelection,
}
impl Step for CrateRunMakeSupport {
type Output = ();
const ONLY_HOSTS: bool = true;
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/tools/run-make-support")
}
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(CrateRunMakeSupport { host: run.target });
}
/// Runs `cargo test` for run-make-support.
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/run-make-support",
SourceType::InTree,
&[],
);
cargo.allow_features("test");
run_cargo_test(
cargo,
&[],
&[],
"run-make-support",
"run-make-support 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

@ -817,6 +817,7 @@ macro_rules! describe {
test::Clippy,
test::RustDemangler,
test::CompiletestTest,
test::CrateRunMakeSupport,
test::RustdocJSStd,
test::RustdocJSNotStd,
test::RustdocGUI,