Skip to content

Commit e0b1719

Browse files
committed
Auto merge of rust-lang#17960 - duncanawoods:master, r=HKalbasi
fix: add extra_test_bin_args to test explorer test runner `@HKalbasi` I thought I included this in rust-lang#17470 but it appears not so I have created a new issue rust-lang#17959 for this fix.
2 parents 31a532a + 2703ea1 commit e0b1719

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,6 +1884,7 @@ impl Config {
18841884
CargoFeaturesDef::Selected(it) => it,
18851885
},
18861886
extra_args: self.extra_args().clone(),
1887+
extra_test_bin_args: self.runnables_extraTestBinaryArgs().clone(),
18871888
extra_env: self.extra_env().clone(),
18881889
target_dir: self.target_dir_from_config(),
18891890
}
@@ -1934,6 +1935,7 @@ impl Config {
19341935
CargoFeaturesDef::Selected(it) => it,
19351936
},
19361937
extra_args: self.check_extra_args(),
1938+
extra_test_bin_args: self.runnables_extraTestBinaryArgs().clone(),
19371939
extra_env: self.check_extra_env(),
19381940
target_dir: self.target_dir_from_config(),
19391941
},

src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub(crate) struct CargoOptions {
3030
pub(crate) all_features: bool,
3131
pub(crate) features: Vec<String>,
3232
pub(crate) extra_args: Vec<String>,
33+
pub(crate) extra_test_bin_args: Vec<String>,
3334
pub(crate) extra_env: FxHashMap<String, String>,
3435
pub(crate) target_dir: Option<Utf8PathBuf>,
3536
}

src/tools/rust-analyzer/crates/rust-analyzer/src/test_runner.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ impl CargoTestHandle {
102102
}
103103
cmd.args(["-Z", "unstable-options"]);
104104
cmd.arg("--format=json");
105+
106+
for extra_arg in options.extra_test_bin_args {
107+
cmd.arg(extra_arg);
108+
}
109+
105110
Ok(Self { _handle: CommandHandle::spawn(cmd, sender)? })
106111
}
107112
}

0 commit comments

Comments
 (0)