Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ impl Step for Clippy {
const DEFAULT: bool = false;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/tools/clippy")
run.suite_path("src/tools/clippy/tests").path("src/tools/clippy")
}

fn make_run(run: RunConfig<'_>) {
Expand Down Expand Up @@ -783,6 +783,23 @@ impl Step for Clippy {
let host_libs = builder.stage_out(compiler, Mode::ToolRustc).join(builder.cargo_dir());
cargo.env("HOST_LIBS", host_libs);

// Collect paths of tests to run
'partially_test: {
let paths = &builder.config.paths[..];
let mut test_names = Vec::new();
for path in paths {
if let Some(path) =
helpers::is_valid_test_suite_arg(path, "src/tools/clippy/tests", builder)
{
test_names.push(path);
} else if path.ends_with("src/tools/clippy") {
// When src/tools/clippy is called directly, all tests should be run.
break 'partially_test;
}
}
cargo.env("TESTNAME", test_names.join(","));
}

cargo.add_rustc_lib_path(builder);
let cargo = prepare_cargo_test(cargo, &[], &[], host, builder);

Expand Down
Loading