summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMikhail Galanin <negram@users.noreply.github.com>2018-09-25 15:22:28 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-25 15:22:28 +0100
commit70571f2b5513db967f68194878e177c52e69a107 (patch)
tree8c564a5e9e70fdd6fca0a2fd07f3d44fd020133a /test
parenta84877f40f9139f3cba7bd81d7bdd73c86870c4c (diff)
downloadrspamd-70571f2b5513db967f68194878e177c52e69a107.tar.gz
rspamd-70571f2b5513db967f68194878e177c52e69a107.zip
[Minor] Add Lua coverage collection for unit-tests (#2528)
* [Minor] Add Lua coverage collection for unit-tests * [Minor] add coverage collection to CircleCI * [Minor] split into two lines * [Minor] sudo * [Minor] fixed nonsense * [Minor] Fix functional test
Diffstat (limited to 'test')
-rw-r--r--test/lua/tests.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/lua/tests.lua b/test/lua/tests.lua
index 6c05e02e0..82c546903 100644
--- a/test/lua/tests.lua
+++ b/test/lua/tests.lua
@@ -2,6 +2,15 @@
local telescope = require "telescope"
require "rspamd_assertions"
+local loaded, luacov = pcall(require, 'luacov.runner')
+if not loaded then
+ luacov = {
+ init = function() end,
+ shutdown = function() end,
+ run_report = function() end
+ }
+end
+luacov.init()
local contexts = {}
@@ -14,6 +23,7 @@ end
if not test_pattern then
test_filter = function(_) return true end
end
+
local buffer = {}
local results = telescope.run(contexts, callbacks, test_filter)
local summary, data = telescope.summary_report(contexts, results)
@@ -35,4 +45,7 @@ for _, v in pairs(results) do
v.status_code == telescope.status_codes.fail then
os.exit(1)
end
-end \ No newline at end of file
+end
+
+luacov:shutdown()
+luacov:run_report()