@@ -22,6 +22,7 @@ pub mod util;
22
22
use core:: panic;
23
23
use std:: collections:: HashSet ;
24
24
use std:: ffi:: OsString ;
25
+ use std:: fmt:: Write ;
25
26
use std:: io:: { self , ErrorKind } ;
26
27
use std:: path:: { Path , PathBuf } ;
27
28
use std:: process:: { Command , Stdio } ;
@@ -570,18 +571,22 @@ pub fn run_tests(config: Arc<Config>) {
570
571
// easy to miss which tests failed, and as such fail to reproduce
571
572
// the failure locally.
572
573
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}" ) ;
585
590
586
591
std:: process:: exit ( 1 ) ;
587
592
}
0 commit comments