Auto merge of #17960 - duncanawoods:master, r=HKalbasi

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.
This commit is contained in:
bors 2024-08-25 11:48:32 +00:00
commit 7106cd3be5
3 changed files with 8 additions and 0 deletions

View file

@ -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(),
}
@ -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(),
},

View file

@ -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>,
}

View file

@ -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)? })
}
}