This repository was archived by the owner on Oct 13, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +16
-0
lines changed
Expand file tree Collapse file tree 5 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 1+ COVERAGE_CFLAGS=""
2+ COVERAGE_LDFLAGS=""
3+
4+ if test "$enable_coverage" = "yes"; then
5+ COVERAGE_CFLAGS="--coverage -g"
6+ COVERAGE_LDFLAGS="-lgcov"
7+ fi
8+
9+ AC_SUBST ( COVERAGE_CFLAGS )
10+ AC_SUBST ( COVERAGE_LDFLAGS )
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ m4_include([build/autotools/CheckAtomics.m4])
4141m4_include ( [ build/autotools/AutoHarden.m4] )
4242m4_include ( [ build/autotools/MaintainerFlags.m4] )
4343m4_include ( [ build/autotools/Optimizations.m4] )
44+ m4_include ( [ build/autotools/Coverage.m4] )
4445m4_include ( [ build/autotools/LDVersionScript.m4] )
4546
4647# We would put AM_INIT_AUTOMAKE into SetupAutomake.m4, but seems to cause autoconf errors.
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ libbson_1_0_la_LIBADD = \
77 -lm
88libbson_1_0_la_LDFLAGS = \
99 $(OPTIMIZE_LDFLAGS ) \
10+ $(COVERAGE_LDFLAGS ) \
1011 $(BSON_LT_LDFLAGS ) \
1112 -no-undefined \
1213 -rpath $(libdir )
Original file line number Diff line number Diff line change 6161libbson_la_CFLAGS = \
6262 $(MAINTAINER_CFLAGS ) \
6363 $(OPTIMIZE_CFLAGS ) \
64+ $(COVERAGE_CFLAGS ) \
6465 $(PTHREAD_CFLAGS )
6566
6667libbson_la_SOURCES = \
Original file line number Diff line number Diff line change @@ -28,9 +28,12 @@ test_libbson_CPPFLAGS = \
2828 -I$(top_srcdir ) /src/bson \
2929 -I$(top_builddir ) /src/bson \
3030 $(PTHREAD_CFLAGS ) \
31+ $(COVERAGE_CFLAGS ) \
3132 -DBSON_COMPILATION \
3233 -DBINARY_DIR="\"$(top_srcdir ) /tests/binary\""
3334
35+ test_libbson_LDFLAGS = $(COVERAGE_LDFLAGS )
36+
3437test_libbson_LDADD = \
3538 $(PTHREAD_LIBS ) \
3639 libbson-1.0.la \
You can’t perform that action at this time.
0 commit comments