Fix lunit not honoring "-t"
Signed-off-by: Rahix <rahix@rahix.de>
This commit is contained in:
parent
3b290e6853
commit
62658906d8
1 changed files with 15 additions and 3 deletions
16
lunit.lua
16
lunit.lua
|
|
@ -531,15 +531,27 @@ traceback_hide(runtest)
|
|||
|
||||
|
||||
|
||||
function lunit.run()
|
||||
function lunit.run(patterns)
|
||||
clearstats()
|
||||
report("begin")
|
||||
for testcasename in lunit.testcases() do
|
||||
-- Run tests in the testcases
|
||||
for testname in lunit.tests(testcasename) do
|
||||
local run = true
|
||||
if patterns ~= nil then
|
||||
run = false
|
||||
for _, pat in ipairs(patterns) do
|
||||
if string.match(testname, pat) ~= nil then
|
||||
run = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if run then
|
||||
runtest(testcasename, testname)
|
||||
end
|
||||
end
|
||||
end
|
||||
report("done")
|
||||
return stats
|
||||
end
|
||||
|
|
@ -647,7 +659,7 @@ function main(argv)
|
|||
local optname = arg; i = i + 1; arg = argv[i]
|
||||
checkarg(optname, arg)
|
||||
testpatterns = testpatterns or {}
|
||||
testpatterns[#testpatterns+1] = arg
|
||||
testpatterns[#testpatterns+1] = lunitpat2luapat(arg)
|
||||
elseif arg == "--" then
|
||||
while i < #argv do
|
||||
i = i + 1; arg = argv[i]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue