BTD
build-test-deploy Development Environment

Overview

This is the unit testing framework component of the BTD suite of tools. It provides the basic functionality to run automated tests.

License

BTD is free software and uses the same license as Lua 5.1

Status

Current version is 1.7.3 and was developed for Lua 5.1.

Download

BTD can be downloaded from the Lua-page page.

Dependencies

BTD unit test depends on luafilesystem 1.4.2 and on NMPLua ??????????.

Road map

  • Considered final : no extra functionality foreseen, just eventual bugfixes or cosmetical changes (eg. reporting format,...).
  • The unit testing framework can be integrated in other test tools (e.g. GUI testing).

Credits

  • BTD - unit test component based on LuaUnit
  • Web site design based on Copas - web site design
  • Logo based on graphic design by Alexandre Nakonechnyj

Contact us

History

BTD 1.8.0 - 21 Sep 2014
changes
  • reworked BTD to use NMPLua instead of Lua Lanes. This has following consequences :
    • NMP uses Posix IPC functionality
    • running testclasses in parallel is deprecated
BTD 1.7.3 - 2 Jan 2013
changes
  • changed the equals function of TestApi.lua to check tables only if their __eq meta method reports a difference. This remedies a "stack overflow" in situations where a table has a tree of sub tables which cross reference each other.
    IMPORTANT : IF AVAILABLE, THE __eq META METHOD OF THE TABLE UNDER TEST IS USED, THIS METHOD MUST WORK CORRECTLY OR STRANGE TEST RESULTS MAY BE REPORTED !!!
BTD 1.7.2 - 15 Nov 2011
changes
  • fixed a bug in the equals function of TestApi.lua to enable a table to use non-number or non-string keys.
clean up
  • reworked reporting
  • if expected type is different from actual type then this is reported as is.
  • string results are displayed on consecutive lines to facilitate spotting the differences.
  • table results are more verbose.
BTD 1.7.1 - 07 Feb 2010
changes
  • for Unix (and OS X) compatibility, changed character case in require statements
  • fixed a bug in the report method of TestMethod.lua which killed the test runner.
  • test:reportAll() now correctly outputs error information
clean up
  • reworked documentation
  • split up of BTD in different packages (code and documentation) to reflect the modular nature of the suite.
BTD 1.7.0 - 17 Apr 2009
clean up
  • running single test method did not work
  • further clean up report output
BTD 1.6.0 - 8 Mar 2009
WARNING : allthough, what I consider :o), well designed unit tests (one test class per file, no coupling between test methods) should run without modification. This might not be the case if unit tests are designed differently. For the time being (and until a solution has been found) I will still maintain the BTD 1.5.2 version, it is included as TestDepr.lua.
new features
  • implemented multi tasking with Lua Lanes, which gives following features :
    • all test classes and test methods run in parallel and in their own environment
    • option TestClass.testMethodTime to abort test method of it exeeds the specified time
    • option TestClass.Serial or TestClass.testMethodSerial to run all or the marked test methods serial instead of parallel (eg. control access to shared resources)
    • option TestClass.Abort to abort series of serialised test methods on failure on one of them
    • reporting while running the tests is limited to outputting characters o, f or e for respectively a succeeded and a failed test or a framework error. The test classes give the same output in uppercase
    • full reporting (emulating the previous output format) is started after completing all tests. First all results are output followed by a summary of failed tests
  • test runner changes :
    • option TestRunner.silent for suppressing reporting
    • command TestRunner:report() for triggering (as yet unreported) report output
    • command reportAll for triggering (all) report output
  • two new test methods complementary to the existing ones :
    • test.differs(param 1,param 2) parameters not equals
    • test.succeeds(function,parameters) function does not throw error
  • updated examples : given the scope of the changes some 50 examples are included which demonstrate various parts of the provided functionality
clean up
  • changed all error handling code (or lack thereof) to be handled by the framework
  • eventual errors in the framework (missing test classes or methods or setup or teardown errors or...) are reported with framework failed
  • to better suit multi tasking paradigm, split the Test.lua class in TestClass.lua and TestMethod.lua, to respectively handle the class and the method runners/reporting
  • every class Test, TestClass and TestMethod handles reporting at it's level
  • changed verbosity to a bool
  • cleaned up fails method in TestApi.lua class
  • cleaned up equals method in TestApi.lua class
BTD 1.5.2 - 21 Feb 2009
clean up
  • updated documentation
  • changed class name Api.lua to TestApi.lua
  • updated Test.lua
  • updated examples
BTD 1.5.1 - 16 Feb 2009
new features
  • support for a new output format for failed tests
  • command line parameters for verbosity and IDE integration
  • report individual and total test time
  • report absolute directory in failed tests
clean up
  • split up LuaUnit in 3 classes (Api.lua, Result.lua and Test.lua)
  • included functionality of Result.lua in Test.lua (merged)
  • use of self as foreseen in Lua guidelines (> OOP)
  • changed all global to local variables
  • changed all global to local functions (except Api.lua where the original functions are exported to global environment)
  • minimise coupling between tests by restoring _G' environment and 'package.loaded' between test methods and between test classes
  • changed 'Test.run' method to accept packages (eg. a.b.c.Testd)
  • updated LuaUnit.strip_luaunit_stack to use patterns
  • changed comments to LuaDoc format
  • integrated small or one-shot functions in calling functions
BTD 1.4 - 30 Nov 2008
new features
  • changed assertEquals to recursively check table results, also enables checking multi result functions assertEquals({fx},{res1,res2,..})
  • added LuaUnit:clear() : clear statistics data
  • added LuaUnit:clearAll() : clear all loaded TestXXX classes from the global environment
  • added test:setUpClass() and test:tearDownClass()
clean up
  • fixed calling from the shell
  • removed deprecated functions : table.foreach, .foreachi, .getn and .setn
  • removed orderedNext, orderedPairs : replaced by table.sort()
  • updated LuaUnit.strip_luaunit_stack to properly skip last xpcall and two former lines from stack_trace
  • removed LuaUnit.strsplit, only used in LuaUnit.strip_luaunit_stack
BTD - unit test component = LuaUnit 1.3 fork - Nov 2008
See history LuaUnit and/or CHANGES.TXT file in distribution