1*eda14cbcSMatt Macy# =========================================================================== 2*eda14cbcSMatt Macy# https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html 3*eda14cbcSMatt Macy# =========================================================================== 4*eda14cbcSMatt Macy# 5*eda14cbcSMatt Macy# SYNOPSIS 6*eda14cbcSMatt Macy# 7*eda14cbcSMatt Macy# AX_CODE_COVERAGE() 8*eda14cbcSMatt Macy# 9*eda14cbcSMatt Macy# DESCRIPTION 10*eda14cbcSMatt Macy# 11*eda14cbcSMatt Macy# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS, 12*eda14cbcSMatt Macy# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included 13*eda14cbcSMatt Macy# in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every 14*eda14cbcSMatt Macy# build target (program or library) which should be built with code 15*eda14cbcSMatt Macy# coverage support. Also defines CODE_COVERAGE_RULES which should be 16*eda14cbcSMatt Macy# substituted in your Makefile; and $enable_code_coverage which can be 17*eda14cbcSMatt Macy# used in subsequent configure output. CODE_COVERAGE_ENABLED is defined 18*eda14cbcSMatt Macy# and substituted, and corresponds to the value of the 19*eda14cbcSMatt Macy# --enable-code-coverage option, which defaults to being disabled. 20*eda14cbcSMatt Macy# 21*eda14cbcSMatt Macy# Test also for gcov program and create GCOV variable that could be 22*eda14cbcSMatt Macy# substituted. 23*eda14cbcSMatt Macy# 24*eda14cbcSMatt Macy# Note that all optimization flags in CFLAGS must be disabled when code 25*eda14cbcSMatt Macy# coverage is enabled. 26*eda14cbcSMatt Macy# 27*eda14cbcSMatt Macy# Usage example: 28*eda14cbcSMatt Macy# 29*eda14cbcSMatt Macy# configure.ac: 30*eda14cbcSMatt Macy# 31*eda14cbcSMatt Macy# AX_CODE_COVERAGE 32*eda14cbcSMatt Macy# 33*eda14cbcSMatt Macy# Makefile.am: 34*eda14cbcSMatt Macy# 35*eda14cbcSMatt Macy# @CODE_COVERAGE_RULES@ 36*eda14cbcSMatt Macy# my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ... 37*eda14cbcSMatt Macy# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ... 38*eda14cbcSMatt Macy# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... 39*eda14cbcSMatt Macy# my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ... 40*eda14cbcSMatt Macy# 41*eda14cbcSMatt Macy# This results in a "check-code-coverage" rule being added to any 42*eda14cbcSMatt Macy# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module 43*eda14cbcSMatt Macy# has been configured with --enable-code-coverage). Running `make 44*eda14cbcSMatt Macy# check-code-coverage` in that directory will run the module's test suite 45*eda14cbcSMatt Macy# (`make check`) and build a code coverage report detailing the code which 46*eda14cbcSMatt Macy# was touched, then print the URI for the report. 47*eda14cbcSMatt Macy# 48*eda14cbcSMatt Macy# In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined 49*eda14cbcSMatt Macy# instead of CODE_COVERAGE_LIBS. They are both still defined, but use of 50*eda14cbcSMatt Macy# CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is 51*eda14cbcSMatt Macy# deprecated. They have the same value. 52*eda14cbcSMatt Macy# 53*eda14cbcSMatt Macy# This code was derived from Makefile.decl in GLib, originally licensed 54*eda14cbcSMatt Macy# under LGPLv2.1+. 55*eda14cbcSMatt Macy# 56*eda14cbcSMatt Macy# LICENSE 57*eda14cbcSMatt Macy# 58*eda14cbcSMatt Macy# Copyright (c) 2012, 2016 Philip Withnall 59*eda14cbcSMatt Macy# Copyright (c) 2012 Xan Lopez 60*eda14cbcSMatt Macy# Copyright (c) 2012 Christian Persch 61*eda14cbcSMatt Macy# Copyright (c) 2012 Paolo Borelli 62*eda14cbcSMatt Macy# Copyright (c) 2012 Dan Winship 63*eda14cbcSMatt Macy# Copyright (c) 2015 Bastien ROUCARIES 64*eda14cbcSMatt Macy# 65*eda14cbcSMatt Macy# This library is free software; you can redistribute it and/or modify it 66*eda14cbcSMatt Macy# under the terms of the GNU Lesser General Public License as published by 67*eda14cbcSMatt Macy# the Free Software Foundation; either version 2.1 of the License, or (at 68*eda14cbcSMatt Macy# your option) any later version. 69*eda14cbcSMatt Macy# 70*eda14cbcSMatt Macy# This library is distributed in the hope that it will be useful, but 71*eda14cbcSMatt Macy# WITHOUT ANY WARRANTY; without even the implied warranty of 72*eda14cbcSMatt Macy# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 73*eda14cbcSMatt Macy# General Public License for more details. 74*eda14cbcSMatt Macy# 75*eda14cbcSMatt Macy# You should have received a copy of the GNU Lesser General Public License 76*eda14cbcSMatt Macy# along with this program. If not, see <https://www.gnu.org/licenses/>. 77*eda14cbcSMatt Macy 78*eda14cbcSMatt Macy#serial 25 79*eda14cbcSMatt Macy 80*eda14cbcSMatt MacyAC_DEFUN([AX_CODE_COVERAGE],[ 81*eda14cbcSMatt Macy dnl Check for --enable-code-coverage 82*eda14cbcSMatt Macy AC_REQUIRE([AC_PROG_SED]) 83*eda14cbcSMatt Macy 84*eda14cbcSMatt Macy # allow to override gcov location 85*eda14cbcSMatt Macy AC_ARG_WITH([gcov], 86*eda14cbcSMatt Macy [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])], 87*eda14cbcSMatt Macy [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov], 88*eda14cbcSMatt Macy [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov]) 89*eda14cbcSMatt Macy 90*eda14cbcSMatt Macy AC_MSG_CHECKING([whether to build with code coverage support]) 91*eda14cbcSMatt Macy AC_ARG_ENABLE([code-coverage], 92*eda14cbcSMatt Macy AS_HELP_STRING([--enable-code-coverage], 93*eda14cbcSMatt Macy [Whether to enable code coverage support]),, 94*eda14cbcSMatt Macy enable_code_coverage=no) 95*eda14cbcSMatt Macy 96*eda14cbcSMatt Macy AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes]) 97*eda14cbcSMatt Macy AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage]) 98*eda14cbcSMatt Macy AC_MSG_RESULT($enable_code_coverage) 99*eda14cbcSMatt Macy 100*eda14cbcSMatt Macy AS_IF([ test "$enable_code_coverage" = "yes" ], [ 101*eda14cbcSMatt Macy # check for gcov 102*eda14cbcSMatt Macy AC_CHECK_TOOL([GCOV], 103*eda14cbcSMatt Macy [$_AX_CODE_COVERAGE_GCOV_PROG_WITH], 104*eda14cbcSMatt Macy [:]) 105*eda14cbcSMatt Macy AS_IF([test "X$GCOV" = "X:"], 106*eda14cbcSMatt Macy [AC_MSG_ERROR([gcov is needed to do coverage])]) 107*eda14cbcSMatt Macy AC_SUBST([GCOV]) 108*eda14cbcSMatt Macy 109*eda14cbcSMatt Macy dnl Check if gcc is being used 110*eda14cbcSMatt Macy AS_IF([ test "$GCC" = "no" ], [ 111*eda14cbcSMatt Macy AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage]) 112*eda14cbcSMatt Macy ]) 113*eda14cbcSMatt Macy 114*eda14cbcSMatt Macy AC_CHECK_PROG([LCOV], [lcov], [lcov]) 115*eda14cbcSMatt Macy AC_CHECK_PROG([GENHTML], [genhtml], [genhtml]) 116*eda14cbcSMatt Macy 117*eda14cbcSMatt Macy AS_IF([ test -z "$LCOV" ], [ 118*eda14cbcSMatt Macy AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed]) 119*eda14cbcSMatt Macy ]) 120*eda14cbcSMatt Macy 121*eda14cbcSMatt Macy AS_IF([ test -z "$GENHTML" ], [ 122*eda14cbcSMatt Macy AC_MSG_ERROR([Could not find genhtml from the lcov package]) 123*eda14cbcSMatt Macy ]) 124*eda14cbcSMatt Macy 125*eda14cbcSMatt Macy dnl Build the code coverage flags 126*eda14cbcSMatt Macy dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility 127*eda14cbcSMatt Macy CODE_COVERAGE_CPPFLAGS="" 128*eda14cbcSMatt Macy CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" 129*eda14cbcSMatt Macy CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" 130*eda14cbcSMatt Macy CODE_COVERAGE_LIBS="-lgcov" 131*eda14cbcSMatt Macy CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" 132*eda14cbcSMatt Macy 133*eda14cbcSMatt Macy AC_SUBST([CODE_COVERAGE_CPPFLAGS]) 134*eda14cbcSMatt Macy AC_SUBST([CODE_COVERAGE_CFLAGS]) 135*eda14cbcSMatt Macy AC_SUBST([CODE_COVERAGE_CXXFLAGS]) 136*eda14cbcSMatt Macy AC_SUBST([CODE_COVERAGE_LIBS]) 137*eda14cbcSMatt Macy AC_SUBST([CODE_COVERAGE_LDFLAGS]) 138*eda14cbcSMatt Macy 139*eda14cbcSMatt Macy [CODE_COVERAGE_RULES_CHECK=' 140*eda14cbcSMatt Macy -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check 141*eda14cbcSMatt Macy $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture 142*eda14cbcSMatt Macy'] 143*eda14cbcSMatt Macy [CODE_COVERAGE_RULES_CAPTURE=' 144*eda14cbcSMatt Macy $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) 145*eda14cbcSMatt Macy $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) 146*eda14cbcSMatt Macy -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp 147*eda14cbcSMatt Macy $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) 148*eda14cbcSMatt Macy @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" 149*eda14cbcSMatt Macy'] 150*eda14cbcSMatt Macy [CODE_COVERAGE_RULES_CLEAN=' 151*eda14cbcSMatt Macyclean: code-coverage-clean 152*eda14cbcSMatt Macydistclean: code-coverage-clean 153*eda14cbcSMatt Macycode-coverage-clean: 154*eda14cbcSMatt Macy -$(LCOV) --directory $(top_builddir) -z 155*eda14cbcSMatt Macy -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) 156*eda14cbcSMatt Macy -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete 157*eda14cbcSMatt Macy'] 158*eda14cbcSMatt Macy ], [ 159*eda14cbcSMatt Macy [CODE_COVERAGE_RULES_CHECK=' 160*eda14cbcSMatt Macy @echo "Need to reconfigure with --enable-code-coverage" 161*eda14cbcSMatt Macy'] 162*eda14cbcSMatt Macy CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" 163*eda14cbcSMatt Macy CODE_COVERAGE_RULES_CLEAN='' 164*eda14cbcSMatt Macy ]) 165*eda14cbcSMatt Macy 166*eda14cbcSMatt Macy[CODE_COVERAGE_RULES=' 167*eda14cbcSMatt Macy# Code coverage 168*eda14cbcSMatt Macy# 169*eda14cbcSMatt Macy# Optional: 170*eda14cbcSMatt Macy# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. 171*eda14cbcSMatt Macy# Multiple directories may be specified, separated by whitespace. 172*eda14cbcSMatt Macy# (Default: $(top_builddir)) 173*eda14cbcSMatt Macy# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated 174*eda14cbcSMatt Macy# by lcov for code coverage. (Default: 175*eda14cbcSMatt Macy# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) 176*eda14cbcSMatt Macy# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage 177*eda14cbcSMatt Macy# reports to be created. (Default: 178*eda14cbcSMatt Macy# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) 179*eda14cbcSMatt Macy# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, 180*eda14cbcSMatt Macy# set to 0 to disable it and leave empty to stay with the default. 181*eda14cbcSMatt Macy# (Default: empty) 182*eda14cbcSMatt Macy# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov 183*eda14cbcSMatt Macy# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) 184*eda14cbcSMatt Macy# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov 185*eda14cbcSMatt Macy# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) 186*eda14cbcSMatt Macy# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov 187*eda14cbcSMatt Macy# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the 188*eda14cbcSMatt Macy# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) 189*eda14cbcSMatt Macy# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov 190*eda14cbcSMatt Macy# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) 191*eda14cbcSMatt Macy# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering 192*eda14cbcSMatt Macy# lcov instance. (Default: empty) 193*eda14cbcSMatt Macy# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov 194*eda14cbcSMatt Macy# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) 195*eda14cbcSMatt Macy# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the 196*eda14cbcSMatt Macy# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) 197*eda14cbcSMatt Macy# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml 198*eda14cbcSMatt Macy# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) 199*eda14cbcSMatt Macy# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore 200*eda14cbcSMatt Macy# 201*eda14cbcSMatt Macy# The generated report will be titled using the $(PACKAGE_NAME) and 202*eda14cbcSMatt Macy# $(PACKAGE_VERSION). In order to add the current git hash to the title, 203*eda14cbcSMatt Macy# use the git-version-gen script, available online. 204*eda14cbcSMatt Macy 205*eda14cbcSMatt Macy# Optional variables 206*eda14cbcSMatt MacyCODE_COVERAGE_DIRECTORY ?= $(top_builddir) 207*eda14cbcSMatt MacyCODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info 208*eda14cbcSMatt MacyCODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage 209*eda14cbcSMatt MacyCODE_COVERAGE_BRANCH_COVERAGE ?= 210*eda14cbcSMatt MacyCODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ 211*eda14cbcSMatt Macy--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) 212*eda14cbcSMatt MacyCODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) 213*eda14cbcSMatt MacyCODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" 214*eda14cbcSMatt MacyCODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) 215*eda14cbcSMatt MacyCODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) 216*eda14cbcSMatt MacyCODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= 217*eda14cbcSMatt MacyCODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) 218*eda14cbcSMatt MacyCODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ 219*eda14cbcSMatt Macy$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ 220*eda14cbcSMatt Macy--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) 221*eda14cbcSMatt MacyCODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) 222*eda14cbcSMatt Macy 223*eda14cbcSMatt Macy# Add any folders you want to ignore here 224*eda14cbcSMatt Macy# Ignore tmp and tests themselves 225*eda14cbcSMatt MacyCODE_COVERAGE_IGNORE_PATTERN ?= "/tmp/*" "*/tests/*" 226*eda14cbcSMatt MacyCODE_COVERAGE_IGNORE_PATTERN += "*/module/zstd/lib/*" 227*eda14cbcSMatt Macy 228*eda14cbcSMatt MacyGITIGNOREFILES ?= 229*eda14cbcSMatt MacyGITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) 230*eda14cbcSMatt Macy 231*eda14cbcSMatt Macycode_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) 232*eda14cbcSMatt Macycode_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) 233*eda14cbcSMatt Macycode_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ 234*eda14cbcSMatt Macy $(CODE_COVERAGE_OUTPUT_FILE); 235*eda14cbcSMatt Macycode_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) 236*eda14cbcSMatt Macycode_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) 237*eda14cbcSMatt Macycode_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ 238*eda14cbcSMatt Macy $(CODE_COVERAGE_IGNORE_PATTERN); 239*eda14cbcSMatt Macycode_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) 240*eda14cbcSMatt Macycode_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) 241*eda14cbcSMatt Macycode_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); 242*eda14cbcSMatt Macycode_coverage_quiet = $(code_coverage_quiet_$(V)) 243*eda14cbcSMatt Macycode_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) 244*eda14cbcSMatt Macycode_coverage_quiet_0 = --quiet 245*eda14cbcSMatt Macy 246*eda14cbcSMatt Macy# sanitizes the test-name: replaces with underscores: dashes and dots 247*eda14cbcSMatt Macycode_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) 248*eda14cbcSMatt Macy 249*eda14cbcSMatt Macy# Use recursive makes in order to ignore errors during check 250*eda14cbcSMatt Macycheck-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' 251*eda14cbcSMatt Macy 252*eda14cbcSMatt Macy# Capture code coverage data 253*eda14cbcSMatt Macycode-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' 254*eda14cbcSMatt Macy 255*eda14cbcSMatt Macy# Hook rule executed before code-coverage-capture, overridable by the user 256*eda14cbcSMatt Macycode-coverage-capture-hook: 257*eda14cbcSMatt Macy 258*eda14cbcSMatt Macy'"$CODE_COVERAGE_RULES_CLEAN"' 259*eda14cbcSMatt Macy 260*eda14cbcSMatt MacyA''M_DISTCHECK_CONFIGURE_FLAGS ?= 261*eda14cbcSMatt MacyA''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage 262*eda14cbcSMatt Macy 263*eda14cbcSMatt Macy.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean 264*eda14cbcSMatt Macy'] 265*eda14cbcSMatt Macy 266*eda14cbcSMatt Macy AC_SUBST([CODE_COVERAGE_RULES]) 267*eda14cbcSMatt Macy m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])]) 268*eda14cbcSMatt Macy]) 269