Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
test argument support
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Bloomberg committed May 23, 2016
1 parent f8d54fd commit 7a1e7a5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/lib/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ function module.test(name, f)
insert(current_suite.tests, test)
end

function module.suites()
return suites
end

function module.run_all()
out:write('Engine ' .. wake.getVersion() .. ' running in ' .. wake.getEngineMode() .. ' mode.\n\n')

Expand Down
22 changes: 22 additions & 0 deletions dist/tests/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,27 @@ require('tests.native.material')
local test = require('test')

function hook_engine_tests()
local args = wake.getArguments()
if #args > 0 then
local i = 1
while i <= #args do
local arg = args[i]
if arg == "--list-tests" or arg == "-l" then
for _,suite in ipairs(test.suites()) do
print(suite.name)
for _,t in ipairs(suite.tests) do
print("- " .. t.name)
end
end
return true
else
print("Usage: Wake -t -- [options]")
print("Options:")
print("--list-tests -t List all tests and suites.")
return false
end
end
end

return test.run_all()
end

0 comments on commit 7a1e7a5

Please sign in to comment.