From 44d16a9f68bcdb1cbf82018567077cc0619b8728 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 7 Jun 2018 23:11:03 +0200 Subject: Add a scripts/gen_html_coverage.sh to generate local report of code coverage with lcov/genhtml --- scripts/gen_html_coverage.sh | 5 +++++ travis/after_success.sh | 6 ++++++ travis/deploy_html_coverage.sh | 22 ++++++++++++++++++++++ travis/linux_gcc/before_install.sh | 5 +++-- 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100755 scripts/gen_html_coverage.sh create mode 100755 travis/deploy_html_coverage.sh diff --git a/scripts/gen_html_coverage.sh b/scripts/gen_html_coverage.sh new file mode 100755 index 00000000..95dfb1af --- /dev/null +++ b/scripts/gen_html_coverage.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +rm -rf coverage_html +lcov --directory src --capture --output-file proj.info +genhtml -o ./coverage_html --ignore-errors source --num-spaces 2 proj.info diff --git a/travis/after_success.sh b/travis/after_success.sh index 27a0c526..1b442ddb 100755 --- a/travis/after_success.sh +++ b/travis/after_success.sh @@ -10,4 +10,10 @@ if test "$TRAVIS_SECURE_ENV_VARS" = "true" -a "$TRAVIS_BRANCH" = "master"; then echo "publish website"; ./travis/add_deploy_key.sh; ./travis/deploy_website.sh $TRAVIS_BUILD_DIR/docs/build /tmp; + + # Disabled: see discussion of https://github.com/OSGeo/proj.4/pull/1035 + # if test "$BUILD_NAME" = "linux_gcc"; then + # ./scripts/gen_html_coverage.sh + # ./travis/deploy_html_coverage.sh + # fi fi diff --git a/travis/deploy_html_coverage.sh b/travis/deploy_html_coverage.sh new file mode 100755 index 00000000..78236882 --- /dev/null +++ b/travis/deploy_html_coverage.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Not used currently. See discussion of https://github.com/OSGeo/proj.4/pull/1035 + +set -eu + +mkdir proj-coverage +cd proj-coverage +git init +git config user.email "projbot@proj.bot" +git config user.name "PROJ coveragebot" +git config push.default matching +git remote add origin git@github.com:OSGeo/proj-coverage.git + +cp -r ../coverage_html . +echo "Results of coverage of PROJ test suite" > README.md +echo "See http://rawgithub.com/OSGeo/proj-coverage/master/coverage_html/index.html" >> README.md +git add -A > /dev/null +git commit -m "update with results of commit https://github.com/OSGeo/proj.4/commit/$TRAVIS_COMMIT" +git push -f origin master + +cd .. diff --git a/travis/linux_gcc/before_install.sh b/travis/linux_gcc/before_install.sh index 55516cd1..5e1ee1b8 100755 --- a/travis/linux_gcc/before_install.sh +++ b/travis/linux_gcc/before_install.sh @@ -1,11 +1,12 @@ #!/bin/bash +set -e + ./travis/before_install.sh sudo apt-get update -qq sudo apt-get install -y cppcheck - -set -e +sudo apt-get install -qq lcov scripts/cppcheck.sh -- cgit v1.2.3