use verbose flag as a default value for rust.verbose-tests

Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
onur-ozkan 2024-09-09 18:47:38 +03:00
parent 263a3aeeb8
commit 19b8f9e17c
2 changed files with 12 additions and 0 deletions

View file

@ -1600,6 +1600,9 @@ impl Config {
config.verbose = cmp::max(config.verbose, flags.verbose as usize);
// Verbose flag is a good default for `rust.verbose-tests`.
config.verbose_tests = config.is_verbose();
if let Some(install) = toml.install {
let Install { prefix, sysconfdir, docdir, bindir, libdir, mandir, datadir } = install;
config.prefix = prefix.map(PathBuf::from);

View file

@ -317,3 +317,12 @@ fn order_of_clippy_rules() {
assert_eq!(expected, actual);
}
#[test]
fn verbose_tests_default_value() {
let config = Config::parse(Flags::parse(&["build".into(), "compiler".into()]));
assert_eq!(config.verbose_tests, false);
let config = Config::parse(Flags::parse(&["build".into(), "compiler".into(), "-v".into()]));
assert_eq!(config.verbose_tests, true);
}