summaryrefslogtreecommitdiff
path: root/src/luacov/tick.lua
diff options
context:
space:
mode:
authormpeterv <mpeterval@gmail.com>2016-04-17 15:29:22 +0300
committermpeterv <mpeterval@gmail.com>2016-04-17 15:29:35 +0300
commit5a2b939cc5ccf284b67995980a4d66eace2977e9 (patch)
treec99c19a029010befe24710accbd390e3dcb59960 /src/luacov/tick.lua
parent933c68092a8e9667dbd4bef9fdf4bb2d325ccb12 (diff)
downloadluacov-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.lua4
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 {}