Skip to content

Commit 7c109b1

Browse files
authored
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.
2 parents 3b0221b + 13ea104 commit 7c109b1

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

config.example.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@
641641
#stack-protector = "none"
642642

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

646646
# Flag indicating whether tests are compiled with optimizations (the -O flag).
647647
#optimize-tests = true

src/bootstrap/src/core/config/config.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1600,6 +1600,9 @@ impl Config {
16001600

16011601
config.verbose = cmp::max(config.verbose, flags.verbose as usize);
16021602

1603+
// Verbose flag is a good default for `rust.verbose-tests`.
1604+
config.verbose_tests = config.is_verbose();
1605+
16031606
if let Some(install) = toml.install {
16041607
let Install { prefix, sysconfdir, docdir, bindir, libdir, mandir, datadir } = install;
16051608
config.prefix = prefix.map(PathBuf::from);

src/bootstrap/src/core/config/tests.rs

+9
Original file line numberDiff line numberDiff line change
@@ -317,3 +317,12 @@ fn order_of_clippy_rules() {
317317

318318
assert_eq!(expected, actual);
319319
}
320+
321+
#[test]
322+
fn verbose_tests_default_value() {
323+
let config = Config::parse(Flags::parse(&["build".into(), "compiler".into()]));
324+
assert_eq!(config.verbose_tests, false);
325+
326+
let config = Config::parse(Flags::parse(&["build".into(), "compiler".into(), "-v".into()]));
327+
assert_eq!(config.verbose_tests, true);
328+
}

0 commit comments

Comments
 (0)