mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 18:00:16 +00:00
headless-browser: Replace the log-slowest-tests flag with a verbose flag
Instead of adding a separate flag for each thing we want to log, let's just have a verbosity flag. We can add verbosity levels later if needed.
This commit is contained in:
parent
0ff91a5273
commit
d2306efaea
Notes:
github-actions[bot]
2024-11-11 15:55:51 +00:00
Author: https://github.com/trflynn89
Commit: d2306efaea
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2283
3 changed files with 3 additions and 3 deletions
|
@ -44,8 +44,8 @@ void Application::create_platform_arguments(Core::ArgsParser& args_parser)
|
||||||
args_parser.add_option(resources_folder, "Path of the base resources folder (defaults to /res)", "resources", 'r', "resources-root-path");
|
args_parser.add_option(resources_folder, "Path of the base resources folder (defaults to /res)", "resources", 'r', "resources-root-path");
|
||||||
args_parser.add_option(is_layout_test_mode, "Enable layout test mode", "layout-test-mode");
|
args_parser.add_option(is_layout_test_mode, "Enable layout test mode", "layout-test-mode");
|
||||||
args_parser.add_option(rebaseline, "Rebaseline any executed layout or text tests", "rebaseline");
|
args_parser.add_option(rebaseline, "Rebaseline any executed layout or text tests", "rebaseline");
|
||||||
args_parser.add_option(log_slowest_tests, "Log the tests with the slowest run times", "log-slowest-tests");
|
|
||||||
args_parser.add_option(per_test_timeout_in_seconds, "Per-test timeout (default: 30)", "per-test-timeout", 't', "seconds");
|
args_parser.add_option(per_test_timeout_in_seconds, "Per-test timeout (default: 30)", "per-test-timeout", 't', "seconds");
|
||||||
|
args_parser.add_option(verbose, "Log extra information about test results", "verbose", 'v');
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::create_platform_options(WebView::ChromeOptions& chrome_options, WebView::WebContentOptions& web_content_options)
|
void Application::create_platform_options(WebView::ChromeOptions& chrome_options, WebView::WebContentOptions& web_content_options)
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
ByteString test_glob;
|
ByteString test_glob;
|
||||||
bool test_dry_run { false };
|
bool test_dry_run { false };
|
||||||
bool rebaseline { false };
|
bool rebaseline { false };
|
||||||
bool log_slowest_tests { false };
|
bool verbose { false };
|
||||||
int per_test_timeout_in_seconds { 30 };
|
int per_test_timeout_in_seconds { 30 };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -504,7 +504,7 @@ ErrorOr<void> run_tests(Core::AnonymousBuffer const& theme, Gfx::IntSize window_
|
||||||
for (auto const& non_passing_test : non_passing_tests)
|
for (auto const& non_passing_test : non_passing_tests)
|
||||||
outln("{}: {}", test_result_to_string(non_passing_test.result), non_passing_test.test.input_path);
|
outln("{}: {}", test_result_to_string(non_passing_test.result), non_passing_test.test.input_path);
|
||||||
|
|
||||||
if (app.log_slowest_tests) {
|
if (app.verbose) {
|
||||||
auto tests_to_print = min(10uz, tests.size());
|
auto tests_to_print = min(10uz, tests.size());
|
||||||
outln("\nSlowest {} tests:", tests_to_print);
|
outln("\nSlowest {} tests:", tests_to_print);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue