sudo: false dist: trusty language: cpp addons: apt: sources: ['ubuntu-toolchain-r-test'] packages: ['gcc-7','g++-7','libpcap-dev','libjson-c-dev','valgrind','gcovr','ccache','texlive-latex-base'] cache: apt: true directories: - ccache - $HOME/.ccache - $DEPS_DIR env: global: - DEPS_DIR="$HOME/install" - LCOV_DIR="$DEPS_DIR/lcov-1.11" - LCOV="$LCOV_DIR/bin/lcov" matrix: include: - os: linux compiler: gcc env: - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" - CXXFLAGS="-g -O0 -fprofile-arcs -ftest-coverage -fPIC" CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage" gcov="/usr/bin/gcov-7" fast_finish: true - os: linux compiler: clang env: - MATRIX_EVAL="CC=clang && CXX=clang++" fast_finish: true - os: linux compiler: clang env: - MATRIX_EVAL="CC=clang && CXX=clang++" - CXXFLAGS="-fsanitize=address" fast_finish: true - os: linux compiler: clang env: - MATRIX_EVAL="CC=clang && CXX=clang++" - CXXFLAGS="-fsanitize=thread" fast_finish: true before_install: - eval "${MATRIX_EVAL}" - export install: - pip install --user --upgrade cpp-coveralls - gem install coveralls-lcov - | if [ ! -f "$LCOV" ]; then wget -O - --no-check-certificate http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz && cp -r lcov-1.11 $DEPS_DIR make -C $LCOV_DIR else echo "Using cached lcov" fi before_script: - gcov --version - $LCOV --gcov-tool "/usr/bin/gcov-7" --directory . --zerocounters script: - | ctest --build-and-test . ./build --build-config debug --build-generator 'Unix Makefiles' --parallel 4 --build-target all \ --build-options -DGTEST_SOURCE_DIR=$TRAVIS_BUILD_DIR/third_party/googletest -DINCLUDE_COVERAGE_INFO="true" \ --test-command ctest - cmake --build ./build --target documentation-pdflatex - ccache -s after_success: - | if [[ "$CXX" == "g++"* ]]; then $LCOV --gcov-tool "/usr/bin/gcov-7" --compat-libtool --directory . --capture --output-file coverage.info # capture coverage info $LCOV --gcov-tool "/usr/bin/gcov-7" --remove coverage.info 'tests/*' '/usr/*' '*gmock*' --output-file coverage.info # filter out system and test code coveralls-lcov coverage.info fi after_failure: - cat $TRAVIS_BUILD_DIR/build/Testing/Temporary/LastTest.log