diff options
author | Alex Chernyakhovsky <achernya@google.com> | 2022-02-06 19:34:58 -0500 |
---|---|---|
committer | Alex Chernyakhovsky <achernya@mit.edu> | 2022-05-30 19:38:10 -0400 |
commit | 70a02d1e8384050770bd028a28fd48a4b1770ad0 (patch) | |
tree | 2ae9e64c5d9351aeaca7c50a128b5c82ab355cb9 /Makefile.am | |
parent | dbe419d0e069df3fedc212d456449f64d0280c76 (diff) |
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.
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 100cbef..5ddbab7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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. |