fix: add extra_test_bin_args to test explorer test runner

trim whitespace
This commit is contained in:
duncan 2024-08-25 11:04:52 +01:00
parent f4dbbac7ca
commit 18081eabd0
3 changed files with 8 additions and 0 deletions

View file

@ -1884,6 +1884,7 @@ impl Config {
CargoFeaturesDef::Selected(it) => it, CargoFeaturesDef::Selected(it) => it,
}, },
extra_args: self.extra_args().clone(), extra_args: self.extra_args().clone(),
extra_test_bin_args: self.runnables_extraTestBinaryArgs().clone(),
extra_env: self.extra_env().clone(), extra_env: self.extra_env().clone(),
target_dir: self.target_dir_from_config(), target_dir: self.target_dir_from_config(),
} }
@ -1934,6 +1935,7 @@ impl Config {
CargoFeaturesDef::Selected(it) => it, CargoFeaturesDef::Selected(it) => it,
}, },
extra_args: self.check_extra_args(), extra_args: self.check_extra_args(),
extra_test_bin_args: self.runnables_extraTestBinaryArgs().clone(),
extra_env: self.check_extra_env(), extra_env: self.check_extra_env(),
target_dir: self.target_dir_from_config(), target_dir: self.target_dir_from_config(),
}, },

View file

@ -30,6 +30,7 @@ pub(crate) struct CargoOptions {
pub(crate) all_features: bool, pub(crate) all_features: bool,
pub(crate) features: Vec<String>, pub(crate) features: Vec<String>,
pub(crate) extra_args: 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) extra_env: FxHashMap<String, String>,
pub(crate) target_dir: Option<Utf8PathBuf>, pub(crate) target_dir: Option<Utf8PathBuf>,
} }

View file

@ -102,6 +102,11 @@ impl CargoTestHandle {
} }
cmd.args(["-Z", "unstable-options"]); cmd.args(["-Z", "unstable-options"]);
cmd.arg("--format=json"); cmd.arg("--format=json");
for extra_arg in options.extra_test_bin_args {
cmd.arg(extra_arg);
}
Ok(Self { _handle: CommandHandle::spawn(cmd, sender)? }) Ok(Self { _handle: CommandHandle::spawn(cmd, sender)? })
} }
} }