Skip to content

Commit 1721cc1

Browse files
committed
clippy: fix test filtering when TESTNAME is empty
1 parent 855e0fe commit 1721cc1

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,9 @@ impl Step for CargoMiri {
680680
cargo.arg("--doc");
681681
}
682682
}
683-
684-
// Finally, pass test-args and run everything.
685683
cargo.arg("--").args(builder.config.test_args());
684+
685+
// Finally, run everything.
686686
let mut cargo = BootstrapCommand::from(cargo);
687687
{
688688
let _guard = builder.msg_sysroot_tool(Kind::Test, stage, "cargo-miri", host, target);

src/tools/clippy/tests/compile-test.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,15 @@ impl TestContext {
145145
let mut config = Config {
146146
output_conflict_handling: error_on_output_conflict,
147147
filter_files: env::var("TESTNAME")
148-
.map(|filters| filters.split(',').map(str::to_string).collect())
148+
.map(|filters| {
149+
filters
150+
.split(',')
151+
// Make sure that if TESTNAME is empty we produce the empty list here,
152+
// not a list containing an empty string.
153+
.filter(|s| !s.is_empty())
154+
.map(str::to_string)
155+
.collect()
156+
})
149157
.unwrap_or_default(),
150158
target: None,
151159
bless_command: Some(if IS_RUSTC_TEST_SUITE {

0 commit comments

Comments
 (0)