File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -159,10 +159,8 @@ pub fn run_tests<T>(
159159 process_result ( result, & mut test, cfg, timings)
160160 } else {
161161 println ! ( "{} (diagnostics)" , Colour :: Red . bold( ) . paint( "FAILED" ) ) ;
162- if cfg. verbose {
163- let formatter = Formatter :: new ( & test. source , warnings) ;
164- println ! ( "{formatter}" ) ;
165- }
162+ let formatter = Formatter :: new ( & test. source , warnings) ;
163+ println ! ( "{formatter}" ) ;
166164 // mark as failure, did not expect any warnings
167165 true
168166 }
@@ -331,10 +329,15 @@ fn process_compilation_diagnostics(
331329 println ! ( "{diff}" ) ;
332330 }
333331
332+ // Always print diagnostics when test fails
333+ formatter. enable_colors ( true ) ;
334+ println ! ( "{formatter:#}" ) ;
335+
334336 failed = true ;
335337 }
336338
337- if cfg. verbose {
339+ if cfg. verbose && !failed {
340+ // In verbose mode, print diagnostics even for passing tests
338341 formatter. enable_colors ( true ) ;
339342 println ! ( "{formatter:#}" ) ;
340343 }
You can’t perform that action at this time.
0 commit comments