From: Howard Chu Date: Thu, 26 Jun 2014 12:19:47 +0000 (-0700) Subject: Setup for gcov/coverage testing X-Git-Tag: OPENLDAP_REL_ENG_2_4_40~127^2~23 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=277526d0f00489637798f84b5cf4e8d65a1690ca;p=openldap Setup for gcov/coverage testing --- diff --git a/libraries/liblmdb/.gitignore b/libraries/liblmdb/.gitignore index 0b4b1cba67..f3277afe42 100644 --- a/libraries/liblmdb/.gitignore +++ b/libraries/liblmdb/.gitignore @@ -10,6 +10,9 @@ mdb_stat *.bak *.orig *.rej +*.gcov +*.gcda +*.gcno core core.* valgrind.* diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile index b65c9b9a8b..bb0b1e8c72 100644 --- a/libraries/liblmdb/Makefile +++ b/libraries/liblmdb/Makefile @@ -76,3 +76,18 @@ midl.o: midl.c midl.h %.o: %.c lmdb.h $(CC) $(CFLAGS) $(CPPFLAGS) -c $< + +coverage: xmtest + -rm -rf testdb; mkdir testdb + ./xmtest + gcov xmdb.c + gcov xmidl.c + +xmtest: mtest.o xmdb.o xmidl.o + gcc -o xmtest mtest.o xmdb.o xmidl.o -pthread -fprofile-arcs -ftest-coverage + +xmdb.o: mdb.c lmdb.h midl.h + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -O0 -fprofile-arcs -ftest-coverage -c mdb.c -o $@ + +xmidl.o: midl.c midl.h + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -O0 -fprofile-arcs -ftest-coverage -c midl.c -o $@