diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-08-04 16:06:56 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-08-04 16:06:56 +0200 |
| commit | 75e20afb822e628b66fc4f45d567d3db22c0f82d (patch) | |
| tree | ff1a344532533d0e77c852ab07a23584e2a14e69 /library/test/src/formatters/json.rs | |
| parent | e1b9081e699065badfc1a9419ec9566e5c8615c4 (diff) | |
| download | rust-75e20afb822e628b66fc4f45d567d3db22c0f82d.tar.gz rust-75e20afb822e628b66fc4f45d567d3db22c0f82d.zip | |
Add new `test::print_merged_doctests_times` used by rustdoc to display more detailed time information and add new `OutputFormatter::write_merged_doctests_times` method to handle it
Diffstat (limited to 'library/test/src/formatters/json.rs')
| -rw-r--r-- | library/test/src/formatters/json.rs | 11 |
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. |
