@@ -306,6 +306,14 @@ impl<'a> Renderer<'a> {
306306 ) ;
307307 }
308308
309+ fn render_report ( & self , report : & Report ) {
310+ let & Report { total_time, compilation_time } = report;
311+ // Should match `write_merged_doctest_times` in `library/test/src/formatters/pretty.rs`.
312+ println ! (
313+ "all doctests ran in {total_time:.2}s; merged doctests compilation took {compilation_time:.2}s"
314+ ) ;
315+ }
316+
309317 fn render_message ( & mut self , message : Message ) {
310318 match message {
311319 Message :: Suite ( SuiteMessage :: Started { test_count } ) => {
@@ -323,6 +331,9 @@ impl<'a> Renderer<'a> {
323331 Message :: Suite ( SuiteMessage :: Failed ( outcome) ) => {
324332 self . render_suite_outcome ( Outcome :: Failed , & outcome) ;
325333 }
334+ Message :: Report ( report) => {
335+ self . render_report ( & report) ;
336+ }
326337 Message :: Bench ( outcome) => {
327338 // The formatting for benchmarks doesn't replicate 1:1 the formatting libtest
328339 // outputs, mostly because libtest's formatting is broken in terse mode, which is
@@ -435,6 +446,7 @@ enum Message {
435446 Suite ( SuiteMessage ) ,
436447 Test ( TestMessage ) ,
437448 Bench ( BenchOutcome ) ,
449+ Report ( Report ) ,
438450}
439451
440452#[ derive( serde_derive:: Deserialize ) ]
@@ -481,3 +493,10 @@ struct TestOutcome {
481493 stdout : Option < String > ,
482494 message : Option < String > ,
483495}
496+
497+ /// Emitted when running doctests.
498+ #[ derive( serde_derive:: Deserialize ) ]
499+ struct Report {
500+ total_time : f64 ,
501+ compilation_time : f64 ,
502+ }
0 commit comments