Enable code coverage on Travis.
This commit is contained in:
parent
17328e7019
commit
8a9479f8ea
33
.coveragerc
33
.coveragerc
|
@ -15,3 +15,36 @@ source =
|
|||
run_project_tests.py
|
||||
run_tests.py
|
||||
run_unittests.py
|
||||
|
||||
# Aliases to /root/ are needed because Travis runs in docker at /root/.
|
||||
[paths]
|
||||
meson =
|
||||
meson.py
|
||||
/root/meson.py
|
||||
mesonbuild =
|
||||
mesonbuild/
|
||||
/root/mesonbuild/
|
||||
mesonconf =
|
||||
mesonconf.py
|
||||
/root/mesonconf.py
|
||||
mesonintrospect =
|
||||
mesonintrospect.py
|
||||
/root/mesonintrospect.py
|
||||
mesonrewriter =
|
||||
mesonrewriter.py
|
||||
/root/mesonrewriter.py
|
||||
mesontest =
|
||||
mesontest.py
|
||||
/root/mesontest.py
|
||||
run_cross_test =
|
||||
run_cross_test.py
|
||||
/root/run_cross_test.py
|
||||
run_project_tests =
|
||||
run_project_tests.py
|
||||
/root/run_project_tests.py
|
||||
run_tests =
|
||||
run_tests.py
|
||||
/root/run_tests.py
|
||||
run_unittests =
|
||||
run_unittests.py
|
||||
/root/run_unittests.py
|
||||
|
|
16
.travis.yml
16
.travis.yml
|
@ -32,6 +32,8 @@ before_install:
|
|||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ninja python3; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull jpakkane/mesonci:zesty; fi
|
||||
- pip3 install codecov
|
||||
- mkdir .coverage
|
||||
|
||||
# We need to copy the current checkout inside the Docker container,
|
||||
# because it has the MR id to be tested checked out.
|
||||
|
@ -40,5 +42,15 @@ script:
|
|||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM jpakkane/mesonci:zesty > Dockerfile; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo ADD . /root >> Dockerfile; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t withgit .; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run withgit /bin/sh -c "cd /root && TRAVIS=true CC=$CC CXX=$CXX OBJC=$CC OBJCXX=$CXX ./run_tests.py -- $MESON_ARGS"; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then SDKROOT=$(xcodebuild -version -sdk macosx Path) OBJC=$CC OBJCXX=$CXX ./run_tests.py --backend=ninja -- $MESON_ARGS ; fi
|
||||
- |
|
||||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
||||
ci_env=`bash <(curl -s https://codecov.io/env)`
|
||||
docker run $ci_env -v ${PWD}/.coverage:/root/.coverage \
|
||||
withgit \
|
||||
/bin/sh -c "cd /root && CC=$CC CXX=$CXX OBJC=$CC OBJCXX=$CXX ./run_tests.py --cov -- $MESON_ARGS; chmod -R a+rwX .coverage"
|
||||
fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then SDKROOT=$(xcodebuild -version -sdk macosx Path) OBJC=$CC OBJCXX=$CXX ./run_tests.py --cov --backend=ninja -- $MESON_ARGS ; fi
|
||||
|
||||
after_success:
|
||||
- coverage3 combine
|
||||
- codecov
|
||||
|
|
Loading…
Reference in New Issue