Skip to content

Commit

Permalink
Auto merge of #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 #17470 but it appears not so I have created a new issue #17959 for this fix.
  • Loading branch information
bors committed Aug 25, 2024
2 parents 316590f + 18081ea commit 7106cd3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 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
1 change: 1 addition & 0 deletions crates/rust-analyzer/src/flycheck.rs
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
5 changes: 5 additions & 0 deletions crates/rust-analyzer/src/test_runner.rs
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 7106cd3

Please sign in to comment.