summaryrefslogtreecommitdiff
path: root/m4/ax_code_coverage.m4
diff options
context:
space:
mode:
authorOlaf Mandel <olaf@mandel.name>2016-02-26 22:36:49 +0100
committerOlaf Mandel <olaf@mandel.name>2016-02-26 22:36:49 +0100
commitafe81e5b5d6aea828aef87779364a74ba4e8670e (patch)
tree3742de120dbb02d7fee1a4c5cb0487da8825a977 /m4/ax_code_coverage.m4
parentce119bf249bd67d0ffbdcb88ef973bef15dde27b (diff)
downloadautoconf-archive-afe81e5b5d6aea828aef87779364a74ba4e8670e.tar.gz
AX_CODE_COVERAGE: fix invalid chars in testname
There was a warning about invalid characters in the testname from lcov: anything except letters, digits and the underscore causes this. So replace such characters with underscores (lcov does this anyway if we don't). Needs to either call $(subst ) for each undesired character or needs to execute a system command because GNU make does not provide regular expressions. Chose here to implement characters individually. Currently only strips dots and dashes, but these should be the most common culprits.
Diffstat (limited to 'm4/ax_code_coverage.m4')
-rw-r--r--m4/ax_code_coverage.m47
1 files changed, 5 insertions, 2 deletions
diff --git a/m4/ax_code_coverage.m4 b/m4/ax_code_coverage.m4
index 904e9e7..67bc482 100644
--- a/m4/ax_code_coverage.m4
+++ b/m4/ax_code_coverage.m4
@@ -69,7 +69,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#serial 12
+#serial 13
AC_DEFUN([AX_CODE_COVERAGE],[
dnl Check for --enable-code-coverage
@@ -221,6 +221,9 @@ code_coverage_quiet = $(code_coverage_quiet_$(V))
code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
code_coverage_quiet_0 = --quiet
+# sanitizes the test-name: replaces with underscores: dashes and dots
+code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
+
# Use recursive makes in order to ignore errors during check
check-code-coverage:
ifeq ($(CODE_COVERAGE_ENABLED),yes)
@@ -233,7 +236,7 @@ endif
# Capture code coverage data
code-coverage-capture: code-coverage-capture-hook
ifeq ($(CODE_COVERAGE_ENABLED),yes)
- $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
+ $(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)
$(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
-@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
$(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)