Skip to content

Commit

Permalink
Add coverage script to Travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Feb 3, 2015
1 parent 57ab562 commit f56df2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
language: c
script: make clean && make && make test && make clean
script: make clean && make && make test && make clean && make coverage
compiler:
- clang
- gcc
before_install:
- sudo pip install cpp-coveralls
after_success:
- coveralls --gcov-options '\-lp'
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
CC=gcc
CFLAGS=-Wall -Wextra -fPIC -O2
CC?=gcc
CFLAGS+=-Wall -Wextra -fPIC -O2
PREFIX=`[ -e /usr/local/bin ] && echo '/usr/local' || echo '/usr'`

all: rlimitr.so rlimitr

clean:
rm -f rlimitr.so rlimitr
rm -f rlimitr.so rlimitr *.gcda *.gcno *.gcov

rlimitr.so: rlimitr.c
$(CC) $(CFLAGS) -shared -DRLIMITR_LIBRARY_ONLY -o rlimitr.so rlimitr.c
Expand All @@ -16,5 +16,8 @@ rlimitr: rlimitr.c
install: rlimitr
cp rlimitr $(PREFIX)/bin/rlimitr

test: rlimitr rlimitr.so
test: rlimitr.so rlimitr
./test.sh

coverage: clean
CFLAGS="--coverage" CC=gcc make test

0 comments on commit f56df2c

Please sign in to comment.