Skip to content

Commit

Permalink
use verbose flag as a default value for rust.verbose-tests
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Sep 9, 2024
1 parent 263a3ae commit 19b8f9e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions src/bootstrap/src/core/config/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 19b8f9e

Please sign in to comment.