Skip to content

Commit

Permalink
Merge pull request #346 from networkit/feature/coveralls
Browse files Browse the repository at this point in the history
Support coverage
  • Loading branch information
avdgrinten committed Jun 24, 2019
2 parents 0d93ff8 + ee4b484 commit 207da43
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,27 @@ matrix:
- make -j2
- ctest -V

- name: "Linux, gcc 5: Coverage"
compiler: gcc
os: linux
dist: xenial
addons: &gcc5
apt:
packages:
- python3-pip
- python3.5-venv
script:
- python3 -m venv pyenv && . pyenv/bin/activate
- pip3 install --upgrade pip
- pip3 install setuptools cpp-coveralls
- mkdir build && cd "$_"
- cmake -DNETWORKIT_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DNETWORKIT_COVERAGE=ON ..
- make -j2
- ctest -V
after_success:
- cd ..
- coveralls -E ".*test/.*" -E ".*CMakeFiles.*" --exclude extlibs --exclude pyenv --exclude scripts --root .

- name: Linux, GCC 8
env:
- CC=gcc-8
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ option(NETWORKIT_NATIVE "Optimize for native architecture (often better performa
option(NETWORKIT_WARNINGS "Issue more warnings" OFF)
option(NETWORKIT_INCLUDESYMLINK "Create symlink to cpp directory" ON)
option(NETWORKIT_FLATINSTALL "Install into a flat directory structure (useful when building a Python package)" OFF)
option(NETWORKIT_COVERAGE "Build with support for coverage" OFF)
set(NETWORKIT_PYTHON "" CACHE STRING "Directory containing Python.h. Implies MONOLITH=TRUE")
set(NETWORKIT_PYTHON_SOABI "" CACHE STRING "Platform specific file extension. Implies MONOLITH=TRUE")
set(NETWORKIT_WITH_SANITIZERS "" CACHE STRING "Uses sanitizers during the compilation")
Expand Down Expand Up @@ -90,6 +91,12 @@ if (NOT "${NETWORKIT_CXX_SANITIZERS}" STREQUAL "")
set(NETWORKIT_LINK_FLAGS "-fsanitize=${NETWORKIT_CXX_SANITIZERS} ${NETWORKIT_LINK_FLAGS}")
endif()

# Check if coverage support is enabled
if (NETWORKIT_COVERAGE)
set(NETWORKIT_CXX_FLAGS "${NETWORKIT_CXX_FLAGS} --coverage")
set(NETWORKIT_LINK_FLAGS "${NETWORKIT_LINK_FLAGS} --coverage")
endif()

# FindOpenMP.cmake does not reliably find a user installed openmp library
# Following section manually sets the required fields for clang-like compiler
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ NetworKit
[![Travis Build Status](https://travis-ci.org/kit-parco/networkit.svg?branch=Dev)](https://travis-ci.org/kit-parco/networkit)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/kit-parco/networkit?branch=Dev&svg=true)](https://ci.appveyor.com/project/kit-parco/networkit)
[![PyPI version](https://badge.fury.io/py/networkit.svg)](https://badge.fury.io/py/networkit)
[![Coverage Status](https://coveralls.io/repos/github/networkit/networkit/badge.svg?branch=Dev)](https://coveralls.io/github/networkit/networkit?branch=Dev)

[NetworKit][networkit] is an open-source tool suite for high-performance
network analysis. Its aim is to provide tools for the analysis of large
Expand Down

0 comments on commit 207da43

Please sign in to comment.