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! :^)
This commit is contained in:
Linus Groh 2020-07-07 00:55:50 +01:00 committed by Andreas Kling
parent 4c845b35ac
commit bfbd6df892
Notes: sideshowbarker 2024-07-19 05:03:12 +09:00

View File

@ -184,8 +184,19 @@ Vector<String> get_test_paths(const String& test_root)
void TestRunner::run() 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)); 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(); print_test_results();
} }