Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 012d055

Browse filesBrowse files
authored
Merge pull request #14311 from MatthieuDartiailh/c-coverage
travis: add c code coverage measurements
2 parents d0ddbca + 89478c1 commit 012d055
Copy full SHA for 012d055

File tree

Expand file treeCollapse file tree

2 files changed

+16
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+16
-3
lines changed

‎.travis.yml

Copy file name to clipboardExpand all lines: .travis.yml
+16-2Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ addons:
3232
- gir1.2-gtk-3.0
3333
- graphviz
3434
- inkscape
35+
- lcov
3536
- libcairo2
3637
- libcairo2-dev
3738
- libffi-dev
@@ -158,9 +159,18 @@ install:
158159
echo 'wxPython is available' ||
159160
echo 'wxPython is not available'
160161
162+
# Set flag in a delayed manner to avoid issues with installing other packages
163+
- |
164+
if [[ $TRAVIS_OS_NAME != 'osx' ]] && [[ $RUN_PYTEST == 1 ]]; then
165+
export CPPFLAGS=--coverage
166+
fi
161167
- |
162168
# Install matplotlib
163169
python -mpip install -ve .
170+
- |
171+
if [[ $TRAVIS_OS_NAME != 'osx' ]] && [[ $RUN_PYTEST == 1 ]]; then
172+
unset CPPFLAGS
173+
fi
164174
165175
before_script: |
166176
if [[ $DELETE_FONT_CACHE == 1 ]]; then
@@ -193,5 +203,9 @@ after_failure: |
193203
echo "The result images will only be uploaded if they are on the matplotlib/matplotlib repo - this is for security reasons to prevent arbitrary PRs echoing security details."
194204
fi
195205
196-
after_success: |
197-
codecov -e TRAVIS_PYTHON_VERSION
206+
after_success:
207+
- lcov --capture --directory . --output-file coverage.info
208+
- lcov --remove coverage.info --output-file coverage.info '/usr/*' '/home/travis/build/matplotlib/matplotlib/build/*' '/home/travis/build/matplotlib/matplotlib/extern/*' # filter system-files
209+
- lcov --list coverage.info
210+
# Uploading to CodeCov but excluding gcov reports
211+
- bash <(curl -s https://codecov.io/bash) -f "!*.gcov" -X gcov -e TRAVIS_PYTHON_VERSION|| echo "Codecov did not collect coverage reports"

‎requirements/testing/travis_all.txt

Copy file name to clipboardExpand all lines: requirements/testing/travis_all.txt
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# pip requirements for all the travis builds
22

3-
codecov
43
coverage
54
cycler
65
numpy

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.