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 May 15, 2016
1 parent 72be043 commit 62585a9
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ doc/newsbeuter.1
doc/podbeuter-cfgcmds.txt
doc/podbeuter.1
doc/xhtml/*
*.gcov
*.gcno
*.gcda
13 changes: 10 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ os:
- osx
before_install:
- ./travis-get-deps.sh

language: cpp
compiler:
- gcc
Expand All @@ -11,6 +12,12 @@ script:
# a2x will run xmllint on generated files, so we have to pass the path
# to AsciiDoc's catalog files
- if [ $TRAVIS_OS_NAME = "osx" ]; then export XML_CATALOG_FILES=/usr/local/etc/xml/catalog ; fi
- make
after_script:
- "make test && cd test && ./test"
- cd ${TRAVIS_BUILD_DIR}
- make all test-rss
- cd test && ./test-rss
after_success:
- cd ${TRAVIS_BUILD_DIR}
- make distclean
- make PROFILE=1 all test-rss
- cd test && ./test-rss
- cd ${TRAVIS_BUILD_DIR} && ./submit-to-coveralls.sh
16 changes: 2 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ clean-doc:
clean: clean-newsbeuter clean-podbeuter clean-libbeuter clean-libfilter clean-doc clean-librsspp
$(RM) $(STFLHDRS) xlicense.h

distclean: clean clean-mo test-clean
distclean: clean clean-mo test-clean profclean
$(RM) core *.core core.* config.mk

doc: doc/xhtml/newsbeuter.html doc/xhtml/faq.html doc/newsbeuter.1 doc/podbeuter.1
Expand Down Expand Up @@ -240,21 +240,9 @@ test-clean:
$(RM) test/test test/test.o test/test-rss test/test-rss.o

profclean:
find . -name '*.gc*' -type f | xargs $(RM)
find . -name '*.gc*' -type f -print0 | xargs -0 $(RM) --
$(RM) app*.info

run-tests: test test-rss
cd test
./test
./test-rss

check-coverage:
./test/lcov-run-all.sh

report-coverage: check-coverage
rm -rf html
genhtml -o html apptotal.info

# miscellaneous stuff

config: config.mk
Expand Down
8 changes: 8 additions & 0 deletions submit-to-coveralls.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

if [ "$TRAVIS_OS_NAME" = "osx" ]
then
eval "$(pyenv init -)"
fi

coveralls --exclude 'test' --exclude 'usr' --gcov-options '\-lp'
15 changes: 0 additions & 15 deletions test/lcov-run-all.sh

This file was deleted.

9 changes: 9 additions & 0 deletions travis-get-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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 asciidoc
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
pip install --user cpp-coveralls
;;

"osx")
Expand All @@ -19,5 +20,13 @@ case $TRAVIS_OS_NAME in
brew install "libstfl"
brew outdated "json-c" || brew upgrade "json-c"
brew install "asciidoc"

brew install "pyenv"
eval "$(pyenv init -)"
pyenv install 2.7.6
pyenv global 2.7.6
pyenv rehash
pip install cpp-coveralls
pyenv rehash
;;
esac

0 comments on commit 62585a9

Please sign in to comment.