Skip to content

Commit

Permalink
Upgrade to Lua 5.2, but keep compatible with Lua 5.1
Browse files Browse the repository at this point in the history
Done in this commit:
 - upgrade module declaration and loading:
   - "module" idioms are replaced by returning the module table
   - declare a local variable for the loaded module
   - declare private function local and export module functions through
     the module table
 - upgrade the getenv function by calling or emulating getfenv
 - export the is_test_key function to enable customization
 - suites are stored in an indexed table to run suite in the same order
   they are added. Tests are run in arbitrary order.
 - update tests and test suites files
 - bumps to version 0.9.5 and update the rockspec accordingly:
   No need to fix "lua >= 5.1" to "lua = 5.1" thanks to this upgrade.
 - update README.md

Has been tested successfully with Lua 5.1, Lua 5.2 and luajit 2.0.3.
  • Loading branch information
cyrilRomain committed Mar 31, 2014
1 parent 9b59a32 commit 5529e17
Show file tree
Hide file tree
Showing 9 changed files with 217 additions and 169 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ It's largely upwardly compatible from [lunit][], with the following changes:
not change any functions from the standard library.
* If running tests in only one file, no module declaration is necessary.
* For multiple suites, register them with lunatest.suite("file").
This uses require to load the suite, and uses the same methods to
match filenames with modules. (Note: should use module(...) in the file.)
This uses require the file suite to return a table containing the suite
related functions as well as the test functions. (Note: non local tests
functions found outside the returned table go to the main suite.)
* It doesn't have any dependencies except Lua, though if present, it
will use lhf's [lrandom][] module (for consistent pseudorandom numbers
across operating systems) and [luasocket][]'s gettime() for timestamps).
Expand Down
6 changes: 3 additions & 3 deletions lunatest-0.9.1-0.rockspec → lunatest-0.9.5-0.rockspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package = "lunatest"
version = "0.9.1-0"
version = "0.9.5-0"
source = {
url = "git://github.com/silentbicycle/lunatest.git",
tag = "v0.9.1"
tag = "v0.9.5"
}
description = {
summary = "xUnit-style + randomized unit testing framework",
Expand All @@ -25,5 +25,5 @@ build = {
type = "builtin",
modules = {
lunatest = "lunatest.lua"
}
}
}
Loading

0 comments on commit 5529e17

Please sign in to comment.