Add valgrind to travis configuration and check for leaks
This commit is contained in:
parent
b9f347d80a
commit
1d39aa348c
@ -12,13 +12,14 @@ addons:
|
||||
- libcairo2-dev
|
||||
- libnotify-dev
|
||||
- libgtk-3-dev
|
||||
- valgrind
|
||||
dist: trusty
|
||||
sudo: false
|
||||
language: c
|
||||
before_install:
|
||||
- pip install --user cpp-coveralls
|
||||
script:
|
||||
- CFLAGS="-fprofile-arcs -ftest-coverage -Werror" make all dunstify test
|
||||
- CFLAGS="-fprofile-arcs -ftest-coverage -Werror" make all dunstify test-valgrind
|
||||
- coveralls
|
||||
compiler:
|
||||
- gcc
|
||||
|
10
.valgrind.suppressions
Normal file
10
.valgrind.suppressions
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
xdgBaseDir_leak
|
||||
# see https://github.com/devnev/libxdg-basedir/pull/6
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:xdgInitHandle
|
||||
...
|
||||
fun:main
|
||||
}
|
12
Makefile
12
Makefile
@ -44,10 +44,20 @@ dunst: ${OBJ} main.o
|
||||
dunstify: dunstify.o
|
||||
${CC} ${CFLAGS} -o $@ dunstify.o ${LDFLAGS}
|
||||
|
||||
.PHONY: test
|
||||
.PHONY: test test-valgrind
|
||||
test: test/test
|
||||
cd test && ./test
|
||||
|
||||
test-valgrind: test/test
|
||||
cd ./test \
|
||||
&& valgrind \
|
||||
--suppressions=../.valgrind.suppressions \
|
||||
--leak-check=full \
|
||||
--show-leak-kinds=definite \
|
||||
--errors-for-leak-kinds=definite \
|
||||
--error-exitcode=123 \
|
||||
./test
|
||||
|
||||
test/test: ${OBJ} ${TEST_OBJ}
|
||||
${CC} ${CFLAGS} -o $@ ${TEST_OBJ} ${OBJ} ${LDFLAGS}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user