aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-10-04 16:09:42 +0200
committerGitHub <noreply@github.com>2019-10-04 16:09:42 +0200
commit77a551b6571f9a455efffeb7f43bf8235b2cbe49 (patch)
tree4506ead6fd49bd8e246737b9fd5d353f567b416c
parenta341eb608706e5e8ac691a7e8f4a9d314bafee20 (diff)
downloadrneovim-77a551b6571f9a455efffeb7f43bf8235b2cbe49.tar.gz
rneovim-77a551b6571f9a455efffeb7f43bf8235b2cbe49.tar.bz2
rneovim-77a551b6571f9a455efffeb7f43bf8235b2cbe49.zip
ci: coverage for Lua (no Windows, using luacov) (#11127)
-rw-r--r--.luacov19
-rw-r--r--.travis.yml2
-rwxr-xr-xci/before_script.sh5
-rwxr-xr-xci/common/submit_coverage.sh8
4 files changed, 34 insertions, 0 deletions
diff --git a/.luacov b/.luacov
new file mode 100644
index 0000000000..422783b858
--- /dev/null
+++ b/.luacov
@@ -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
diff --git a/.travis.yml b/.travis.yml
index 2882ba8935..d8a1d2ddf0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -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:
diff --git a/ci/before_script.sh b/ci/before_script.sh
index 605ecdbf66..6a07c6747e 100755
--- a/ci/before_script.sh
+++ b/ci/before_script.sh
@@ -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}"
diff --git a/ci/common/submit_coverage.sh b/ci/common/submit_coverage.sh
index 4e92975d22..c3e6be7f38 100755
--- a/ci/common/submit_coverage.sh
+++ b/ci/common/submit_coverage.sh
@@ -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