summaryrefslogtreecommitdiffstats
path: root/test/lua/busted/modules/luacov.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-27 15:55:46 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-27 15:55:46 +0000
commit349bc58cf6d025e4e50a325bda48d318b23b55fb (patch)
tree04681b3f213983ce8fc4335190ea9713f272510d /test/lua/busted/modules/luacov.lua
parent2f20e4f7fe5cf9b40dc8781675672e69437166e3 (diff)
downloadrspamd-349bc58cf6d025e4e50a325bda48d318b23b55fb.tar.gz
rspamd-349bc58cf6d025e4e50a325bda48d318b23b55fb.zip
Reorganize lua tests.
Diffstat (limited to 'test/lua/busted/modules/luacov.lua')
-rw-r--r--test/lua/busted/modules/luacov.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/lua/busted/modules/luacov.lua b/test/lua/busted/modules/luacov.lua
new file mode 100644
index 000000000..99cfc8f56
--- /dev/null
+++ b/test/lua/busted/modules/luacov.lua
@@ -0,0 +1,22 @@
+return function()
+ -- Function to initialize luacov if available
+ local loadLuaCov = function()
+ local result, luacov = pcall(require, 'luacov.runner')
+
+ if not result then
+ return print('LuaCov not found on the system, try running without --coverage option, or install LuaCov first')
+ end
+
+ -- call it to start
+ luacov()
+
+ -- exclude busted files
+ table.insert(luacov.configuration.exclude, 'busted_bootstrap$')
+ table.insert(luacov.configuration.exclude, 'busted%.')
+ table.insert(luacov.configuration.exclude, 'luassert%.')
+ table.insert(luacov.configuration.exclude, 'say%.')
+ table.insert(luacov.configuration.exclude, 'pl%.')
+ end
+
+ return loadLuaCov
+end