mirror of
https://github.com/vxcontrol/soldr-modules.git
synced 2026-07-01 12:47:17 -04:00
24 lines
729 B
Lua
24 lines
729 B
Lua
return function()
|
|
-- Function to initialize luacov if available
|
|
local loadLuaCov = function(config)
|
|
local result, luacov = pcall(require, 'luacov.runner')
|
|
|
|
if not result then
|
|
return nil, 'LuaCov not found on the system, try running without --coverage option, or install LuaCov first'
|
|
end
|
|
|
|
-- call it to start
|
|
luacov(config)
|
|
|
|
-- 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%.')
|
|
return true
|
|
end
|
|
|
|
return loadLuaCov
|
|
end
|