Commit 6df753c5 authored by Luca Boccassi's avatar Luca Boccassi

Problem: no code coverage integration

Solution: import ax_code_coverage.m4 from autoconf-archive and use it
in configure.ac and Makefile.am in order to provide a make
check-code-coverage target behind a --enable-code-coverage configure
flag, that can be used to generate a gcov/lcov code coverage report.
Depends on having gcov and lcov installed.
parent 22cb66d8
...@@ -273,9 +273,10 @@ endif ...@@ -273,9 +273,10 @@ endif
endif endif
endif endif
src_libzmq_la_CPPFLAGS = src_libzmq_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
src_libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@ src_libzmq_la_CFLAGS = $(CODE_COVERAGE_CFLAGS)
src_libzmq_la_LIBADD = src_libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@ $(CODE_COVERAGE_CXXFLAGS)
src_libzmq_la_LIBADD = $(CODE_COVERAGE_LDFLAGS)
if USE_LIBSODIUM if USE_LIBSODIUM
src_libzmq_la_CPPFLAGS += ${sodium_CFLAGS} src_libzmq_la_CPPFLAGS += ${sodium_CFLAGS}
...@@ -760,6 +761,8 @@ MAINTAINERCLEANFILES = \ ...@@ -760,6 +761,8 @@ MAINTAINERCLEANFILES = \
$(srcdir)/configure \ $(srcdir)/configure \
`find "$(srcdir)" -type f -name Makefile.in -print` `find "$(srcdir)" -type f -name Makefile.in -print`
@CODE_COVERAGE_RULES@
dist-hook: dist-hook:
-rm $(distdir)/src/platform.hpp -rm $(distdir)/src/platform.hpp
@if test -d "$(srcdir)/.git"; \ @if test -d "$(srcdir)/.git"; \
......
...@@ -16,6 +16,7 @@ AM_INIT_AUTOMAKE(foreign subdir-objects tar-ustar dist-zip) ...@@ -16,6 +16,7 @@ AM_INIT_AUTOMAKE(foreign subdir-objects tar-ustar dist-zip)
m4_pattern_allow([AC_PROG_CC_C99]) m4_pattern_allow([AC_PROG_CC_C99])
m4_include([m4/ax_check_compile_flag.m4]) m4_include([m4/ax_check_compile_flag.m4])
m4_include([m4/ax_cxx_compile_stdcxx_11.m4]) m4_include([m4/ax_cxx_compile_stdcxx_11.m4])
m4_include([m4/ax_code_coverage.m4])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# This lets us use PACKAGE_VERSION in Makefiles # This lets us use PACKAGE_VERSION in Makefiles
...@@ -50,6 +51,7 @@ AC_PROG_CC ...@@ -50,6 +51,7 @@ AC_PROG_CC
AX_CHECK_COMPILE_FLAG([-std=gnu11], [CFLAGS+=" -std=gnu11"], [AC_PROG_CC_C99]) AX_CHECK_COMPILE_FLAG([-std=gnu11], [CFLAGS+=" -std=gnu11"], [AC_PROG_CC_C99])
AC_PROG_CXX AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_11([ext], [optional]) AX_CXX_COMPILE_STDCXX_11([ext], [optional])
AX_CODE_COVERAGE
AM_PROG_CC_C_O AM_PROG_CC_C_O
AC_PROG_SED AC_PROG_SED
AC_PROG_AWK AC_PROG_AWK
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment