1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:37:47 +00:00

LibTest+Utilities: Print a start message before each test in run-tests

It can sometimes be difficult to tell from the debug.log and test stdout
which test was the last to run before the test runner hangs or exits the
QEMU instance unexpectedly.

Print out a start message before each test is executed, along with a
progress message indicating which test out of how many tests we're about
to run.
This commit is contained in:
Andrew Kaster 2021-08-18 19:16:23 -06:00 committed by Andreas Kling
parent 6666230d3e
commit 332b29c741
3 changed files with 11 additions and 9 deletions

View file

@ -54,7 +54,7 @@ protected:
void print_test_results_as_json() const;
virtual Vector<String> get_test_paths() const = 0;
virtual void do_run_single_test(const String&) = 0;
virtual void do_run_single_test(const String&, size_t current_test_index, size_t num_tests) = 0;
virtual const Vector<String>* get_failed_test_names() const { return nullptr; }
String m_test_root;
@ -115,7 +115,7 @@ inline void TestRunner::run(String test_glob)
if (!path.matches(test_glob))
continue;
++progress_counter;
do_run_single_test(path);
do_run_single_test(path, progress_counter, test_paths.size());
if (m_print_progress)
warn("\033]9;{};{};\033\\", progress_counter, test_paths.size());
}