Commit 28b667ae authored by Paul Romano's avatar Paul Romano Committed by GitHub

Merge pull request #1235 from GiudGiud/PR_cov_cpp

Add coverage of c++ source files using cpp-coveralls
parents 3fc2c2f8 55b9db9c
......@@ -53,4 +53,5 @@ before_script:
script:
- ./tools/ci/travis-script.sh
after_success:
- coveralls
- cpp-coveralls -i src -i include --exclude-pattern "/usr/*" --dump cpp_cov.json
- coveralls --merge=cpp_cov.json
......@@ -95,6 +95,10 @@ if(optimize)
list(REMOVE_ITEM cxxflags -O2)
list(APPEND cxxflags -O3)
endif()
if(coverage)
list(APPEND cxxflags --coverage)
list(APPEND ldflags --coverage)
endif()
# Show flags being used
message(STATUS "OpenMC C++ flags: ${cxxflags}")
......
......@@ -48,6 +48,9 @@ def install(omp=False, mpi=False, phdf5=False, dagmc=False):
if dagmc:
cmake_cmd.append('-Ddagmc=ON')
# Build in coverage mode for coverage testing
cmake_cmd.append('-Dcoverage=on')
# Build and install
cmake_cmd.append('..')
print(' '.join(cmake_cmd))
......
......@@ -25,5 +25,8 @@ python tools/ci/travis-install.py
# Install Python API in editable mode
pip install -e .[test,vtk]
# For uploading to coveralls
# For coverage testing of the C++ source files
pip install cpp-coveralls
# For coverage testing of the Python source files
pip install coveralls
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment