@@ -47,8 +47,12 @@ impl<T: Write> TerseFormatter<T> {
47
47
self . write_short_result ( "." , term:: color:: GREEN )
48
48
}
49
49
50
- pub fn write_failed ( & mut self ) -> io:: Result < ( ) > {
51
- self . write_short_result ( "F" , term:: color:: RED )
50
+ pub fn write_failed ( & mut self , name : & str ) -> io:: Result < ( ) > {
51
+ // Put failed tests on their own line and include the test name, so that it's faster
52
+ // to see which test failed without having to wait for them all to run.
53
+ self . write_plain ( format ! ( "\n {name} --- " ) ) ?;
54
+ self . write_pretty ( "F" , term:: color:: RED ) ?;
55
+ self . write_progress ( )
52
56
}
53
57
54
58
pub fn write_ignored ( & mut self ) -> io:: Result < ( ) > {
@@ -65,15 +69,21 @@ impl<T: Write> TerseFormatter<T> {
65
69
color : term:: color:: Color ,
66
70
) -> io:: Result < ( ) > {
67
71
self . write_pretty ( result, color) ?;
68
- if self . test_column % QUIET_MODE_MAX_COLUMN == QUIET_MODE_MAX_COLUMN - 1 {
72
+ self . test_column += 1 ;
73
+ if self . test_column == QUIET_MODE_MAX_COLUMN {
69
74
// We insert a new line regularly in order to flush the
70
75
// screen when dealing with line-buffered output (e.g., piping to
71
76
// `stamp` in the rust CI).
72
- let out = format ! ( " {}/{}\n " , self . test_column + 1 , self . total_test_count) ;
73
- self . write_plain ( out) ?;
77
+ self . write_progress ( ) ?;
74
78
}
75
79
76
- self . test_column += 1 ;
80
+ Ok ( ( ) )
81
+ }
82
+
83
+ fn write_progress ( & mut self ) -> io:: Result < ( ) > {
84
+ let out = format ! ( " {}/{}\n " , self . test_column, self . total_test_count) ;
85
+ self . write_plain ( out) ?;
86
+ self . test_column = 0 ;
77
87
Ok ( ( ) )
78
88
}
79
89
@@ -213,7 +223,7 @@ impl<T: Write> OutputFormatter for TerseFormatter<T> {
213
223
match * result {
214
224
TestResult :: TrOk => self . write_ok ( ) ,
215
225
TestResult :: TrFailed | TestResult :: TrFailedMsg ( _) | TestResult :: TrTimedFail => {
216
- self . write_failed ( )
226
+ self . write_failed ( desc . name . as_slice ( ) )
217
227
}
218
228
TestResult :: TrIgnored => self . write_ignored ( ) ,
219
229
TestResult :: TrBench ( ref bs) => {
0 commit comments