Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cfd3cee

Browse files
committedJan 4, 2025·
Apply a clearer naming convention to many of the test steps
1 parent 4936174 commit cfd3cee

File tree

4 files changed

+206
-179
lines changed

4 files changed

+206
-179
lines changed
 

‎src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ impl Step for StdLink {
627627
let target_compiler = self.target_compiler;
628628
let target = self.target;
629629

630-
// NOTE: intentionally does *not* check `target == builder.build` to avoid having to add the same check in `test::Crate`.
630+
// NOTE: intentionally does *not* check `target == builder.build` to avoid having to add the same check in `test::SelftestLibraryOrOtherCrate`.
631631
let (libdir, hostdir) = if self.force_recompile && builder.download_rustc() {
632632
// NOTE: copies part of `sysroot_libdir` to avoid having to add a new `force_recompile` argument there too
633633
let lib = builder.sysroot_libdir_relative(self.compiler);

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

Lines changed: 133 additions & 111 deletions
Large diffs are not rendered by default.

‎src/bootstrap/src/core/builder/mod.rs

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,8 @@ impl<'a> ShouldRun<'a> {
705705
/// removing the matches from `paths`.
706706
///
707707
/// NOTE: this returns multiple PathSets to allow for the possibility of multiple units of work
708-
/// within the same step. For example, `test::Crate` allows testing multiple crates in the same
709-
/// cargo invocation, which are put into separate sets because they aren't aliases.
708+
/// within the same step. For example, `test::SelftestLibraryOrOtherCrate` allows testing multiple
709+
/// crates in the same cargo invocation, which are put into separate sets because they aren't aliases.
710710
///
711711
/// The reason we return PathSet instead of PathBuf is to allow for aliases that mean the same thing
712712
/// (for now, just `all_krates` and `paths`, but we may want to add an `aliases` function in the future?)
@@ -939,70 +939,72 @@ impl<'a> Builder<'a> {
939939
),
940940
Kind::Test => describe!(
941941
crate::core::build_steps::toolstate::ToolStateCheck,
942-
test::Tidy,
943-
test::Ui,
944-
test::Crashes,
945-
test::Coverage,
946-
test::CoverageMap,
947-
test::CoverageRun,
948-
test::MirOpt,
949-
test::Codegen,
950-
test::CodegenUnits,
951-
test::Assembly,
952-
test::Incremental,
953-
test::Debuginfo,
954-
test::UiFullDeps,
955-
test::Rustdoc,
956-
test::CoverageRunRustdoc,
957-
test::Pretty,
958-
test::CodegenCranelift,
959-
test::CodegenGCC,
960-
test::Crate,
961-
test::CrateLibrustc,
962-
test::CrateRustdoc,
963-
test::CrateRustdocJsonTypes,
964-
test::CrateBootstrap,
942+
test::InvokeTidy,
943+
test::SuiteUi,
944+
test::SuiteCrashes,
945+
test::SuiteCoverage,
946+
test::SuiteCoverageMap,
947+
test::SuiteCoverageRun,
948+
test::SuiteMirOpt,
949+
test::SuiteCodegen,
950+
test::SuiteCodegenUnits,
951+
test::SuiteAssembly,
952+
test::SuiteIncremental,
953+
test::SuiteDebuginfo,
954+
test::SuiteUiFullDeps,
955+
test::SuiteRustdoc,
956+
test::SuiteCoverageRunRustdoc,
957+
test::SuitePretty,
958+
test::SelftestCodegenCranelift,
959+
test::SelftestCodegenGCC,
960+
test::SelftestLibraryOrOtherCrates,
961+
test::SelftestCompilerCrates,
962+
test::SelftestRustdoc,
963+
test::SelftestRustdocJsonTypes,
964+
test::SelftestMiscBootstrapTools,
965965
test::Linkcheck,
966966
test::TierCheck,
967967
test::Cargotest,
968-
test::Cargo,
969-
test::RustAnalyzer,
968+
test::SelftestCargo,
969+
test::SelftestRustAnalyzer,
970970
test::ErrorIndex,
971971
test::Distcheck,
972-
test::Nomicon,
973-
test::Reference,
974-
test::RustdocBook,
975-
test::RustByExample,
976-
test::TheBook,
977-
test::UnstableBook,
978-
test::RustcBook,
972+
test::BooktestNomicon,
973+
test::BooktestReference,
974+
test::BooktestRustdocBook,
975+
test::BooktestRustByExample,
976+
test::BooktestTheBook,
977+
test::BooktestUnstableBook,
978+
test::BooktestRustcBook,
979979
test::LintDocs,
980-
test::EmbeddedBook,
981-
test::EditionGuide,
982-
test::Rustfmt,
983-
test::Miri,
980+
test::BooktestEmbeddedBook,
981+
test::BooktestEditionGuide,
982+
test::SelftestRustfmt,
983+
test::SelftestMiri,
984984
test::CargoMiri,
985-
test::Clippy,
986-
test::CompiletestTest,
987-
test::CrateRunMakeSupport,
988-
test::CrateBuildHelper,
989-
test::RustdocJSStd,
990-
test::RustdocJSNotStd,
991-
test::RustdocGUI,
985+
test::SelftestClippy,
986+
test::SelftestCompiletest,
987+
test::SelftestRunMakeSupport,
988+
test::SelftestBuildHelper,
989+
test::SuiteRustdocJSStd,
990+
test::SuiteRustdocJSNotStd,
991+
test::SuiteRustdocGUI,
992992
test::RustdocTheme,
993-
test::RustdocUi,
994-
test::RustdocJson,
993+
test::SuiteRustdocUi,
994+
test::SuiteRustdocJson,
995995
test::HtmlCheck,
996996
test::RustInstaller,
997997
test::TestFloatParse,
998998
test::CollectLicenseMetadata,
999999
// Run bootstrap close to the end as it's unlikely to fail
1000-
test::Bootstrap,
1000+
test::SelftestBootstrap,
10011001
// Run run-make last, since these won't pass without make on Windows
1002-
test::RunMake,
1002+
test::SuiteRunMake,
10031003
),
1004-
Kind::Miri => describe!(test::Crate),
1005-
Kind::Bench => describe!(test::Crate, test::CrateLibrustc),
1004+
Kind::Miri => describe!(test::SelftestLibraryOrOtherCrates),
1005+
Kind::Bench => {
1006+
describe!(test::SelftestLibraryOrOtherCrates, test::SelftestCompilerCrates)
1007+
}
10061008
Kind::Doc => describe!(
10071009
doc::UnstableBook,
10081010
doc::UnstableBookGen,

‎src/bootstrap/src/core/builder/tests.rs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ fn test_exclude() {
185185
let cache = run_build(&[], config);
186186

187187
// Ensure we have really excluded tidy
188-
assert!(!cache.contains::<test::Tidy>());
188+
assert!(!cache.contains::<test::InvokeTidy>());
189189

190190
// Ensure other tests are not affected.
191-
assert!(cache.contains::<test::RustdocUi>());
191+
assert!(cache.contains::<test::SuiteRustdocUi>());
192192
}
193193

194194
#[test]
@@ -197,10 +197,10 @@ fn test_exclude_kind() {
197197

198198
let mut config = configure("test", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]);
199199
// Ensure our test is valid, and `test::Rustc` would be run without the exclude.
200-
assert!(run_build(&[], config.clone()).contains::<test::CrateLibrustc>());
200+
assert!(run_build(&[], config.clone()).contains::<test::SelftestCompilerCrates>());
201201
// Ensure tests for rustc are not skipped.
202202
config.skip = vec![path.clone()];
203-
assert!(run_build(&[], config.clone()).contains::<test::CrateLibrustc>());
203+
assert!(run_build(&[], config.clone()).contains::<test::SelftestCompilerCrates>());
204204
// Ensure builds for rustc are not skipped.
205205
assert!(run_build(&[], config).contains::<compile::Rustc>());
206206
}
@@ -669,18 +669,21 @@ mod dist {
669669

670670
let host = TargetSelection::from_user(TEST_TRIPLE_1);
671671

672-
builder.run_step_descriptions(&[StepDescription::from::<test::Crate>(Kind::Test)], &[
673-
"library/std".into(),
674-
]);
672+
builder.run_step_descriptions(
673+
&[StepDescription::from::<test::SelftestLibraryOrOtherCrates>(Kind::Test)],
674+
&["library/std".into()],
675+
);
675676

676677
// Ensure we don't build any compiler artifacts.
677678
assert!(!builder.cache.contains::<compile::Rustc>());
678-
assert_eq!(first(builder.cache.all::<test::Crate>()), &[test::Crate {
679-
compiler: Compiler { host, stage: 0 },
680-
target: host,
681-
mode: crate::Mode::Std,
682-
crates: vec!["std".to_owned()],
683-
},]);
679+
assert_eq!(first(builder.cache.all::<test::SelftestLibraryOrOtherCrates>()), &[
680+
test::SelftestLibraryOrOtherCrates {
681+
compiler: Compiler { host, stage: 0 },
682+
target: host,
683+
mode: crate::Mode::Std,
684+
crates: vec!["std".to_owned()],
685+
},
686+
]);
684687
}
685688

686689
#[test]
@@ -822,9 +825,9 @@ fn test_test_compiler() {
822825
let config = configure_with_args(cmd, &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]);
823826
let cache = run_build(&config.paths.clone(), config);
824827

825-
let compiler = cache.contains::<test::CrateLibrustc>();
826-
let cranelift = cache.contains::<test::CodegenCranelift>();
827-
let gcc = cache.contains::<test::CodegenGCC>();
828+
let compiler = cache.contains::<test::SelftestCompilerCrates>();
829+
let cranelift = cache.contains::<test::SelftestCodegenCranelift>();
830+
let gcc = cache.contains::<test::SelftestCodegenGCC>();
828831

829832
assert_eq!((compiler, cranelift, gcc), (true, false, false));
830833
}

0 commit comments

Comments
 (0)
Please sign in to comment.