From 3c4ce8986b515d8553ef1e6cb1108d56e62f809e Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 6 Feb 2024 22:59:26 +0800 Subject: improve test jobs --- xmake/actions/test/main.lua | 2 +- xmake/actions/test/xmake.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xmake/actions/test/main.lua b/xmake/actions/test/main.lua index 620c63134..ccc69e897 100644 --- a/xmake/actions/test/main.lua +++ b/xmake/actions/test/main.lua @@ -269,7 +269,7 @@ function _run_tests(tests) local spent = os.mclock() print("running tests ...") local report = {passed = 0, total = #ordertests} - local jobs = tonumber(option.get("jobs") or "1") + local jobs = tonumber(option.get("jobs")) or os.default_njob() runjobs("run_tests", function (index) local testinfo = ordertests[index] if testinfo then diff --git a/xmake/actions/test/xmake.lua b/xmake/actions/test/xmake.lua index b72de7b02..a248623a6 100644 --- a/xmake/actions/test/xmake.lua +++ b/xmake/actions/test/xmake.lua @@ -34,7 +34,7 @@ task("test") "e.g.", " xmake test -w .", " xmake test --workdir=`pwd`" }, - {'j', "jobs", "kv", "1", "Set the number of parallel compilation jobs." }, + {'j', "jobs", "kv", tostring(os.default_njob()), "Set the number of parallel compilation jobs." }, {'r', "rebuild", "k", nil , "Rebuild the target." }, {}, {nil, "tests", "vs", nil , "The test names. It support pattern matching.", -- cgit v1.3.1