@@ -45,8 +45,12 @@ impl<T: Write> PrettyFormatter<T> {
45
45
self . write_short_result ( "FAILED" , term:: color:: RED )
46
46
}
47
47
48
- pub fn write_ignored ( & mut self ) -> io:: Result < ( ) > {
49
- self . write_short_result ( "ignored" , term:: color:: YELLOW )
48
+ pub fn write_ignored ( & mut self , may_message : Option < & ' static str > ) -> io:: Result < ( ) > {
49
+ if let Some ( message) = may_message {
50
+ self . write_short_result ( & format ! ( "ignored, {}" , message) , term:: color:: YELLOW )
51
+ } else {
52
+ self . write_short_result ( "ignored" , term:: color:: YELLOW )
53
+ }
50
54
}
51
55
52
56
pub fn write_time_failed ( & mut self ) -> io:: Result < ( ) > {
@@ -59,10 +63,10 @@ impl<T: Write> PrettyFormatter<T> {
59
63
60
64
pub fn write_short_result (
61
65
& mut self ,
62
- result : & str ,
66
+ result : impl AsRef < str > ,
63
67
color : term:: color:: Color ,
64
68
) -> io:: Result < ( ) > {
65
- self . write_pretty ( result, color)
69
+ self . write_pretty ( result. as_ref ( ) , color)
66
70
}
67
71
68
72
pub fn write_pretty ( & mut self , word : & str , color : term:: color:: Color ) -> io:: Result < ( ) > {
@@ -214,7 +218,12 @@ impl<T: Write> OutputFormatter for PrettyFormatter<T> {
214
218
match * result {
215
219
TestResult :: TrOk => self . write_ok ( ) ?,
216
220
TestResult :: TrFailed | TestResult :: TrFailedMsg ( _) => self . write_failed ( ) ?,
217
- TestResult :: TrIgnored => self . write_ignored ( ) ?,
221
+ TestResult :: TrIgnored => {
222
+ #[ cfg( not( bootstrap) ) ]
223
+ self . write_ignored ( desc. ignore_message ) ?;
224
+ #[ cfg( bootstrap) ]
225
+ self . write_ignored ( None ) ?;
226
+ }
218
227
TestResult :: TrBench ( ref bs) => {
219
228
self . write_bench ( ) ?;
220
229
self . write_plain ( & format ! ( ": {}" , fmt_bench_samples( bs) ) ) ?;
0 commit comments