Skip to content

Commit

Permalink
coverage: first stab at coveralls support
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrush committed Apr 2, 2016
1 parent a1f4d01 commit 5914a29
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Expand Up @@ -75,6 +75,7 @@ before_install:
install:
- sh cmake-3.3.0-Linux-x86_64.sh --skip-license --prefix=${TRAVIS_HOME}/cmake/
- conda install --yes python=2.7 numpy
- pip install cpp-coveralls
script:
- cmake --version
- cd $TRAVIS_BUILD_DIR
Expand All @@ -93,12 +94,16 @@ script:
- CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_FORTRAN=ON"
# enable python support
- CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_PYTHON=ON"
# enable coverage
- CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_COVERAGE=ON"
# configure with cmake
- cmake ${CMAKE_OPTS} ../src
# build, test, and install
- make
- make test
- make install
after_success:
coveralls --include src/libs/conduit --gcov-options '\-lp' --root $TRAVIS_BUILD_DIR --build-root $TRAVIS_BUILD_DIR/travis-debug-build;
notifications:
email:
recipients:
Expand Down
10 changes: 10 additions & 0 deletions src/CMake/CMakeBasics.cmake
Expand Up @@ -82,6 +82,16 @@ else()
message(STATUS "Building static libraries (BUILD_SHARED_LIBS == OFF)")
endif()

################################
# Coverage Flags
################################
if(ENABLE_COVERAGE)
message(STATUS "Building using coverage flags (ENABLE_COVERAGE == ON)")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
else()
message(STATUS "Building without coverage flags (ENABLE_COVERAGE == OFF)")
endif()

################################
# RPath Settings
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Expand Up @@ -61,6 +61,7 @@ project(conduit)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(ENABLE_TESTS "Build conduit tests" ON)
option(ENABLE_GPREF_TOOLS "Build with google perftools" OFF)
option(ENABLE_COVERAGE "Build with coverage flags" OFF)

option(ENABLE_PYTHON "Build Python Support" OFF)
option(ENABLE_FORTRAN "Build Fortran support" OFF)
Expand Down

0 comments on commit 5914a29

Please sign in to comment.