diff options
-rw-r--r-- | .travis.yml | 3 | ||||
-rwxr-xr-x | tools/build-test.sh | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml index 96d46c126..971202dd6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ env: - BUILDTOOL="cmake" BUILDARGS="" # - BUILDTOOL="cmake" BUILDARGS="-DENABLE_PYTHON3=ON" - BUILDTOOL="cmake" BUILDARGS="-DENABLE_GNUTLS=OFF" + - BUILDTOOL="cmake" BUILDARGS="-DENABLE_CODE_COVERAGE=ON" CODECOVERAGE="1" - BUILDTOOL="autotools" BUILDARGS="" # - BUILDTOOL="autotools" BUILDARGS="--enable-python3" - BUILDTOOL="autotools" BUILDARGS="--disable-gnutls" @@ -20,7 +21,7 @@ before_script: - export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g") - echo 'APT::Install-Recommends "false";' | sudo tee -a /etc/apt/apt.conf - travis_retry sudo apt-get update -qq - - travis_retry sudo apt-get -y install devscripts equivs python-pip libenchant-dev autopoint cmake pkg-config libncursesw5-dev gem2deb libperl-dev python-dev python3-dev libaspell-dev liblua5.3-dev tcl8.6-dev guile-2.0-dev libv8-dev libcurl4-gnutls-dev libgcrypt20-dev libgnutls-dev zlib1g-dev curl libcpputest-dev php7.0-dev libphp7.0-embed + - travis_retry sudo apt-get -y install devscripts equivs python-pip libenchant-dev autopoint cmake lcov pkg-config libncursesw5-dev gem2deb libperl-dev python-dev python3-dev libaspell-dev liblua5.3-dev tcl8.6-dev guile-2.0-dev libv8-dev libcurl4-gnutls-dev libgcrypt20-dev libgnutls-dev zlib1g-dev curl libcpputest-dev php7.0-dev libphp7.0-embed - travis_retry sudo gem install asciidoctor - travis_retry sudo -H pip install --ignore-installed msgcheck pylint - phpenv local system 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 |