Add support for generating coverage reports

This change adds autoconf/automake support for building all of mosh
with gcov, and generates an lcov html report. This allows seeing which
parts ofthe source tree have good test coverage, and which can be
shored up. Eventually, it would be good to hook this up to Github
Actions to be generated automatically.
This commit is contained in:
Alex Chernyakhovsky
2022-02-06 19:34:58 -05:00
committed by Alex Chernyakhovsky
parent dbe419d0e0
commit 70a02d1e83
19 changed files with 601 additions and 12 deletions
+17 -1
View File
@@ -1,8 +1,24 @@
# Work around inconsistency in AX_CODE_COVERAGE defining
# AM_DISTCHECK_CONFIGURE_FLAGS only in some branches
if !CODE_COVERAGE_ENABLED
AM_DISTCHECK_CONFIGURE_FLAGS =
endif
include $(top_srcdir)/aminclude_static.am
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = scripts src man conf
EXTRA_DIST = autogen.sh ocb-license.html README.md COPYING.iOS
BUILT_SOURCES = VERSION
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-compile-warnings=distcheck --enable-examples --enable-syslog
AM_DISTCHECK_CONFIGURE_FLAGS += --enable-compile-warnings=distcheck --enable-examples --enable-syslog
# AX_CODE_COVERAGE configuration
# Remove everything outside of this repository
CODE_COVERAGE_IGNORE_PATTERN = "/usr/include/*" "/usr/lib/*" "*/src/tests/*"
# Ensure coverage is relative to the top of the repository
CODE_COVERAGE_DIRECTORY = $(abs_top_builddir)
# non-Automake defines
CPPCHECK_FLAGS = --enable=all --template=gcc --force # -j8 disables unused function checking.