Ver Fonte

headless-browser: Improve output for failing tests a bit

- Colorize the "Test failed" part when stdout is a TTY
- Add missing newlines in the output
Andreas Kling há 2 anos atrás
pai
commit
b86ca27692
1 ficheiros alterados com 4 adições e 1 exclusões
  1. 4 1
      Userland/Utilities/headless-browser.cpp

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

@@ -243,7 +243,10 @@ static ErrorOr<TestResult> run_test(HeadlessWebContentView& view, StringView inp
 
     bool color_output = isatty(STDOUT_FILENO);
 
-    dbgln("Test failed: {}", input_path);
+    if (color_output)
+        outln("\n\033[33;1mTest failed\033[0m: {}", input_path);
+    else
+        outln("\nTest failed: {}", input_path);
 
     auto hunks = Diff::from_text(expectation, actual);
     for (auto const& hunk : hunks) {