summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorruki <[email protected]>2024-04-09 00:43:25 +0800
committerruki <[email protected]>2024-04-09 00:43:25 +0800
commit73abaaf1db8d884ccc1eccff2cef4f17a38fcf72 (patch)
treea3aa98fb0bfaf3634a4be1661faafc65630e0834 /tests
parentaca3ead5d138db01a4286b410e18f3d85effffe8 (diff)
fix errors
Diffstat (limited to 'tests')
-rw-r--r--tests/run.lua5
-rw-r--r--tests/runner.lua2
2 files changed, 1 insertions, 6 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 00c18ff07..ff6158ab2 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -16,10 +16,8 @@ end
-- run test with the given name
function _run_test_filter(name)
-
local tests = {}
local root = path.absolute(os.scriptdir())
- -- find the test script
for _, script in ipairs(os.files(path.join(root, "**", name, "**", "test.lua"))) do
if not script:find(".xmake", 1, true) then
table.insert(tests, path.absolute(script))
@@ -55,9 +53,6 @@ function _run_test_filter(name)
end
end
--- main entry
function main(name)
-
- -- run the given test
return _run_test_filter(name or "/")
end
diff --git a/tests/runner.lua b/tests/runner.lua
index 17783f9e4..b3d578a6f 100644
--- a/tests/runner.lua
+++ b/tests/runner.lua
@@ -54,7 +54,7 @@ function main(script)
if errors then
errors = tostring(errors)
end
- if not errors:find("aborting because of ") then
+ if errors and not errors:find("aborting because of ") then
context:print_error(errors, v, "unhandled error")
else
raise(errors)