Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve to run tests #5522

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions tests/run.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -45,7 +38,6 @@ function _run_test_filter(name)
cprint("> %s", v)
end
end

for _, v in ipairs(tests) do
_run_test(v)
end
Expand Down
Loading