Rollup merge of #130153 - onur-ozkan:verbose-to-verbose-tests, 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.
This commit is contained in:
Matthias Krüger 2024-09-09 20:20:20 +02:00 committed by GitHub
commit 7c109b152b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 1 deletions

View File

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

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);
}