summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-03-29 22:36:25 +0100
committerSébastien Helleu <flashcode@flashtux.org>2019-03-29 22:37:03 +0100
commit3e22bc116be87a3c08486e0e00dd862fc35df6e0 (patch)
tree906b55d994d3ec5dbb804302dcfee585a48674d7 /tools
parent4df26f391d200577d8ee206df190141cae7cb077 (diff)
downloadweechat-3e22bc116be87a3c08486e0e00dd862fc35df6e0.zip
core: upload code coverage on codecov.io in Travis CI
Diffstat (limited to 'tools')
-rwxr-xr-xtools/build-test.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/build-test.sh b/tools/build-test.sh
index 939fe38fa..bd13c8dcd 100755
--- a/tools/build-test.sh
+++ b/tools/build-test.sh
@@ -19,10 +19,10 @@
#
#
-# Build WeeChat with CMake or autotools, according to environment variable
-# $BUILDTOOL or first script argument (if given).
-# The optional variable $BUILDARGS can be set with arguments for cmake or
-# configure commands.
+# Build WeeChat according to environment variables:
+# - BUILDTOOL: cmake or autotools
+# - BUILDARGS: arguments for cmake or configure commands
+# - CODECOVERAGE: "1" to build with code coverage (works only with cmake)
#
# Syntax to run the script with environment variables:
# BUILDTOOL=cmake ./build-test.sh
@@ -73,6 +73,12 @@ if [ "$BUILDTOOL" = "cmake" ]; then
run "make VERBOSE=1 -j$(nproc)"
run "sudo make install"
run "ctest -V"
+ if [ $? -eq 0 ] && [ "$CODECOVERAGE" = "1" ]; then
+ run "lcov --directory . --capture --output-file coverage.info"
+ run "lcov --remove coverage.info '/usr/*' --output-file coverage.info"
+ run "lcov --list coverage.info"
+ run "bash <(curl -s https://codecov.io/bash) -f coverage.info"
+ fi
fi
if [ "$BUILDTOOL" = "autotools" ]; then