feat(cover): gcov, gcovr

This commit is contained in:
2024-09-26 12:00:23 +03:00
parent 5f2cffdd82
commit 5396abe202
2 changed files with 16 additions and 2 deletions

1
.gitignore vendored
View File

@ -43,6 +43,7 @@ bin
obj
lib
doc
cov
# IDE
.vscode

View File

@ -5,7 +5,7 @@ DEBUG ?= false
USRDIR ?= /usr
.PHONY: build i install uni uninstall\
tools library tests docs clean
tools library tests docs cov clean
LIB = basen
OBJS =\
@ -59,6 +59,8 @@ DIRS =\
${OBJDIR}\
${OBJDIR}/hash\
${LIBDIR}\
doc\
cov
build: library tools
@ -80,8 +82,19 @@ uninstall:
docs:
doxygen Doxyfile
cover: ${DIRS} ${patsubst %, ${BINDIR}/%${-g}-cov, ${TESTS}}
${patsubst %, ./${BINDIR}/%${-g}-cov;, ${TESTS}}
gcovr --html-nested cov/index.html
gcovr
${OBJDIR}/%${-g}-cov.o: ${SRCDIR}/%.cpp ${INCDIR}/${LIB}/%.hpp
${CC} -o $@ -c $< -I${INCDIR} ${-l} ${CFLAGS} --coverage
${BINDIR}/%${-g}-cov: ${TESTDIR}/%.cpp ${patsubst %, ${OBJDIR}/%${-g}-cov.o, ${OBJS}}
${CC} -o $@ $^ -I${INCDIR} ${-l} -lgtest ${CFLAGS} --coverage
clean:
rm -rf ${OBJDIR}/* ${LIBDIR}/* ${BINDIR}/*
rm -rf ${DIRS}
ifneq (${OBJS},)