diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..a3b625d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,71 @@ +language: generic + +env: + global: + # Ubuntu version + - LINUX_DIST=trusty + - DEPS_DIR=${TRAVIS_BUILD_DIR}/deps + # compiler settings + - COMPILER_NAME=gcc + - CXX=g++-5 + - CC=gcc-5 + # Misc + - RUN_TESTS=true + - COVERAGE=false + +matrix: + include: + - os: linux + dist: trusty + sudo: true + compiler: gcc + addons: + apt: + packages: + - gcc-5 + - g++-5 + # Misc + - python-yaml + sources: &sources + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-6.0 + +before_install: + # Combine global build options with OS/compiler-dependent options + - export CMAKE_OPTIONS=${CMAKE_OPTIONS}" "${ENV_CMAKE_OPTIONS} + - export CXX_FLAGS=${CXX_FLAGS}" "${ENV_CXX_FLAGS} + # c++14 + - sudo apt-get update -qq + +install: + # CodeCov + - sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-5 90 + # Download and install recent cmake + - if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then + CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz"; + mkdir -p ${DEPS_DIR}/cmake; + travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}/cmake; + export PATH=${DEPS_DIR}/cmake/bin:${PATH}; + fi + # we have to build lcov on our own, because it is not possible to install lcov-1.13 with apt + - 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"; + # show info + - echo ${PATH} + - echo ${CXX} + - ${CXX} --version + - ${CXX} -v + - lcov --version + +script: + ############################################################################ + # Build main and tests + ############################################################################ + - mkdir -p build + - cd build + - cmake .. -Dhueplusplus_TESTS=ON + - make coveragetest + + +after_success: + # upload result to codecov + - bash <(curl -s https://codecov.io/bash) diff --git a/hueplusplus/test/CMakeLists.txt b/hueplusplus/test/CMakeLists.txt index c5dc208..6a067e0 100644 --- a/hueplusplus/test/CMakeLists.txt +++ b/hueplusplus/test/CMakeLists.txt @@ -90,7 +90,7 @@ if(LCOV_PATH AND GCOV_PATH) # exclude some special files we do not want to profile set(COVERAGE_EXCLUDES '/usr/*' # unix - '*/build/*' + '*/hueplusplus/build/*' '*/json*' '*/test/*' '*/v1/*' # iOS