summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-06-28 23:53:14 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-06-28 23:53:14 +0300
commit929a6d310c03d1562b153c46ee201a54d02af964 (patch)
treed69d23b76b1890f474a9c64392c0e5402fcc247b
parent2b9adeac18ed3e5bb7c91320dec6a20a02cf624f (diff)
downloadluacov-929a6d310c03d1562b153c46ee201a54d02af964.tar.gz
Allow setting `tick` in config
-rw-r--r--src/luacov/defaults.lua5
-rw-r--r--src/luacov/runner.lua2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/luacov/defaults.lua b/src/luacov/defaults.lua
index 50213b4..b93e5f2 100644
--- a/src/luacov/defaults.lua
+++ b/src/luacov/defaults.lua
@@ -12,6 +12,11 @@ return {
--- Filename to store report. Default: "luacov.report.out".
reportfile = "luacov.report.out",
+ --- Enable saving coverage data after every `savestepsize` lines?
+ -- Setting this flag to `true` in config is equivalent to running LuaCov
+ -- using `luacov.tick` module.
+ tick = false,
+
--- Stats file updating frequency for `luacov.tick`.
-- The lower this value - the more frequently results will be written out to the stats file.
-- You may want to reduce this value (to, for example, 2) to avoid losing coverage data in
diff --git a/src/luacov/runner.lua b/src/luacov/runner.lua
index 7a74f70..d7f150b 100644
--- a/src/luacov/runner.lua
+++ b/src/luacov/runner.lua
@@ -311,6 +311,8 @@ local function set_config(configuration)
for _, patt in ipairs(luacov_excludes) do
table.insert(runner.configuration.exclude, patt)
end
+
+ runner.tick = runner.tick or runner.configuration.tick
end
local default_config_file = ".luacov"