aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-16 18:43:35 +0100
committerMattias Andrée <maandree@kth.se>2022-02-16 18:43:35 +0100
commit2e2871b2580c32878777e620c805a94634d4b98e (patch)
treea19082ac275c2861b180848a51473b02e04fed95
parentSuppress warning (diff)
downloadlibar2-2e2871b2580c32878777e620c805a94634d4b98e.tar.gz
libar2-2e2871b2580c32878777e620c805a94634d4b98e.tar.bz2
libar2-2e2871b2580c32878777e620c805a94634d4b98e.tar.xz
Add coverage test
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile2
-rw-r--r--config-coverage-gcc.mk14
2 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c9364dc..ef329d3 100644
--- a/Makefile
+++ b/Makefile
@@ -40,6 +40,8 @@ LOBJ = $(OBJ:.o=.lo)
MAN3 = $(OBJ:.o=.3)
MAN7 = libar2.7
+SRC = $(OBJ:.o=.c) $(HDR) test.c
+
all: libar2.a libar2.$(LIBEXT) test
$(OBJ): $(HDR)
diff --git a/config-coverage-gcc.mk b/config-coverage-gcc.mk
new file mode 100644
index 0000000..a17fd55
--- /dev/null
+++ b/config-coverage-gcc.mk
@@ -0,0 +1,14 @@
+CONFIGFILE_PROPER = config.mk
+include $(CONFIGFILE_PROPER)
+
+CC = $(CC_PREFIX)gcc
+GCOV = gcov
+
+CFLAGS_COVERAGE = -g -O0 -pedantic -fprofile-arcs -ftest-coverage
+LDFLAGS_COVERAGE = -lgcov -fprofile-arcs
+
+CFLAGS = -std=c11 $(CFLAGS_COVERAGE)
+LDFLAGS = -lblake $(LDFLAGS_COVERAGE)
+
+coverage: check
+ $(GCOV) -pr $(SRC) 2>&1