diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-02-27 15:55:46 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-02-27 15:55:46 +0000 |
commit | 349bc58cf6d025e4e50a325bda48d318b23b55fb (patch) | |
tree | 04681b3f213983ce8fc4335190ea9713f272510d /test/lua/busted/modules/luacov.lua | |
parent | 2f20e4f7fe5cf9b40dc8781675672e69437166e3 (diff) | |
download | rspamd-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.lua | 22 |
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 |