Description
There's no responsible way to advance development without a testing suite.
A full test framework is great for general development, but here we focus on just acceptance tests. Either pass or not; no need for detailed failing reports.
some desirable goals:
-
make it very easy to write tests. Every bugfix should include a failing test. Since Lua is a very readable language, it's sometimes easier to express a problem in code than in English. It should be trivial to turn this into the test.
-
minimal requirements. Lua is very portable, LuaJIT also targets a wide variety of platforms. All of them should be able to run all relevant tests. Every external module, tool or language will be an issue for somebody somewhere.
-
make it easy to run one test. very important while developing a bugfix. ideally, a testcase would be run directly from the CLI, not only from a bigger environment.
-
clearly mark tests that are intended for some platforms or have specific requirements. try not to confuse users with tests about JIT on non-jit builds.
Some candidates:
-
an existing test framework, like Telescope, Busted, etc.:
pros:- very complete
- nice reports
cons:
- usually not minimal, might have heavy requirements.
- probably shouldn't be included in the repo, but marked as required for tests.
- very different styles, if you like one, probably won't like another.
-
the LuaJIT-test-cleanup
pros:- already existing
- while not very deep in testng, it covers a wide area of the language and included libraries.
- well known
- light requirements (really? not sure)
- nice 'tags' facility
cons:
- many warnings about not being "the test suite"
- still need cleanup? not sure about this
-
some other test-driver (like https://github.com/tarantool/test-run), or one used by other Lua(JIT) fork.
pros:- already existing and tried
- very complete (in most cases)
cons:
- extra requirements (Python in the case of test-run)
- not well known
-
a new, minimalistic tester (I've just hacked such a thing: https://github.com/javierguerragiraldez/luajit-tester):
pros:- no extra dependencies
- tailored for this specific use
- very easy to write tests
cons:
- untested
- limited functionality (to be improved with time?)
- not well known (but minimal learning curve)