mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
LibTest: Provide detailed per-file JSON output with --per-file
This makes test-js style runners dump out output in the same format as libjs-test262's per-file output.
This commit is contained in:
parent
3063aedb0c
commit
8b50009e9b
Notes:
sideshowbarker
2024-07-17 17:18:45 +09:00
Author: https://github.com/alimpfard
Commit: 8b50009e9b
Pull-request: https://github.com/SerenityOS/serenity/pull/12998
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/davidot ✅
6 changed files with 100 additions and 28 deletions
|
@ -132,12 +132,13 @@ TESTJS_RUN_FILE_FUNCTION(String const& test_file, JS::Interpreter& interpreter,
|
|||
}
|
||||
|
||||
auto test_result = test_passed ? Test::Result::Pass : Test::Result::Fail;
|
||||
|
||||
auto test_path = LexicalPath::relative_path(test_file, Test::JS::g_test_root);
|
||||
auto duration_ms = Test::get_time_in_ms() - start_time;
|
||||
return Test::JS::JSFileResult {
|
||||
LexicalPath::relative_path(test_file, Test::JS::g_test_root),
|
||||
test_path,
|
||||
{},
|
||||
Test::get_time_in_ms() - start_time,
|
||||
duration_ms,
|
||||
test_result,
|
||||
{ Test::Suite { "Parse file", test_result, { { expectation_string, test_result, message } } } }
|
||||
{ Test::Suite { test_path, "Parse file", test_result, { { expectation_string, test_result, message, static_cast<u64>(duration_ms) * 1000u } } } }
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue