Fix lunit not honoring "-t"

Signed-off-by: Rahix <rahix@rahix.de>
dev
rahix 7 years ago
parent 3b290e6853
commit 62658906d8

@ -531,13 +531,25 @@ 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
runtest(testcasename, testname)
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")
@ -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…
Cancel
Save