From 626c3b8cbbd00cbdf085d6dd23df18eedaf2a888 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 14 Jul 2020 17:39:21 +0200 Subject: [PATCH] [CI] Fix coverage collection Binaries are build multiple times with different configurations. Copying them into 1 folder will collapse that to one random configuration. Hence just use lcov to gather all data --- .travis.yml | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index a903e1b..2ce871f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,8 @@ addons: - xsltproc - docbook-xsl - docbook-xml + - python-yaml + - lcov before_install: - DOCBOOK_XSL_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl @@ -78,25 +80,14 @@ script: - ctest --output-on-failure --build-config Debug after_success: - - COVERALS_DIR=$PROJECT_DIR/coverals - - # Copying Coveralls data to a separate folder - - mkdir -p $COVERALS_DIR - - find $PROJECT_DIR/test/bin/ -name "*.gcda" -exec cp "{}" $COVERALS_DIR/ \; - - find $PROJECT_DIR/test/bin/ -name "*.gcno" -exec cp "{}" $COVERALS_DIR/ \; - - # Preparing Coveralls data by - # ... installing the tools - - sudo apt-get install -qq python-yaml lcov - # ... changing data format to a readable one - - lcov --directory $COVERALS_DIR --base-directory $PROJECT_DIR/test --capture --output-file $COVERALS_DIR/coverage.info - - # ... erasing /test/ /example/ folder data - - lcov --remove $COVERALS_DIR/coverage.info "/usr*" "/test/*" $IGNORE_COVERAGE "tests/*" "*/doc/examples/*" -o $COVERALS_DIR/coverage.info - # Output what was collected - - lcov --list $COVERALS_DIR/coverage.info - - # Sending data to Coveralls - cd $PROJECT_DIR + # Preparing Coveralls data by + # ... changing data format to a readable one + - lcov --directory "$PROJECT_DIR/test" --capture --output-file coverage.info + # ... erasing /test/ /doc/example/ folder data + - lcov --remove coverage.info "/usr*" $IGNORE_COVERAGE "*/test/*" "*/doc/example/*" -o coverage.info + # Output what was collected + - lcov --list coverage.info + # Sending data to Coveralls - gem install coveralls-lcov - - coveralls-lcov $COVERALS_DIR/coverage.info + - coveralls-lcov coverage.info