Skip to content

Commit

Permalink
Auto merge of rust-lang#17960 - duncanawoods:master, r=HKalbasi
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Aug 25, 2024
2 parents 31a532a + 2703ea1 commit e0b1719
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,7 @@ impl Config {
CargoFeaturesDef::Selected(it) => it,
},
extra_args: self.extra_args().clone(),
extra_test_bin_args: self.runnables_extraTestBinaryArgs().clone(),
extra_env: self.extra_env().clone(),
target_dir: self.target_dir_from_config(),
}
Expand Down Expand Up @@ -1934,6 +1935,7 @@ impl Config {
CargoFeaturesDef::Selected(it) => it,
},
extra_args: self.check_extra_args(),
extra_test_bin_args: self.runnables_extraTestBinaryArgs().clone(),
extra_env: self.check_extra_env(),
target_dir: self.target_dir_from_config(),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub(crate) struct CargoOptions {
pub(crate) all_features: bool,
pub(crate) features: Vec<String>,
pub(crate) extra_args: Vec<String>,
pub(crate) extra_test_bin_args: Vec<String>,
pub(crate) extra_env: FxHashMap<String, String>,
pub(crate) target_dir: Option<Utf8PathBuf>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ impl CargoTestHandle {
}
cmd.args(["-Z", "unstable-options"]);
cmd.arg("--format=json");

for extra_arg in options.extra_test_bin_args {
cmd.arg(extra_arg);
}

Ok(Self { _handle: CommandHandle::spawn(cmd, sender)? })
}
}

0 comments on commit e0b1719

Please sign in to comment.