From 6c81b90e5a06d6fb2164f6484c7e69b0492aa87f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 28 May 2023 08:02:55 +0200 Subject: [PATCH] headless-browser: Call fflush() between tests when running on TTY This allows us to see the full test name without getting cut off by stdio buffering. :^) --- Userland/Utilities/headless-browser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Utilities/headless-browser.cpp b/Userland/Utilities/headless-browser.cpp index a6ff09f96e..bdb74dc881 100644 --- a/Userland/Utilities/headless-browser.cpp +++ b/Userland/Utilities/headless-browser.cpp @@ -284,7 +284,9 @@ static ErrorOr run_tests(HeadlessWebContentView& view, StringView test_root out("{}/{}: {}", i + 1, tests.size(), LexicalPath::relative_path(test.input_path, test_root_path)); - if (!is_tty) + if (is_tty) + fflush(stdout); + else outln(""); test.result = TRY(run_test(view, test.input_path, test.expectation_path, test.mode));