diff options
author | mpeterv <mpeterval@gmail.com> | 2016-04-17 15:29:22 +0300 |
---|---|---|
committer | mpeterv <mpeterval@gmail.com> | 2016-04-17 15:29:35 +0300 |
commit | 5a2b939cc5ccf284b67995980a4d66eace2977e9 (patch) | |
tree | c99c19a029010befe24710accbd390e3dcb59960 /src/luacov/tick.lua | |
parent | 933c68092a8e9667dbd4bef9fdf4bb2d325ccb12 (diff) | |
download | luacov-5a2b939cc5ccf284b67995980a4d66eace2977e9.tar.gz |
Fix luacov.tick
luacov.runner.init used package.loaded["luacov.tick"] to
determine whether it should save stats from time to time.
luacov.tick module used to set that field implicitly because
it called module().
In @8872071 (Oct 2012) module() call was removed, leaving luacov.tick broken.
Incidentally that always enabled on-exit gc hooks, so the problem was
not visible unless Lua somehow exited without calling them.
The fix is to use runner.tick field instead of package.loaded for
storing the flag.
Diffstat (limited to 'src/luacov/tick.lua')
-rw-r--r-- | src/luacov/tick.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/luacov/tick.lua b/src/luacov/tick.lua index dbb43c6..fdf2b2d 100644 --- a/src/luacov/tick.lua +++ b/src/luacov/tick.lua @@ -5,5 +5,7 @@ -- @class module -- @name luacov.tick -- @see luacov.defaults.savestepsize -require("luacov") +local runner = require("luacov.runner") +runner.tick = true +runner.init() return {} |