about summary refs log tree commit diff
path: root/library/test/src/formatters/json.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/test/src/formatters/json.rs')
-rw-r--r--library/test/src/formatters/json.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/library/test/src/formatters/json.rs b/library/test/src/formatters/json.rs
index 92c1c0716f1..4a101f00d74 100644
--- a/library/test/src/formatters/json.rs
+++ b/library/test/src/formatters/json.rs
@@ -215,6 +215,17 @@ impl<T: Write> OutputFormatter for JsonFormatter<T> {
 
         Ok(state.failed == 0)
     }
+
+    fn write_merged_doctests_times(
+        &mut self,
+        total_time: f64,
+        compilation_time: f64,
+    ) -> io::Result<()> {
+        let newline = "\n";
+        self.writeln_message(&format!(
+            r#"{{ "type": "report", "total_time": {total_time}, "compilation_time": {compilation_time} }}{newline}"#,
+        ))
+    }
 }
 
 /// A formatting utility used to print strings with characters in need of escaping.