Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes:

- add setVerbosity() to control verbosity manually
- include test functions starting with "test" when discovering tests
  • Loading branch information...
commit fbb6f306c88fdefbce3c68de138254c729e00675 1 parent b2ecf9b
Bluebird75 authored
Showing with 12 additions and 3 deletions.
  1. +7 −2 example_with_luaunit.lua
  2. +5 −1 luaunit.lua
View
9 example_with_luaunit.lua
@@ -94,6 +94,11 @@ end
-- LuaUnit:run( 'TestFunctions:test1_withFailure' )
-- LuaUnit:run( 'TestToto' ) -- run only on test class
-- LuaUnit:run( 'TestTiti:test3') -- run only one test method of a test class
--- lu = LuaUnit
+-- LuaUnit:run() -- run everything
+
+---- Control test output:
+lu = LuaUnit
+-- lu:setOutputType( "NIL" )
-- lu:setOutputType( "TAP" )
--- lu:run()
+lu:setVerbosity( 0 )
+lu:run()
View
6 luaunit.lua
@@ -409,6 +409,10 @@ LuaUnit_MT = { __index = LuaUnit }
error( 'No such format: '..outputType)
end
+ function LuaUnit:setVerbosity( verbosity )
+ self.verbosity = verbosity
+ end
+
--------------[[ Runner ]]-----------------
SPLITTER = '\n>----------<\n'
@@ -580,7 +584,7 @@ LuaUnit_MT = { __index = LuaUnit }
-- not iterate over _G while modifying it.
args = {}
for key, val in pairs(_G) do
- if string.sub(key,1,4) == 'Test' then
+ if string.sub(key,1,4):lower() == 'test' then
table.insert( args, key )
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.