diff options
Diffstat (limited to 'tools/travis-test.sh')
-rwxr-xr-x | tools/travis-test.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/travis-test.sh b/tools/travis-test.sh index 11863b5fe..97b192813 100755 --- a/tools/travis-test.sh +++ b/tools/travis-test.sh @@ -125,6 +125,22 @@ run_test() fi if [ -n "$RUN_COVERAGE" ]; then + # move back up to the source dir because we want to execute + # gcov on the source files after the tests have gone through + # the code paths + cd .. + + # execute gcov on source files + find . -name '*.gcno' -type f -exec gcov -pb {} + + + # move the C line coverage report files to the same path + # as the Python report data + mv *.gcov empty + + # move back to the previous path for good measure + # as the Python coverage data is there + cd empty + # Upload coverage files to codecov bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy fi @@ -153,6 +169,14 @@ if [ -n "$USE_WHEEL" ] && [ $# -eq 0 ]; then $PIP install -U virtualenv # ensure some warnings are not issued export CFLAGS=$CFLAGS" -Wno-sign-compare -Wno-unused-result" + # adjust gcc flags if C coverage requested + if [ -n "$RUN_COVERAGE" ]; then + export NPY_DISTUTILS_APPEND_FLAGS=1 + export CC='gcc --coverage' + export F77='gfortran --coverage' + export F90='gfortran --coverage' + export LDFLAGS='--coverage' + fi $PYTHON setup.py bdist_wheel # Make another virtualenv to install into virtualenv --python=`which $PYTHON` venv-for-wheel |