Skip to content

Commit

Permalink
Use lcov/genhtml to generate pretty code coverage, and upload it to h…
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jun 7, 2018
1 parent c1a7098 commit fac1bd2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
5 changes: 5 additions & 0 deletions scripts/gen_html_coverage.sh
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions travis/after_success.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ 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;

if test "$BUILD_NAME" = "linux_gcc"; then
./scripts/gen_html_coverage.sh
./travis/deploy_html_coverage.sh
fi
fi
20 changes: 20 additions & 0 deletions travis/deploy_html_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

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 ..
5 changes: 3 additions & 2 deletions travis/linux_gcc/before_install.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit fac1bd2

Please sign in to comment.