From 44b6f402ae72d26b43efca6f68deab8d66c9e807 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Mon, 5 Jul 2021 20:01:41 +0200 Subject: [PATCH] Utilities/run-tests: Don't use `using enum` `using enum` statements will only be supported by the upcoming Clang 13 compiler, so the current code can't be built with the almost-ready Clang toolchain yet. --- Userland/Utilities/run-tests.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Userland/Utilities/run-tests.cpp b/Userland/Utilities/run-tests.cpp index da9cfb6c27..3be5fd35dd 100644 --- a/Userland/Utilities/run-tests.cpp +++ b/Userland/Utilities/run-tests.cpp @@ -18,7 +18,6 @@ namespace Test { TestRunner* TestRunner::s_the = nullptr; } -using enum Test::Modifier; using Test::get_time_in_ms; using Test::print_modifiers; @@ -115,36 +114,36 @@ void TestRunner::do_run_single_test(const String& test_path) bool crashed_or_failed = test_result.result == Test::Result::Fail || test_result.result == Test::Result::Crashed; bool print_stdout_stderr = crashed_or_failed || m_print_all_output; if (crashed_or_failed) { - print_modifiers({ BG_RED, FG_BLACK, FG_BOLD }); + print_modifiers({ Test::BG_RED, Test::FG_BLACK, Test::FG_BOLD }); out("{}", test_result.result == Test::Result::Fail ? " FAIL " : "CRASHED"); - print_modifiers({ CLEAR }); + print_modifiers({ Test::CLEAR }); } else { - print_modifiers({ BG_GREEN, FG_BLACK, FG_BOLD }); + print_modifiers({ Test::BG_GREEN, Test::FG_BLACK, Test::FG_BOLD }); out(" PASS "); - print_modifiers({ CLEAR }); + print_modifiers({ Test::CLEAR }); } out(" {}", LexicalPath::relative_path(test_path, m_test_root)); - print_modifiers({ CLEAR, ITALIC, FG_GRAY }); + print_modifiers({ Test::CLEAR, Test::ITALIC, Test::FG_GRAY }); if (test_result.time_taken < 1000) { outln(" ({}ms)", static_cast(test_result.time_taken)); } else { outln(" ({:3}s)", test_result.time_taken / 1000.0); } - print_modifiers({ CLEAR }); + print_modifiers({ Test::CLEAR }); if (test_result.result != Test::Result::Pass) { - print_modifiers({ FG_GRAY, FG_BOLD }); + print_modifiers({ Test::FG_GRAY, Test::FG_BOLD }); out(" Test: "); if (crashed_or_failed) { - print_modifiers({ CLEAR, FG_RED }); + print_modifiers({ Test::CLEAR, Test::FG_RED }); outln("{} ({})", test_result.file_path.basename(), test_result.result == Test::Result::Fail ? "failed" : "crashed"); } else { - print_modifiers({ CLEAR, FG_ORANGE }); + print_modifiers({ Test::CLEAR, Test::FG_ORANGE }); outln("{} (skipped)", test_result.file_path.basename()); } - print_modifiers({ CLEAR }); + print_modifiers({ Test::CLEAR }); } // Make sure our clear modifiers goes through before we dump file output via write(2)