From b86ca2769222c6191afe6ebb4fb9c4fa781f5fd2 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 12 Jun 2023 11:51:28 +0200 Subject: [PATCH] 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 --- Userland/Utilities/headless-browser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Utilities/headless-browser.cpp b/Userland/Utilities/headless-browser.cpp index b28880108e..ee84cff6d8 100644 --- a/Userland/Utilities/headless-browser.cpp +++ b/Userland/Utilities/headless-browser.cpp @@ -243,7 +243,10 @@ static ErrorOr 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) {