Combine several Step
s into a single step with multiple paths
This commit is contained in:
parent
ff674c1664
commit
2a75607bab
@ -703,7 +703,6 @@ impl<'a> Builder<'a> {
|
|||||||
crate::toolstate::ToolStateCheck,
|
crate::toolstate::ToolStateCheck,
|
||||||
test::ExpandYamlAnchors,
|
test::ExpandYamlAnchors,
|
||||||
test::Tidy,
|
test::Tidy,
|
||||||
test::TidySelfTest,
|
|
||||||
test::Ui,
|
test::Ui,
|
||||||
test::RunPassValgrind,
|
test::RunPassValgrind,
|
||||||
test::MirOpt,
|
test::MirOpt,
|
||||||
@ -719,11 +718,9 @@ impl<'a> Builder<'a> {
|
|||||||
test::CrateLibrustc,
|
test::CrateLibrustc,
|
||||||
test::CrateRustdoc,
|
test::CrateRustdoc,
|
||||||
test::CrateRustdocJsonTypes,
|
test::CrateRustdocJsonTypes,
|
||||||
test::CrateJsonDocLint,
|
test::CrateBootstrap,
|
||||||
test::SuggestTestsCrate,
|
|
||||||
test::Linkcheck,
|
test::Linkcheck,
|
||||||
test::TierCheck,
|
test::TierCheck,
|
||||||
test::ReplacePlaceholderTest,
|
|
||||||
test::Cargotest,
|
test::Cargotest,
|
||||||
test::Cargo,
|
test::Cargo,
|
||||||
test::RustAnalyzer,
|
test::RustAnalyzer,
|
||||||
|
@ -55,26 +55,37 @@ fn try_run_quiet(builder: &Builder<'_>, cmd: &mut Command) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
pub struct CrateJsonDocLint {
|
pub struct CrateBootstrap {
|
||||||
|
path: Interned<PathBuf>,
|
||||||
host: TargetSelection,
|
host: TargetSelection,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Step for CrateJsonDocLint {
|
impl Step for CrateBootstrap {
|
||||||
type Output = ();
|
type Output = ();
|
||||||
const ONLY_HOSTS: bool = true;
|
const ONLY_HOSTS: bool = true;
|
||||||
const DEFAULT: bool = true;
|
const DEFAULT: bool = true;
|
||||||
|
|
||||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||||
run.path("src/tools/jsondoclint")
|
run.path("src/tools/jsondoclint")
|
||||||
|
.path("src/tools/suggest-tests")
|
||||||
|
.path("src/tools/replace-version-placeholder")
|
||||||
|
.alias("tidyselftest")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_run(run: RunConfig<'_>) {
|
fn make_run(run: RunConfig<'_>) {
|
||||||
run.builder.ensure(CrateJsonDocLint { host: run.target });
|
for path in run.paths {
|
||||||
|
let path = INTERNER.intern_path(path.assert_single_path().path.clone());
|
||||||
|
run.builder.ensure(CrateBootstrap { host: run.target, path });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run(self, builder: &Builder<'_>) {
|
fn run(self, builder: &Builder<'_>) {
|
||||||
let bootstrap_host = builder.config.build;
|
let bootstrap_host = builder.config.build;
|
||||||
let compiler = builder.compiler(0, bootstrap_host);
|
let compiler = builder.compiler(0, bootstrap_host);
|
||||||
|
let mut path = self.path.to_str().unwrap();
|
||||||
|
if path == "tidyselftest" {
|
||||||
|
path = "src/tools/tidy";
|
||||||
|
}
|
||||||
|
|
||||||
let cargo = tool::prepare_tool_cargo(
|
let cargo = tool::prepare_tool_cargo(
|
||||||
builder,
|
builder,
|
||||||
@ -82,46 +93,16 @@ impl Step for CrateJsonDocLint {
|
|||||||
Mode::ToolBootstrap,
|
Mode::ToolBootstrap,
|
||||||
bootstrap_host,
|
bootstrap_host,
|
||||||
"test",
|
"test",
|
||||||
"src/tools/jsondoclint",
|
path,
|
||||||
SourceType::InTree,
|
SourceType::InTree,
|
||||||
&[],
|
&[],
|
||||||
);
|
);
|
||||||
run_cargo_test(cargo, &[], &[], compiler, bootstrap_host, builder);
|
builder.info(&format!(
|
||||||
}
|
"{} {} stage0 ({})",
|
||||||
}
|
builder.kind.test_description(),
|
||||||
|
path,
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
|
||||||
pub struct SuggestTestsCrate {
|
|
||||||
host: TargetSelection,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Step for SuggestTestsCrate {
|
|
||||||
type Output = ();
|
|
||||||
const ONLY_HOSTS: bool = true;
|
|
||||||
const DEFAULT: bool = true;
|
|
||||||
|
|
||||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
|
||||||
run.path("src/tools/suggest-tests")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn make_run(run: RunConfig<'_>) {
|
|
||||||
run.builder.ensure(SuggestTestsCrate { host: run.target });
|
|
||||||
}
|
|
||||||
|
|
||||||
fn run(self, builder: &Builder<'_>) {
|
|
||||||
let bootstrap_host = builder.config.build;
|
|
||||||
let compiler = builder.compiler(0, bootstrap_host);
|
|
||||||
|
|
||||||
let cargo = tool::prepare_tool_cargo(
|
|
||||||
builder,
|
|
||||||
compiler,
|
|
||||||
Mode::ToolBootstrap,
|
|
||||||
bootstrap_host,
|
bootstrap_host,
|
||||||
"test",
|
));
|
||||||
"src/tools/suggest-tests",
|
|
||||||
SourceType::InTree,
|
|
||||||
&[],
|
|
||||||
);
|
|
||||||
run_cargo_test(cargo, &[], &[], compiler, bootstrap_host, builder);
|
run_cargo_test(cargo, &[], &[], compiler, bootstrap_host, builder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1151,40 +1132,6 @@ help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Runs tidy's own tests.
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
|
||||||
pub struct TidySelfTest;
|
|
||||||
|
|
||||||
impl Step for TidySelfTest {
|
|
||||||
type Output = ();
|
|
||||||
const DEFAULT: bool = true;
|
|
||||||
const ONLY_HOSTS: bool = true;
|
|
||||||
|
|
||||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
|
||||||
run.alias("tidyselftest")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn make_run(run: RunConfig<'_>) {
|
|
||||||
run.builder.ensure(TidySelfTest);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn run(self, builder: &Builder<'_>) {
|
|
||||||
let bootstrap_host = builder.config.build;
|
|
||||||
let compiler = builder.compiler(0, bootstrap_host);
|
|
||||||
let cargo = tool::prepare_tool_cargo(
|
|
||||||
builder,
|
|
||||||
compiler,
|
|
||||||
Mode::ToolBootstrap,
|
|
||||||
bootstrap_host,
|
|
||||||
"test",
|
|
||||||
"src/tools/tidy",
|
|
||||||
SourceType::InTree,
|
|
||||||
&[],
|
|
||||||
);
|
|
||||||
run_cargo_test(cargo, &[], &[], compiler, bootstrap_host, builder);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
pub struct ExpandYamlAnchors;
|
pub struct ExpandYamlAnchors;
|
||||||
|
|
||||||
@ -2613,43 +2560,6 @@ impl Step for TierCheck {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
|
||||||
pub struct ReplacePlaceholderTest;
|
|
||||||
|
|
||||||
impl Step for ReplacePlaceholderTest {
|
|
||||||
type Output = ();
|
|
||||||
const ONLY_HOSTS: bool = true;
|
|
||||||
const DEFAULT: bool = true;
|
|
||||||
|
|
||||||
/// Ensure the version placeholder replacement tool builds
|
|
||||||
fn run(self, builder: &Builder<'_>) {
|
|
||||||
builder.info("build check for version replacement placeholder");
|
|
||||||
|
|
||||||
// Test the version placeholder replacement tool itself.
|
|
||||||
let bootstrap_host = builder.config.build;
|
|
||||||
let compiler = builder.compiler(0, bootstrap_host);
|
|
||||||
let cargo = tool::prepare_tool_cargo(
|
|
||||||
builder,
|
|
||||||
compiler,
|
|
||||||
Mode::ToolBootstrap,
|
|
||||||
bootstrap_host,
|
|
||||||
"test",
|
|
||||||
"src/tools/replace-version-placeholder",
|
|
||||||
SourceType::InTree,
|
|
||||||
&[],
|
|
||||||
);
|
|
||||||
add_flags_and_try_run_tests(builder, &mut cargo.into());
|
|
||||||
}
|
|
||||||
|
|
||||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
|
||||||
run.path("src/tools/replace-version-placeholder")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn make_run(run: RunConfig<'_>) {
|
|
||||||
run.builder.ensure(Self);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
pub struct LintDocs {
|
pub struct LintDocs {
|
||||||
pub compiler: Compiler,
|
pub compiler: Compiler,
|
||||||
|
@ -141,7 +141,7 @@ pub fn prepare_tool_cargo(
|
|||||||
mode: Mode,
|
mode: Mode,
|
||||||
target: TargetSelection,
|
target: TargetSelection,
|
||||||
command: &'static str,
|
command: &'static str,
|
||||||
path: &'static str,
|
path: &str,
|
||||||
source_type: SourceType,
|
source_type: SourceType,
|
||||||
extra_features: &[String],
|
extra_features: &[String],
|
||||||
) -> CargoCommand {
|
) -> CargoCommand {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user