From 19b8f9e17cf86cf83bd1fc742cf159605d0504dd Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Mon, 9 Sep 2024 18:47:38 +0300 Subject: [PATCH 1/2] use verbose flag as a default value for `rust.verbose-tests` Signed-off-by: onur-ozkan --- src/bootstrap/src/core/config/config.rs | 3 +++ src/bootstrap/src/core/config/tests.rs | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 68b42305fdcc8..de861c42c4c4e 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -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); diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs index 219c5a6ec914e..f54a5d3b5125d 100644 --- a/src/bootstrap/src/core/config/tests.rs +++ b/src/bootstrap/src/core/config/tests.rs @@ -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); +} From 13ea104798dfdb31613963d49be43e615c6f6dfe Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Mon, 9 Sep 2024 18:56:37 +0300 Subject: [PATCH 2/2] update `rust.verbose-tests` doc in `config.example.toml` Signed-off-by: onur-ozkan --- config.example.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.example.toml b/config.example.toml index e9433c9c9bd08..17fe9be7d567f 100644 --- a/config.example.toml +++ b/config.example.toml @@ -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