summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-06-15 22:11:34 +0800
committerruki <[email protected]>2025-06-15 22:11:34 +0800
commite24686e7c390d0c52af98a680e0c296e200bb611 (patch)
tree1ef4b33b644b56aa11b7734bcd66a02f1e620159
parent0e84aec194e0b2d804b7a9b707c05dbe48645989 (diff)
add tests progress
-rw-r--r--core/xmake.lua2
-rwxr-xr-xcore/xmake.sh2
-rw-r--r--tests/run.lua8
-rw-r--r--tests/runner.lua5
4 files changed, 9 insertions, 8 deletions
diff --git a/core/xmake.lua b/core/xmake.lua
index b59d18a51..c65c06a7e 100644
--- a/core/xmake.lua
+++ b/core/xmake.lua
@@ -2,7 +2,7 @@
set_project("xmake")
-- version
-set_version("3.0.0", {build = "%Y%m%d"})
+set_version("3.0.1", {build = "%Y%m%d"})
-- set xmake min version
set_xmakever("2.8.5")
diff --git a/core/xmake.sh b/core/xmake.sh
index 4befb583e..f937d367c 100755
--- a/core/xmake.sh
+++ b/core/xmake.sh
@@ -1,7 +1,7 @@
#!/bin/sh
set_project "xmake"
-set_version "3.0.0" "%Y%m%d"
+set_version "3.0.1" "%Y%m%d"
# set warning all
set_warnings "all"
diff --git a/tests/run.lua b/tests/run.lua
index 283551ed7..f56933f3b 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -3,8 +3,8 @@ import("core.base.task")
import("core.base.option")
import("runner", {rootdir = os.scriptdir()})
-function _run_test(script)
- runner(script)
+function _run_test(script, opt)
+ runner(script, opt)
end
-- run test with the given name
@@ -38,8 +38,8 @@ function _run_test_filter(name)
cprint("> %s", v)
end
end
- for _, v in ipairs(tests) do
- _run_test(v)
+ for i, v in ipairs(tests) do
+ _run_test(v, {index = i, total = #tests})
end
cprint("> %d test(s) succeed", #tests)
end
diff --git a/tests/runner.lua b/tests/runner.lua
index b3d578a6f..5b8b0f5f5 100644
--- a/tests/runner.lua
+++ b/tests/runner.lua
@@ -1,7 +1,8 @@
import("core.base.option")
import("test_utils.context", { alias = "test_context" })
-function main(script)
+function main(script, opt)
+ opt = opt or {}
if os.isdir(script) then
script = path.join(script, "test.lua")
@@ -21,7 +22,7 @@ function main(script)
local verbose = option.get("verbose") or option.get("diagnosis")
-- trace
- cprint(">> testing %s ...", path.relative(root))
+ cprint(">> [%d/%d]: testing %s ...", opt.index, opt.total, path.relative(root))
-- get test functions
local data = import("test", { rootdir = root, anonymous = true })