From f690bdeb7b1c3eb5c9016dc7097c400dd42e492b Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Fri, 13 Oct 2023 16:00:17 +0200 Subject: [PATCH] Fix tests about the output of alcotest (revert the controversial change about the newline for pp_summary) --- src/alcotest-engine/core.ml | 8 +++++--- src/alcotest-engine/pp.ml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/alcotest-engine/core.ml b/src/alcotest-engine/core.ml index afc597e5..6e358dc5 100644 --- a/src/alcotest-engine/core.ml +++ b/src/alcotest-engine/core.ml @@ -363,9 +363,11 @@ module Make (P : Platform.MAKER) (M : Monad.S) = struct too. We don't need to register a channel even if the user specify its own [Format.formatter] for [stdout] and/or [stderr]. *) flush_all (); - Fmt.(pf (t.stderr :> Format.formatter)) - "%a\n" red - "Invalid request (no tests to run, filter skipped everything)!"; + Fmt.( + pf + (Global.get_stderr () :> Format.formatter) + "%a\n%!" red + "Invalid request (no tests to run, filter skipped everything)!"); exit 1) else let tests = filter_test_cases ~subst:true filter suite in diff --git a/src/alcotest-engine/pp.ml b/src/alcotest-engine/pp.ml index 156b2d35..88f10434 100644 --- a/src/alcotest-engine/pp.ml +++ b/src/alcotest-engine/pp.ml @@ -212,7 +212,7 @@ struct | 0 -> green_s ppf "Test Successful" | n -> red ppf "%d failure%a!" n pp_plural n in - Fmt.pf ppf "%a in %.3fs. %d test%a run.@\n" pp_failures r.failures r.time + Fmt.pf ppf "%a in %.3fs. %d test%a run.@," pp_failures r.failures r.time r.success pp_plural r.success let suite_results ~log_dir config ppf r =