mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
ci: coverage for Lua (no Windows, using luacov) (#11127)
This commit is contained in:
parent
a341eb6087
commit
77a551b657
19
.luacov
Normal file
19
.luacov
Normal file
@ -0,0 +1,19 @@
|
||||
-- Configuration file for LuaCov
|
||||
|
||||
local source = require("lfs").currentdir()
|
||||
|
||||
local function pesc(s)
|
||||
assert(type(s) == 'string', s)
|
||||
return s:gsub('[%(%)%.%%%+%-%*%?%[%]%^%$]', '%%%1')
|
||||
end
|
||||
|
||||
return {
|
||||
include = {
|
||||
-- Absolute paths (starting with source dir, not hidden (i.e. .deps)).
|
||||
pesc(source) .. "[/\\][^.].+",
|
||||
-- Relative (non-hidden) paths.
|
||||
'^[^/\\.]',
|
||||
},
|
||||
}
|
||||
|
||||
-- vim: ft=lua tw=80 sw=2 et
|
@ -95,6 +95,8 @@ jobs:
|
||||
- GCOV=gcov-9
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||
- GCOV_ERROR_FILE="/tmp/libgcov-errors.log"
|
||||
- USE_LUACOV=1
|
||||
- BUSTED_ARGS="--coverage"
|
||||
- *common-job-env
|
||||
addons:
|
||||
apt:
|
||||
|
@ -35,5 +35,10 @@ fi
|
||||
# Compile dependencies.
|
||||
build_deps
|
||||
|
||||
# Install luacov for Lua coverage.
|
||||
if [[ "$USE_LUACOV" == 1 ]]; then
|
||||
"${DEPS_BUILD_DIR}/usr/bin/luarocks" install luacov
|
||||
fi
|
||||
|
||||
rm -rf "${LOG_DIR}"
|
||||
mkdir -p "${LOG_DIR}"
|
||||
|
@ -43,3 +43,11 @@ fi
|
||||
# Cleanup always, especially collected data.
|
||||
find . \( -name '*.gcov' -o -name '*.gcda' \) -ls -delete | wc -l
|
||||
rm -f coverage.xml
|
||||
|
||||
# Upload Lua coverage (generated manually on AppVeyor/Windows).
|
||||
if [ "$USE_LUACOV" = 1 ] && [ "$1" != "oldtest" ]; then
|
||||
if ! "$codecov_sh" -f luacov.report.out -X gcov -X fix -Z -F "lua,${codecov_flags}"; then
|
||||
echo "codecov upload failed."
|
||||
fi
|
||||
rm luacov.stats.out
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user