Skip to content

Commit 83807ef

Browse files
committed
improve to run tests
1 parent 3fbd469 commit 83807ef

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tests/run.lua

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
-- imports
22
import("core.base.task")
33
import("core.base.option")
4-
5-
local params = {}
6-
7-
if option.get("quiet") then table.insert(params, "-q") end
8-
if option.get("yes") then table.insert(params, "-y") end
9-
if option.get("verbose") then table.insert(params, "-v") end
10-
if option.get("diagnosis") then table.insert(params, "-D") end
4+
import("runner", {rootdir = os.scriptdir()})
115

126
function _run_test(script)
13-
assert(script:endswith("test.lua"))
14-
os.execv(os.programfile(), table.join("lua", params, path.join(os.scriptdir(), "runner.lua"), script))
7+
runner(script)
158
end
169

1710
-- run test with the given name
@@ -45,7 +38,6 @@ function _run_test_filter(name)
4538
cprint("> %s", v)
4639
end
4740
end
48-
4941
for _, v in ipairs(tests) do
5042
_run_test(v)
5143
end

0 commit comments

Comments
 (0)