Commit 362e5025 authored by Moritz Lipp's avatar Moritz Lipp
Browse files

Add gcov target for code coverage

parent 5c93ebcb
......@@ -50,7 +50,7 @@ ${PROJECT}: ${OBJECTS}
$(QUIET)rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \
${DOBJECTS} ${PROJECT}-debug .depend ${PROJECT}.pc doc
${DOBJECTS} ${PROJECT}-debug .depend ${PROJECT}.pc doc *gcda *gcno $(PROJECT).info gcov
$(QUIET)make -C tests clean
......@@ -87,6 +87,12 @@ dist: clean
doc: clean
$(QUIET)doxygen Doxyfile
gcov: clean
$(QUIET)CFLAGS+="-fprofile-arcs -ftest-coverage" LDFLAGS+="-fprofile-arcs" $(MAKE) $(PROJECT)
$(QUIET)make -C tests
$(QUIET)lcov --directory . --capture --output-file $(PROJECT).info
$(QUIET)genhtml --output-directory gcov $(PROJECT).info
install: all ${PROJECT}.pc
$(ECHO) installing executable file
$(QUIET)mkdir -p ${DESTDIR}${PREFIX}/bin
......@@ -4,3 +4,6 @@ CHECK_INC ?= $(shell pkg-config --cflags check)
CHECK_LIB ?= $(shell pkg-config --libs check)
CFLAGS += -fprofile-arcs -ftest-coverage
LDFLAGS += -fprofile-arcs
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment