Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

Commit

Permalink
Report coverage to Coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
Minoru committed Jan 26, 2016
1 parent 7389c1c commit 6ab0afe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ os:
install:
- cd ${TRAVIS_BUILD_DIR}
- ./travis-get-deps.sh
- gem install coveralls-lcov
- g++ --version
- clang --version
- lcov --version

language: cpp
compiler:
- gcc
Expand All @@ -14,3 +19,6 @@ script:
- cd ${TRAVIS_BUILD_DIR}
- make all test-rss
- cd test && ./test-rss
- cd ${TRAVIS_BUILD_DIR}
- ./test/lcov-run-all.sh
- coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info
12 changes: 3 additions & 9 deletions test/lcov-run-all.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#!/bin/sh

APPBASE_INFO=appbase.info
APPTEST_INFO=apptest.info
APPTOTAL_INFO=apptotal.info

make distclean
rm -rf $APPBASE_INFO $APPTEST_INFO html
rm -rf html coverage.info
make -j 5 PROFILE=1 all test-rss
lcov -c -i -b . -d . -o $APPBASE_INFO --compat split_crc=on
export OFFLINE=1
( cd test && ./test-rss )
lcov -c -b . -d . -o $APPTEST_INFO --compat split_crc=on
lcov -b . -d . -a $APPBASE_INFO -a $APPTEST_INFO -o $APPTOTAL_INFO
lcov --remove $APPTOTAL_INFO 'test/*' '/usr/*' --output-file $APPTOTAL_INFO
lcov -c -b . -d . -o coverage.info
lcov --remove coverage.info 'test/*' '/usr/*' --output-file coverage.info
4 changes: 4 additions & 0 deletions travis-get-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ case $TRAVIS_OS_NAME in
sudo apt-get install -qq libsqlite3-dev libcurl4-openssl-dev libxml2-dev libstfl-dev libjson-c-dev libncursesw5-dev bc gcc-4.9 g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 50
wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.12.orig.tar.gz \
&& tar xf lcov_1.12.orig.tar.gz \
&& sudo make -C lcov-1.12/ install
;;

"osx")
Expand All @@ -18,5 +21,6 @@ case $TRAVIS_OS_NAME in
brew outdated "libxml2" || brew upgrade "libxml2"
brew install "libstfl"
brew outdated "json-c" || brew upgrade "json-c"
brew install "lcov"
;;
esac

0 comments on commit 6ab0afe

Please sign in to comment.