Integrate converage reporting

This commit is contained in:
Patrick Niklaus 2016-04-08 00:49:53 +02:00
parent fcbf527ba5
commit 6643e7f499
3 changed files with 33 additions and 9 deletions

View File

@ -27,8 +27,8 @@ matrix:
addons: &gcc5 addons: &gcc5
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] packages: ['g++-5', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'pip']
env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Debug' env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Debug' COVERAGE=ON
- os: linux - os: linux
compiler: gcc compiler: gcc
@ -129,12 +129,15 @@ install:
- npm install - npm install
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
- |
if [[ -n "${COVERAGE}" ]]; then
pip install --user cpp-coveralls
fi
- | - |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz" CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH} export PATH=${DEPS_DIR}/cmake/bin:${PATH}
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
# implicit deps, but seem to be installed by default with recent images: libxml2 GDAL boost # implicit deps, but seem to be installed by default with recent images: libxml2 GDAL boost
brew install cmake libzip libstxxl lua51 luabind tbb md5sha1sum brew install cmake libzip libstxxl lua51 luabind tbb md5sha1sum
@ -149,7 +152,7 @@ before_script:
- mkdir build && pushd build - mkdir build && pushd build
- export CC=${CCOMPILER} CXX=${CXXCOMPILER} - export CC=${CCOMPILER} CXX=${CXXCOMPILER}
- export OSRM_PORT=5000 OSRM_TIMEOUT=6000 - export OSRM_PORT=5000 OSRM_TIMEOUT=6000
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=0 - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DCOVERAGE=${COVERAGE:-OFF} -DBUILD_TOOLS=1 -DENABLE_CCACHE=0
script: script:
- make --jobs=2 - make --jobs=2
@ -179,7 +182,12 @@ script:
- make - make
- ./osrm-example ../../test/data/monaco.osrm - ./osrm-example ../../test/data/monaco.osrm
- popd - popd
after_success:
- | - |
if [ -n "$RUN_CLANG_FORMAT" ]; then if [ -n "$RUN_CLANG_FORMAT" ]; then
./scripts/format.sh || true # we don't want to fail just yet ./scripts/format.sh || true # we don't want to fail just yet
fi fi
- pushd build
- coveralls --exclude unit_tests --gcov-options '\-lp'
- popd

View File

@ -34,6 +34,7 @@ option(ENABLE_JSON_LOGGING "Adds additional JSON debug logging to the response"
option(BUILD_TOOLS "Build OSRM tools" OFF) option(BUILD_TOOLS "Build OSRM tools" OFF)
option(BUILD_COMPONENTS "Build OSRM tools" ON) option(BUILD_COMPONENTS "Build OSRM tools" ON)
option(ENABLE_ASSERTIONS OFF) option(ENABLE_ASSERTIONS OFF)
option(COVERAGE OFF)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
@ -133,6 +134,15 @@ if(CMAKE_BUILD_TYPE MATCHES Release)
endif() endif()
endif() endif()
set(MAYBE_COVERAGE_LIBRARIES "")
if (COVERAGE)
if (NOT CMAKE_BUILD_TYPE MATCHES "DEBUG")
message(ERROR "COVERAGE=ON only make sense with a Debug build")
endif()
set(MAYBE_COVERAGE_LIBRARIES "gcov")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs")
endif()
# Configuring compilers # Configuring compilers
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics")
@ -281,7 +291,8 @@ set(EXTRACTOR_LIBRARIES
${OSMIUM_LIBRARIES} ${OSMIUM_LIBRARIES}
${STXXL_LIBRARY} ${STXXL_LIBRARY}
${TBB_LIBRARIES} ${TBB_LIBRARIES}
${ZLIB_LIBRARY}) ${ZLIB_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(CONTRACTOR_LIBRARIES set(CONTRACTOR_LIBRARIES
${Boost_LIBRARIES} ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
@ -289,23 +300,27 @@ set(CONTRACTOR_LIBRARIES
${USED_LUA_LIBRARIES} ${USED_LUA_LIBRARIES}
${STXXL_LIBRARY} ${STXXL_LIBRARY}
${TBB_LIBRARIES} ${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}) ${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(ENGINE_LIBRARIES set(ENGINE_LIBRARIES
${Boost_LIBRARIES} ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${STXXL_LIBRARY} ${STXXL_LIBRARY}
${TBB_LIBRARIES} ${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}) ${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(STORAGE_LIBRARIES set(STORAGE_LIBRARIES
${Boost_LIBRARIES} ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES} ${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}) ${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(UTIL_LIBRARIES set(UTIL_LIBRARIES
${Boost_LIBRARIES} ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${STXXL_LIBRARY} ${STXXL_LIBRARY}
${TBB_LIBRARIES}) ${TBB_LIBRARIES}
${MAYBE_COVERAGE_LIBRARIES})
# Libraries # Libraries
target_link_libraries(osrm ${ENGINE_LIBRARIES}) target_link_libraries(osrm ${ENGINE_LIBRARIES})
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES}) target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES})

View File

@ -10,6 +10,7 @@ The Open Source Routing Machine is a high performance routing engine written in
| Linux | develop | [![Build Status](https://travis-ci.org/Project-OSRM/osrm-backend.png?branch=develop)](https://travis-ci.org/Project-OSRM/osrm-backend) | | Linux | develop | [![Build Status](https://travis-ci.org/Project-OSRM/osrm-backend.png?branch=develop)](https://travis-ci.org/Project-OSRM/osrm-backend) |
| Windows | master/develop | [![Build status](https://ci.appveyor.com/api/projects/status/4iuo3s9gxprmcjjh)](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) | | Windows | master/develop | [![Build status](https://ci.appveyor.com/api/projects/status/4iuo3s9gxprmcjjh)](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
| LUAbind fork | master | [![Build Status](https://travis-ci.org/DennisOSRM/luabind.png?branch=master)](https://travis-ci.org/DennisOSRM/luabind) | | LUAbind fork | master | [![Build Status](https://travis-ci.org/DennisOSRM/luabind.png?branch=master)](https://travis-ci.org/DennisOSRM/luabind) |
| Coverage | develop | [![Coverage Status](https://coveralls.io/repos/github/Project-OSRM/osrm-backend/badge.svg?branch=develop)](https://coveralls.io/github/Project-OSRM/osrm-backend?branch=develop) |
## Building ## Building