Skip to content

Commit ed75219

Browse files
authored
Rollup merge of rust-lang#138999 - jieyouxu:spellout-pass-mode, r=wesleywiser
Report compiletest pass mode if forced This is very non-obvious if it fails in PR CI, because the starting invocation is miles away from the final test suite outcome.
2 parents 322d1c1 + 3d58aec commit ed75219

File tree

1 file changed

+17
-12
lines changed
  • src/tools/compiletest/src

1 file changed

+17
-12
lines changed

Diff for: src/tools/compiletest/src/lib.rs

+17-12
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub mod util;
2222
use core::panic;
2323
use std::collections::HashSet;
2424
use std::ffi::OsString;
25+
use std::fmt::Write;
2526
use std::io::{self, ErrorKind};
2627
use std::path::{Path, PathBuf};
2728
use std::process::{Command, Stdio};
@@ -570,18 +571,22 @@ pub fn run_tests(config: Arc<Config>) {
570571
// easy to miss which tests failed, and as such fail to reproduce
571572
// the failure locally.
572573

573-
println!(
574-
"Some tests failed in compiletest suite={}{} mode={} host={} target={}",
575-
config.suite,
576-
config
577-
.compare_mode
578-
.as_ref()
579-
.map(|c| format!(" compare_mode={:?}", c))
580-
.unwrap_or_default(),
581-
config.mode,
582-
config.host,
583-
config.target
584-
);
574+
let mut msg = String::from("Some tests failed in compiletest");
575+
write!(msg, " suite={}", config.suite).unwrap();
576+
577+
if let Some(compare_mode) = config.compare_mode.as_ref() {
578+
write!(msg, " compare_mode={}", compare_mode).unwrap();
579+
}
580+
581+
if let Some(pass_mode) = config.force_pass_mode.as_ref() {
582+
write!(msg, " pass_mode={}", pass_mode).unwrap();
583+
}
584+
585+
write!(msg, " mode={}", config.mode).unwrap();
586+
write!(msg, " host={}", config.host).unwrap();
587+
write!(msg, " target={}", config.target).unwrap();
588+
589+
println!("{msg}");
585590

586591
std::process::exit(1);
587592
}

0 commit comments

Comments
 (0)