Reference to unit test functions
- Namespace
-
As to 'namespace' the following initialisation code is assumed :
local test = require('btd.lua.test')()and for the actual test class :local Api = require('btd.lua.testapi') - Functions
test:clear()- Clear test statistics.
test:clearAll()- Clear all test classes from global environment.
test:run()- DEPRECATED
test:run('ClassX','ClassY')- Run all
testMethod's from the specified classes. test:run('ClassX:methodY')- Run specified method from the specified class.
test:report()- Trigger report output (not yet reported).
test:reportAll()- Trigger report output (all reports).
test.errorIDE = true/false- Select IDE integration type report output.
test.verbose = true/false- Select verbose report output.
test.silent = true/false- Select automatic report output.
TestClassX:setUpClass()- Class initialisation code.
TestClassX:tearDownClass()- Class clean up code.
TestClassX:setUp()- Test method initialisation code.
TestClassX:tearDown()- Test method clean up code.
TestClassX.Serial = true/false- Run all test methods one by one instead of in parallel.
TestClassX.testMethodSerial = true/false- Run selected test methods one by one instead of in parallel.
TestClassX.testMethodTime = value- Allocate maximum run time (value) of test method
Api.differs(actual,expected)- Test whether result of test differs from the expected result.
-
Api.equals(actual,expected)(orassertEquals(actual,expected)orassert_Equals(actual,expected)) - Test whether result of test equals the expected result.
-
Api.fails('userfunction(???)')( orassertError('userfunction(???)')orassert_Error('userfunction(???)')) - Test whether the
userfunction(???)throws an error. Api.succeeds('userfunction(???)')- Test whether the
userfunction(???)does not throw an error. -
TestClassX = Api.wrap('methodX','methodY',...)orTestClassX = wrapFunctions('methodX','methodY',...) - Wrap methods into
TestClassX - See examples in test directories
