From 6b1b5443fb8f07c52d1c2df2843592f79742156c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 19 Jul 2022 20:03:46 +0200 Subject: Add coverage test (requires `make check` which has not been implemented yet) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 1 + config-coverage-gcc.mk | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 config-coverage-gcc.mk diff --git a/Makefile b/Makefile index 11fa042..17ee3d3 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,7 @@ HDR =\ common.h LOBJ = $(OBJ:.o=.lo) +SRC = $(OBJ:.o=.c) all: libparsepcf.a libparsepcf.$(LIBEXT) demo diff --git a/config-coverage-gcc.mk b/config-coverage-gcc.mk new file mode 100644 index 0000000..18de147 --- /dev/null +++ b/config-coverage-gcc.mk @@ -0,0 +1,11 @@ +CONFIGFILE_PROPER = config.mk +include $(CONFIGFILE_PROPER) + +CC = $(CC_PREFIX)gcc -std=c99 +GCOV = gcov + +CFLAGS = -g -O0 -pedantic -fprofile-arcs -ftest-coverage +LDFLAGS = -lgcov -fprofile-arcs + +coverage: check + $(GCOV) -pr $(SRC) 2>&1 -- cgit v1.2.3-70-g09d2