Commit 048cba4373e4771a26f2d81bb4162bdd78252cec
Committed by
Moritz Wirger
1 parent
c18736c9
Run coveragetest with travis ci and publish results on codecov
- add travis.yml with crude implementation - fix issue with COVERAGE_EXCLUDES removing all files and travis ci
Showing
2 changed files
with
72 additions
and
1 deletions
.travis.yml
0 → 100644
| 1 | +language: generic | ||
| 2 | + | ||
| 3 | +env: | ||
| 4 | + global: | ||
| 5 | + # Ubuntu version | ||
| 6 | + - LINUX_DIST=trusty | ||
| 7 | + - DEPS_DIR=${TRAVIS_BUILD_DIR}/deps | ||
| 8 | + # compiler settings | ||
| 9 | + - COMPILER_NAME=gcc | ||
| 10 | + - CXX=g++-5 | ||
| 11 | + - CC=gcc-5 | ||
| 12 | + # Misc | ||
| 13 | + - RUN_TESTS=true | ||
| 14 | + - COVERAGE=false | ||
| 15 | + | ||
| 16 | +matrix: | ||
| 17 | + include: | ||
| 18 | + - os: linux | ||
| 19 | + dist: trusty | ||
| 20 | + sudo: true | ||
| 21 | + compiler: gcc | ||
| 22 | + addons: | ||
| 23 | + apt: | ||
| 24 | + packages: | ||
| 25 | + - gcc-5 | ||
| 26 | + - g++-5 | ||
| 27 | + # Misc | ||
| 28 | + - python-yaml | ||
| 29 | + sources: &sources | ||
| 30 | + - ubuntu-toolchain-r-test | ||
| 31 | + - llvm-toolchain-trusty-6.0 | ||
| 32 | + | ||
| 33 | +before_install: | ||
| 34 | + # Combine global build options with OS/compiler-dependent options | ||
| 35 | + - export CMAKE_OPTIONS=${CMAKE_OPTIONS}" "${ENV_CMAKE_OPTIONS} | ||
| 36 | + - export CXX_FLAGS=${CXX_FLAGS}" "${ENV_CXX_FLAGS} | ||
| 37 | + # c++14 | ||
| 38 | + - sudo apt-get update -qq | ||
| 39 | + | ||
| 40 | +install: | ||
| 41 | + # CodeCov | ||
| 42 | + - sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-5 90 | ||
| 43 | + # Download and install recent cmake | ||
| 44 | + - if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then | ||
| 45 | + CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz"; | ||
| 46 | + mkdir -p ${DEPS_DIR}/cmake; | ||
| 47 | + travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}/cmake; | ||
| 48 | + export PATH=${DEPS_DIR}/cmake/bin:${PATH}; | ||
| 49 | + fi | ||
| 50 | + # we have to build lcov on our own, because it is not possible to install lcov-1.13 with apt | ||
| 51 | + - wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.13.orig.tar.gz && tar xf lcov_1.13.orig.tar.gz && make -C lcov-1.13 "PREFIX=${HOME}/.local" install && export PATH="${PATH}:${HOME}/.local/bin"; | ||
| 52 | + # show info | ||
| 53 | + - echo ${PATH} | ||
| 54 | + - echo ${CXX} | ||
| 55 | + - ${CXX} --version | ||
| 56 | + - ${CXX} -v | ||
| 57 | + - lcov --version | ||
| 58 | + | ||
| 59 | +script: | ||
| 60 | + ############################################################################ | ||
| 61 | + # Build main and tests | ||
| 62 | + ############################################################################ | ||
| 63 | + - mkdir -p build | ||
| 64 | + - cd build | ||
| 65 | + - cmake .. -Dhueplusplus_TESTS=ON | ||
| 66 | + - make coveragetest | ||
| 67 | + | ||
| 68 | + | ||
| 69 | +after_success: | ||
| 70 | + # upload result to codecov | ||
| 71 | + - bash <(curl -s https://codecov.io/bash) |
hueplusplus/test/CMakeLists.txt
| @@ -90,7 +90,7 @@ if(LCOV_PATH AND GCOV_PATH) | @@ -90,7 +90,7 @@ if(LCOV_PATH AND GCOV_PATH) | ||
| 90 | # exclude some special files we do not want to profile | 90 | # exclude some special files we do not want to profile |
| 91 | set(COVERAGE_EXCLUDES | 91 | set(COVERAGE_EXCLUDES |
| 92 | '/usr/*' # unix | 92 | '/usr/*' # unix |
| 93 | - '*/build/*' | 93 | + '*/hueplusplus/build/*' |
| 94 | '*/json*' | 94 | '*/json*' |
| 95 | '*/test/*' | 95 | '*/test/*' |
| 96 | '*/v1/*' # iOS | 96 | '*/v1/*' # iOS |