diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2022-03-08 07:09:41 +0330 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-03-16 15:44:52 +0000 |
commit | 8b50009e9b42a0de810617bff3db994bbfa99264 (patch) | |
tree | 1c39af1ced9f274fc33477a3cef7b7c9df5bfc2a /Tests/LibJS | |
parent | 3063aedb0c5ca7afda8e13ff8fcc063c7bd98678 (diff) | |
download | serenity-8b50009e9b42a0de810617bff3db994bbfa99264.zip |
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.
Diffstat (limited to 'Tests/LibJS')
-rw-r--r-- | Tests/LibJS/test-js.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Tests/LibJS/test-js.cpp b/Tests/LibJS/test-js.cpp index c9936dd910..ce9301576b 100644 --- a/Tests/LibJS/test-js.cpp +++ b/Tests/LibJS/test-js.cpp @@ -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 } } } } }; } |