Change in openvpn[master]: configure: Add --enable-code-coverage
A message that is not in the archive (sent off-list or not yet received): gerrit.1774451380000.I79b2dc4a550b1c5068a45407976b0dfc2f765b33@...2715...
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1592?usp=email
to review the following change.
Change subject: configure: Add --enable-code-coverage
......................................................................
configure: Add --enable-code-coverage
Can be used like this
./configure --enable-code-coverage
make
make check
make code-coverage-capture
---
M .gitignore
M Makefile.am
M configure.ac
M m4/ax_code_coverage.m4
M src/openvpn/Makefile.am
5 files changed, 24 insertions(+), 6 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/92/1592/1
.gitignore +3 -0
@@ -1,5 +1,7 @@ *.[oa] *.l[oa] +*.gcda +*.gcno *.dll *.exe *.exe.*
@@ -18,6 +20,7 @@ Makefile Makefile.in aclocal.m4 +aminclude_static.am autodefs.h autom4te.cache config.guess
Makefile.am +6 -0
@@ -22,6 +22,8 @@ # with this program; if not, see <https://www.gnu.org/licenses/>. # +include $(top_srcdir)/aminclude_static.am + ACLOCAL_AMFLAGS = -I m4 MAINTAINERCLEANFILES = \
@@ -89,3 +91,7 @@ doxygen: $(MAKE) -C doc/doxygen doxygen + +CODE_COVERAGE_LCOV_SHOPTS=--config-file $(srcdir)/lcovrc +clean-local: code-coverage-clean +distclean-local: code-coverage-dist-clean
configure.ac +9 -2
@@ -59,6 +59,8 @@ AC_CANONICAL_HOST AC_USE_SYSTEM_EXTENSIONS +AX_CODE_COVERAGE + AC_ARG_ENABLE( [lzo], [AS_HELP_STRING([--disable-lzo], [disable LZO compression support @<:@default=yes@:>@])],
@@ -1255,6 +1257,11 @@ ACL_CHECK_ADD_COMPILE_FLAGS([-Wno-cast-function-type]) fi +# If coverage is enabled remove -O arguments from CFLAGS +if test "$enable_code_coverage" = "yes"; then + [CFLAGS="`echo $CFLAGS | $SED -e 's/-O[s0-9]\\?//g'`"] +fi + if test "${enable_pedantic}" = "yes"; then CFLAGS="${CFLAGS} -pedantic" AC_DEFINE([PEDANTIC], [1], [Enable pedantic mode])
@@ -1374,10 +1381,10 @@ TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS} ${OPTIONAL_LIBCAPNG_LIBS}" TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LIBNL_GENL_LIBS}" -TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LZO_LIBS} ${CMOCKA_LIBS}" +TEST_LDFLAGS="${TEST_LDFLAGS} ${OPTIONAL_LZO_LIBS} ${CMOCKA_LIBS} ${CODE_COVERAGE_LIBS}" TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS} ${OPTIONAL_LIBCAPNG_CFLAGS}" TEST_CFLAGS="${TEST_CFLAGS} ${OPTIONAL_LIBNL_GENL_CFLAGS} ${OPTIONAL_LZO_CFLAGS}" -TEST_CFLAGS="${TEST_CFLAGS} -I\$(top_srcdir)/include ${CMOCKA_CFLAGS}" +TEST_CFLAGS="${TEST_CFLAGS} -I\$(top_srcdir)/include ${CMOCKA_CFLAGS} ${CODE_COVERAGE_CFLAGS}" AC_SUBST([TEST_LDFLAGS]) AC_SUBST([TEST_CFLAGS])
m4/ax_code_coverage.m4 +3 -4
@@ -232,13 +232,12 @@ AC_MSG_ERROR([Could not find genhtml from the lcov package]) ]) - AC_CHECK_LIB([gcov], [_gcov_init], [CODE_COVERAGE_LIBS="-lgcov"], [CODE_COVERAGE_LIBS=""]) - dnl Build the code coverage flags dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility CODE_COVERAGE_CPPFLAGS="-DNDEBUG" - CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + CODE_COVERAGE_CFLAGS="-O0 -g --coverage" + CODE_COVERAGE_CXXFLAGS="-O0 -g --coverage" + CODE_COVERAGE_LIBS="--coverage" AC_SUBST([CODE_COVERAGE_CPPFLAGS]) AC_SUBST([CODE_COVERAGE_CFLAGS])
src/openvpn/Makefile.am +3 -0
@@ -31,9 +31,12 @@ $(OPTIONAL_SYSTEMD_CFLAGS) \ $(OPTIONAL_PKCS11_HELPER_CFLAGS) \ $(OPTIONAL_INOTIFY_CFLAGS) \ + $(CODE_COVERAGE_CFLAGS) \ -DPLUGIN_LIBDIR=\"${plugindir}\" \ -DDEFAULT_DNS_UPDOWN=\"${scriptdir}/dns-updown\" +AM_LIBS = $(CODE_COVERAGE_LIBS) + if WIN32 # we want unicode entry point but not the macro AM_CFLAGS += -municode -UUNICODE
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1592?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I79b2dc4a550b1c5068a45407976b0dfc2f765b33
Gerrit-Change-Number: 1592
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>