Skip to content

Commit

Permalink
Use Coveralls for code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Jun 25, 2020
1 parent 300f5d0 commit 0b0a996
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
28 changes: 12 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ matrix:
- os: linux
dist: bionic
sudo: false
env:
- COVERAGE=true
- CONFARGS="--enable-gcov --with-llvm=/usr/bin/llvm-config"
- os: osx

addons:
Expand All @@ -18,37 +15,36 @@ addons:
- llvm-dev
- check
- lcov
- python3-pip
- python3-setuptools

before_install:
- >-
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
HOMEBREW_NO_AUTO_UPDATE=1 brew install llvm check
export PATH=$PATH:$(brew --prefix llvm)/bin
fi
- python3 -mpip install --user cpp-coveralls

install:
- llvm-config --version
- llvm-config --components

script:
- ./autogen.sh
- mkdir build && cd build
- ../configure --enable-vhpi $CONFARGS
- if [ -n "$COVERAGE" ]; then make cov-reset; fi
- >-
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
./configure --enable-vhpi
else
./configure --enable-vhpi --enable-gcov --with-llvm=/usr/bin/llvm-config
fi
- make check

after_success:
- git config user.name "Travis CI"
- git config user.email "$COMMIT_AUTHOR_EMAIL"
- >-
if [ -n "$COVERAGE" -a "$TRAVIS_BRANCH" = "master" ]; then
make cov-report
git clone https://$GITHUB_TOKEN:x-oauth-basic@github.com/nickg/nickg.github.io.git
cp -ra coverage nickg.github.io
cd nickg.github.io
git add --all
git commit -a -m "Travis CI coverage report"
git push origin master
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
coveralls --gcov-options '\-lp' --exclude thirdparty \
--exclude build --exclude config.h
fi
notifications:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Build Status](https://travis-ci.org/nickg/nvc.svg?branch=master)](https://travis-ci.org/nickg/nvc)
[![Windows status](https://ci.appveyor.com/api/projects/status/7eo8mjn98misbhva/branch/master?svg=true)](https://ci.appveyor.com/project/nickg72247/nvc/branch/master)
[![Coverage Status](https://coveralls.io/repos/github/nickg/nvc/badge.svg?branch=coveralls)](https://coveralls.io/github/nickg/nvc?branch=coveralls)

NVC is a GPLv3 VHDL compiler and simulator aiming for IEEE 1076-2002 compliance. See
these [blog posts](http://www.doof.me.uk/category/vhdl/) for background
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ AC_ARG_ENABLE([gcov],
[enable_gcov=$enableval],
[])
if test x$enable_gcov = xyes ; then
COV_CFLAGS="--coverage --no-inline -Og"
COV_CFLAGS="--coverage -fno-inline -Og"
COV_LDFLAGS="--coverage"
AC_MSG_WARN([code coverage with gcov is for use in development only])
fi
Expand Down

0 comments on commit 0b0a996

Please sign in to comment.