mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 21:36:00 +01:00
Add gcov target for code coverage
This commit is contained in:
parent
5c93ebcb8c
commit
362e50254e
2 changed files with 10 additions and 1 deletions
8
Makefile
8
Makefile
|
@ -50,7 +50,7 @@ ${PROJECT}: ${OBJECTS}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(QUIET)rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \
|
$(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
|
$(QUIET)make -C tests clean
|
||||||
|
|
||||||
${PROJECT}-debug: ${DOBJECTS}
|
${PROJECT}-debug: ${DOBJECTS}
|
||||||
|
@ -87,6 +87,12 @@ dist: clean
|
||||||
doc: clean
|
doc: clean
|
||||||
$(QUIET)doxygen Doxyfile
|
$(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
|
install: all ${PROJECT}.pc
|
||||||
$(ECHO) installing executable file
|
$(ECHO) installing executable file
|
||||||
$(QUIET)mkdir -p ${DESTDIR}${PREFIX}/bin
|
$(QUIET)mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||||
|
|
|
@ -4,3 +4,6 @@ CHECK_INC ?= $(shell pkg-config --cflags check)
|
||||||
CHECK_LIB ?= $(shell pkg-config --libs check)
|
CHECK_LIB ?= $(shell pkg-config --libs check)
|
||||||
|
|
||||||
LIBS += ${CHECK_LIB}
|
LIBS += ${CHECK_LIB}
|
||||||
|
|
||||||
|
CFLAGS += -fprofile-arcs -ftest-coverage
|
||||||
|
LDFLAGS += -fprofile-arcs
|
||||||
|
|
Loading…
Reference in a new issue