Browse Source

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. :^)
Andreas Kling 2 năm trước cách đây
mục cha
commit
6c81b90e5a
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      Userland/Utilities/headless-browser.cpp

+ 3 - 1
Userland/Utilities/headless-browser.cpp

@@ -284,7 +284,9 @@ static ErrorOr<int> 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));