Skip to content

Commit

Permalink
Rollup merge of rust-lang#130153 - onur-ozkan:verbose-to-verbose-test…
Browse files Browse the repository at this point in the history
…s, r=Kobzol

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

See the [Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Run.20tests.20in.20x.2Epy.20with.20.22pretty.22.20test.20rendering.3F) for more context.
  • Loading branch information
matthiaskrgr authored Sep 9, 2024
2 parents 45e315d + 13ea104 commit 76247b0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@
#stack-protector = "none"

# Prints each test name as it is executed, to help debug issues in the test harness itself.
#verbose-tests = false
#verbose-tests = if is_verbose { true } else { false }

# Flag indicating whether tests are compiled with optimizations (the -O flag).
#optimize-tests = true
Expand Down
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 76247b0

Please sign in to comment.