LibTest: Add verbose test file output

Add -v/--verbose support to JavaScript test runners so they print each
test file immediately before running it. This makes hard crashes and
process traps easy to map back to the file that triggered them.
This commit is contained in:
Andreas Kling
2026-04-29 11:59:13 +02:00
committed by Andreas Kling
parent 2222654db4
commit 6acc1d36ae
Notes: github-actions[bot] 2026-05-03 11:12:48 +00:00
3 changed files with 14 additions and 5 deletions

View File

@@ -102,6 +102,7 @@ int main(int argc, char** argv)
bool print_progress = false;
bool print_json = false;
bool per_file = false;
bool print_each_test = false;
StringView specified_test_root;
ByteString common_path;
Vector<ByteString> test_globs;
@@ -126,6 +127,7 @@ int main(int argc, char** argv)
args_parser.add_option(print_json, "Show results as JSON", "json", 'j');
args_parser.add_option(per_file, "Show detailed per-file results as JSON (implies -j)", "per-file");
args_parser.add_option(print_each_test, "Print each test file before running it", "verbose", 'v');
args_parser.add_option(g_collect_on_every_allocation, "Collect garbage after every allocation", "collect-often", 'g');
args_parser.add_option(JS::Bytecode::g_dump_bytecode, "Dump the bytecode", "dump-bytecode", 'd');
args_parser.add_option(test_globs, "Only run tests matching the given glob", "filter", 'f', "glob");
@@ -213,7 +215,7 @@ int main(int argc, char** argv)
};
}
Test::JS::TestRunner test_runner(test_root, common_path, print_times, print_progress, print_json, per_file);
Test::JS::TestRunner test_runner(test_root, common_path, print_times, print_progress, print_json, per_file, print_each_test);
test_runner.run(test_globs);
g_vm = nullptr;