summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-08-28 22:57:34 +0800
committerruki <[email protected]>2024-08-28 22:57:34 +0800
commit83807ef1e69b9035e94795291cadacf796bc9bae (patch)
tree89e848920453366bd6abf7fd3a4aafaeaa40c404 /tests/run.lua
parent3fbd46931b4e51b9120b8ec15e8adb612fd222ec (diff)
improve to run tests
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua12
1 files changed, 2 insertions, 10 deletions
diff --git a/tests/run.lua b/tests/run.lua
index a252b445c..283551ed7 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -1,17 +1,10 @@
-- imports
import("core.base.task")
import("core.base.option")
-
-local params = {}
-
-if option.get("quiet") then table.insert(params, "-q") end
-if option.get("yes") then table.insert(params, "-y") end
-if option.get("verbose") then table.insert(params, "-v") end
-if option.get("diagnosis") then table.insert(params, "-D") end
+import("runner", {rootdir = os.scriptdir()})
function _run_test(script)
- assert(script:endswith("test.lua"))
- os.execv(os.programfile(), table.join("lua", params, path.join(os.scriptdir(), "runner.lua"), script))
+ runner(script)
end
-- run test with the given name
@@ -45,7 +38,6 @@ function _run_test_filter(name)
cprint("> %s", v)
end
end
-
for _, v in ipairs(tests) do
_run_test(v)
end