gem install coveralls-lcov
lcov --no-external -b ../project -d ../project -c --output-file coverage.${CIRCLE_JOB}.info
+ - &capture_lua_coverage_data
+ run:
+ name: Capturing Lua coverage data
+ command: |
+ set -e
+ sudo luarocks install luacov-coveralls
+ if [ ! -z $COVERALLS_REPO_TOKEN ]; then luacov-coveralls -t ${COVERALLS_REPO_TOKEN} || true; fi
+
- &restore_coverage_data
restore_cache:
keys:
at: *workspace_root
- run: sudo apt-get update -qq || true
- - run: sudo apt-get install -qq cmake libevent-dev libglib2.0-dev libicu-dev libluajit-5.1-dev libmagic-dev libsqlite3-dev libssl-dev ragel libunwind-dev libunwind8
+ - run: sudo apt-get install -qq cmake libevent-dev libglib2.0-dev libicu-dev libluajit-5.1-dev libmagic-dev libsqlite3-dev libssl-dev ragel libunwind-dev libunwind8 luarocks
+ - run: sudo luarocks install luacheck
+ - run: sudo luarocks install luacov
- run: cd ../build
- run: make rspamd-test -j`nproc`
- run: set +e; test/rspamd-test -p /rspamd/lua; echo "export RETURN_CODE=$?" >> $BASH_ENV
- *capture_coverage_data
+ - *capture_lua_coverage_data
# Share coverage data between jobs
- save_cache:
- run: sudo pip install demjson psutil robotframework requests http
- run: sudo luarocks install luacheck
+ - run: sudo luarocks install luacov
- run: cd ../build
- run: set +e; RSPAMD_INSTALLROOT=../install sudo -E robot -x xunit.xml --exclude isbroken ../project/test/functional/cases; echo "export RETURN_CODE=$?" >> $BASH_ENV
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 = {}
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)
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()