diff options
author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2017-05-07 03:22:36 -0400 |
---|---|---|
committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2017-05-21 16:11:33 -0400 |
commit | 8a9479f8eaab73676ef98c570dfafaff2b5453ec (patch) | |
tree | ce888ccfb41b95681f1a772d59d0a704cf0ef04a | |
parent | 17328e7019b8b7406a82a508beedf3138ad1681b (diff) | |
download | meson-8a9479f8eaab73676ef98c570dfafaff2b5453ec.zip meson-8a9479f8eaab73676ef98c570dfafaff2b5453ec.tar.gz meson-8a9479f8eaab73676ef98c570dfafaff2b5453ec.tar.bz2 |
Enable code coverage on Travis.
-rw-r--r-- | .coveragerc | 33 | ||||
-rw-r--r-- | .travis.yml | 16 |
2 files changed, 47 insertions, 2 deletions
diff --git a/.coveragerc b/.coveragerc index a345f46..c3d41d4 100644 --- a/.coveragerc +++ b/.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 diff --git a/.travis.yml b/.travis.yml index 5f4318d..5a73397 100644 --- a/.travis.yml +++ b/.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 |