aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-19 20:03:45 +0200
committerMattias Andrée <maandree@kth.se>2022-07-19 20:03:45 +0200
commitc1f14cc95d2cd2aa2e3dabb47af78306bf891f4f (patch)
treec65301807a7c829101e00fe0e358c12e0c3556ae
parentInstall man page symlinks (diff)
downloadlibparsepsf-c1f14cc95d2cd2aa2e3dabb47af78306bf891f4f.tar.gz
libparsepsf-c1f14cc95d2cd2aa2e3dabb47af78306bf891f4f.tar.bz2
libparsepsf-c1f14cc95d2cd2aa2e3dabb47af78306bf891f4f.tar.xz
Add coverage test (requires `make check` which has not been implemented yet)1.0.3
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--.gitignore11
-rw-r--r--Makefile4
-rw-r--r--config-coverage-gcc.mk11
3 files changed, 23 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index b9f3a77..9e13a6f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,7 +2,14 @@
*~
*.o
*.a
-*.so
-*.su
*.lo
+*.su
+*.so
+*.so.*
+*.dll
+*.dylib
+*.gch
+*.gcov
+*.gcno
+*.gcda
/demo
diff --git a/Makefile b/Makefile
index 266576b..29ee5f6 100644
--- a/Makefile
+++ b/Makefile
@@ -36,6 +36,7 @@ MAN7 =\
libparsepsf.7
LOBJ = $(OBJ:.o=.lo)
+SRC = $(OBJ:.o=.c)
all: libparsepsf.a libparsepsf.$(LIBEXT) demo
@@ -86,7 +87,8 @@ uninstall:
-cd -- "$(DESTDIR)$(MANPREFIX)/man7" && rm -f -- $(MAN7)
clean:
- -rm -f -- *.o *.lo *.su *.a *.so *.so.* demo
+ -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib
+ -rm -f -- *.gch *.gcov *.gcno *.gcda *.$(LIBEXT) demo
.SUFFIXES:
.SUFFIXES: .lo .o .c
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