Commit 66f7f76a authored by Andrei Pavel's avatar Andrei Pavel

Code coverage reporting minor changes

parent 325bfcd1
...@@ -10,6 +10,7 @@ GENHTML=@GENHTML@ ...@@ -10,6 +10,7 @@ GENHTML=@GENHTML@
DISTCHECK_GTEST_CONFIGURE_FLAG=@DISTCHECK_GTEST_CONFIGURE_FLAG@ DISTCHECK_GTEST_CONFIGURE_FLAG=@DISTCHECK_GTEST_CONFIGURE_FLAG@
DISTCHECK_CRYPTO_CONFIGURE_FLAG=@DISTCHECK_CRYPTO_CONFIGURE_FLAG@ DISTCHECK_CRYPTO_CONFIGURE_FLAG=@DISTCHECK_CRYPTO_CONFIGURE_FLAG@
DISTCHECK_BOOST_CONFIGURE_FLAG=@DISTCHECK_BOOST_CONFIGURE_FLAG@ DISTCHECK_BOOST_CONFIGURE_FLAG=@DISTCHECK_BOOST_CONFIGURE_FLAG@
OVERALL_COVERAGE_DIR=$(abs_top_builddir)/coverage-cpp-html
DISTCLEANFILES = config.report DISTCLEANFILES = config.report
...@@ -48,13 +49,14 @@ endif ...@@ -48,13 +49,14 @@ endif
clean-cpp-coverage: clean-cpp-coverage:
@if [ $(USE_LCOV) = yes ] ; then \ @if [ $(USE_LCOV) = yes ] ; then \
$(LCOV) --directory . --zerocounters; \ $(LCOV) --directory . --zerocounters; \
rm -rf $(abs_top_srcdir)/coverage-cpp-html/; \ rm -rf $(OVERALL_COVERAGE_DIR); \
else \ else \
echo "C++ code coverage not enabled at configuration time." ; \ echo "C++ code coverage not enabled at configuration time." ; \
echo "Use: ./configure --with-lcov" ; \ echo "Use: ./configure --with-lcov" ; \
fi fi
perform-coverage: check perform-coverage:
find -mindepth 2 -maxdepth 2 src -type d | xargs -I{} bash -c "cd {}; make check || true"
report-cpp-coverage: report-cpp-coverage:
if HAVE_BOTAN if HAVE_BOTAN
...@@ -68,28 +70,28 @@ else ...@@ -68,28 +70,28 @@ else
OPENSSL_PATH= OPENSSL_PATH=
endif endif
@if [ $(USE_LCOV) = yes ] ; then \ @if [ $(USE_LCOV) = yes ] ; then \
$(LCOV) --capture --directory . --output-file all.info ; \ $(LCOV) --capture --directory . \
--ignore-errors gcov,source,graph \
--output-file all.info; \
$(LCOV) --remove all.info \ $(LCOV) --remove all.info \
c++/4.4\*/\* \ c++/* \
c++/4.4\*/backward/\* \
c++/4.4\*/bits/\* \
c++/4.4\*/ext/\* \
c++/4.4\*/\*-\*/bits/\* \
boost/\* \ boost/\* \
ext/coroutine/\* \ ext/coroutine/\* \
gtest/\* \ gtest/\* \
include/\* \ include/\* \
lib/\eval/\* \
log4cplus/\* \ log4cplus/\* \
unittests/\* \ unittests/\* \
\*_unittests.cc \ tests/\* \
\*_unittest.cc \ testutils/\* \
\*_unittests.h \ valgrind/\* \
$(BOTAN_PATH) \ $(BOTAN_PATH) \
$(OPENSSL_PATH) \ $(OPENSSL_PATH) \
--output report.info ; \ --ignore-errors gcov,source,graph \
sed -e "s|$(abs_top_srcdir)|$(abs_top_builddir)|g" < report.info > report.info.2 ; \ --output report.info; \
$(GENHTML) --legend -o $(abs_top_builddir)/coverage-cpp-html report.info.2 ; \ sed --in-place --expression "s|$(abs_top_srcdir)|$(abs_top_builddir)|g" report.info; \
echo "Generated C++ Code Coverage report in HTML at $(abs_top_builddir)/coverage-cpp-html" ; \ "$(GENHTML)" --frames --show-details --title 'Kea code coverage report' --legend --function-coverage --ignore-errors source --demangle-cpp --output "$(OVERALL_COVERAGE_DIR)" report.info; \
printf "Generated C++ code coverage report in HTML at %s.\n" "$(OVERALL_COVERAGE_DIR)"; \
else \ else \
echo "C++ code coverage not enabled at configuration time." ; \ echo "C++ code coverage not enabled at configuration time." ; \
echo "Use: ./configure --with-lcov" ; \ echo "Use: ./configure --with-lcov" ; \
......
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