diff options
| author | ruki <[email protected]> | 2024-03-18 23:44:06 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-03-18 23:44:06 +0800 |
| commit | ca16db30058d8a512d73a7bee28e57f72de4c338 (patch) | |
| tree | 37f034b25bf468297daa0ec4bc8dd5490f380c5e /xmake/actions/test/main.lua | |
| parent | ef76c91d0517361173246f6ee62b3b6c3ba1e29e (diff) | |
improve progress
Diffstat (limited to 'xmake/actions/test/main.lua')
| -rw-r--r-- | xmake/actions/test/main.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/actions/test/main.lua b/xmake/actions/test/main.lua index ccc69e897..852f00662 100644 --- a/xmake/actions/test/main.lua +++ b/xmake/actions/test/main.lua @@ -270,7 +270,7 @@ function _run_tests(tests) print("running tests ...") local report = {passed = 0, total = #ordertests} local jobs = tonumber(option.get("jobs")) or os.default_njob() - runjobs("run_tests", function (index) + runjobs("run_tests", function (index, total, opt) local testinfo = ordertests[index] if testinfo then local target = testinfo.target @@ -286,7 +286,7 @@ function _run_tests(tests) if option.get("verbose") then progress_format = progress_format .. "${dim}" end - local progress = math.floor(index * 100 / #ordertests) + local progress = opt.progress:percent() local padding = maxwidth - #testinfo.name cprint(progress_format .. "%s%s .................................... " .. status_color .. "%s${clear} ${bright}%0.3fs", progress, testinfo.name, (" "):rep(padding), passed and "passed" or "failed", spent / 1000) |
