From bfbd6df8920b191fd9045e9ecb6e41d4b9ae99f4 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 7 Jul 2020 00:55:50 +0100 Subject: [PATCH] test-js: Show progress in taskbar This was a nice feature the old run-tests.sh script had - let's add it to test-js as well! :^) --- Userland/test-js.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Userland/test-js.cpp b/Userland/test-js.cpp index 8be43022fb..6aadc57268 100644 --- a/Userland/test-js.cpp +++ b/Userland/test-js.cpp @@ -184,8 +184,19 @@ Vector get_test_paths(const String& test_root) void TestRunner::run() { - for (auto& path : get_test_paths(m_test_root)) + size_t progress_counter = 0; + auto test_paths = get_test_paths(m_test_root); + for (auto& path : test_paths) { + ++progress_counter; print_file_result(run_file_test(path)); +#ifdef __serenity__ + fprintf(stderr, "\033]9;%zu;%zu;\033\\", progress_counter, test_paths.size()); +#endif + } + +#ifdef __serenity__ + fprintf(stderr, "\033]9;-1;\033\\"); +#endif print_test_results(); }