]> git.lizzy.rs Git - rust.git/blobdiff - library/test/src/formatters/pretty.rs
Rollup merge of #94605 - Michcioperz:patch-1, r=pnkfelix
[rust.git] / library / test / src / formatters / pretty.rs
index f55d390aa562130d4da2eb674d4c32a6937f2cb6..694202229802f832fd5cab66db22c2464f8077e4 100644 (file)
@@ -45,8 +45,12 @@ pub fn write_failed(&mut self) -> io::Result<()> {
         self.write_short_result("FAILED", term::color::RED)
     }
 
-    pub fn write_ignored(&mut self) -> io::Result<()> {
-        self.write_short_result("ignored", term::color::YELLOW)
+    pub fn write_ignored(&mut self, message: Option<&'static str>) -> io::Result<()> {
+        if let Some(message) = message {
+            self.write_short_result(&format!("ignored, {}", message), term::color::YELLOW)
+        } else {
+            self.write_short_result("ignored", term::color::YELLOW)
+        }
     }
 
     pub fn write_time_failed(&mut self) -> io::Result<()> {
@@ -214,7 +218,7 @@ fn write_result(
         match *result {
             TestResult::TrOk => self.write_ok()?,
             TestResult::TrFailed | TestResult::TrFailedMsg(_) => self.write_failed()?,
-            TestResult::TrIgnored => self.write_ignored()?,
+            TestResult::TrIgnored => self.write_ignored(desc.ignore_message)?,
             TestResult::TrBench(ref bs) => {
                 self.write_bench()?;
                 self.write_plain(&format!(": {}", fmt_bench_samples(bs)))?;