mu: allow for code-coverage reports

This commit is contained in:
Dirk-Jan C. Binnema
2020-01-01 15:44:39 +02:00
parent ad63044915
commit 12b34be3cf
5 changed files with 63 additions and 60 deletions

View File

@ -1,4 +1,4 @@
## Copyright (C) 2008-2018 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ## Copyright (C) 2008-2020 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
## ##
## This program is free software; you can redistribute it and/or modify ## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
@ -28,13 +28,7 @@ else
mu4e= mu4e=
endif endif
# if BUILD_PERL SUBDIRS=m4 man lib $(guile) mu $(mu4e) contrib toys
# perl=perl
# else
# perl=
# endif
SUBDIRS=m4 man lib $(guile) mu $(mu4e) contrib toys # $(perl)
ACLOCAL_AMFLAGS=-I m4 ACLOCAL_AMFLAGS=-I m4
@ -95,3 +89,9 @@ EXTRA_DIST= \
doc_DATA = \ doc_DATA = \
NEWS.org NEWS.org
include $(top_srcdir)/aminclude_static.am
CODE_COVERAGE_IGNORE_PATTERN= \
'/usr/*' \
'*test-*'

View File

@ -55,6 +55,9 @@ AX_VALGRIND_CHECK
LT_INIT LT_INIT
AX_CODE_COVERAGE
AC_PROG_AWK AC_PROG_AWK
AC_CHECK_PROG(SORT,sort,sort) AC_CHECK_PROG(SORT,sort,sort)
@ -120,20 +123,20 @@ AS_IF([test "x$ac_cv_member_struct_dirent_d_ino" != "xyes"],
AC_CHECK_FUNCS([memset memcpy realpath setlocale strerror getpass setsid]) AC_CHECK_FUNCS([memset memcpy realpath setlocale strerror getpass setsid])
AC_CHECK_FUNCS([vasprintf strptime]) AC_CHECK_FUNCS([vasprintf strptime])
AC_CHECK_FUNC(timegm,[],[AC_MSG_ERROR([*** missing required function timegm])]) AC_CHECK_FUNC(timegm,[],AC_MSG_ERROR([missing required function timegm]))
# require pkg-config >= 0.28 (release in 2013; should be old enough...) # require pkg-config >= 0.28 (release in 2013; should be old enough...)
# with that version, we don't need the AC_SUBST stuff after PKG_CHECK. # with that version, we don't need the AC_SUBST stuff after PKG_CHECK.
m4_ifndef([PKG_PROG_PKG_CONFIG], m4_ifndef([PKG_PROG_PKG_CONFIG],
[m4_fatal([please install pkg-config >= 0.28 before running autoconf/autogen])]) [m4_fatal([please install pkg-config >= 0.28 before running autoconf/autogen])])
PKG_PROG_PKG_CONFIG(0.28) # latest version in buildroot PKG_PROG_PKG_CONFIG(0.28) # latest version in buildroot
AS_IF([test -z "$PKG_CONFIG"],[ AS_IF([test -z "$PKG_CONFIG"],
AC_MSG_ERROR([ AC_MSG_ERROR([
*** pkg-config with version >= 0.28 could not be found. *** pkg-config with version >= 0.28 could not be found.
*** ***
*** Make sure it is in your path, or set the PKG_CONFIG environment variable *** Make sure it is in your path, or set the PKG_CONFIG environment variable
*** to the full path to pkg-config.]) *** to the full path to pkg-config.])
]) )
# glib2? # glib2?
PKG_CHECK_MODULES(GLIB,glib-2.0 >= 2.38 gobject-2.0 gio-2.0) PKG_CHECK_MODULES(GLIB,glib-2.0 >= 2.38 gobject-2.0 gio-2.0)
@ -165,7 +168,7 @@ AS_IF([test "x$XAPIAN_CONFIG" = "xno"],[
AS_CASE([$xapian_version], AS_CASE([$xapian_version],
[1.[[4-9]].[[0-9]]*], [1.[[4-9]].[[0-9]]*],
[AC_DEFINE([XAPIAN_HAVE_OP_WILDCARD],[1],[Xapian::Query::OP_WILDCARD?])], [AC_DEFINE([XAPIAN_HAVE_OP_WILDCARD],[1],[Xapian::Query::OP_WILDCARD?])],
[AC_MSG_ERROR([*** xapian version >= 1.4 needed, but version $xapian_version found.])]) [AC_MSG_ERROR([*** xapian version >= 1.4 needed, but version $xapian_version found.])])
XAPIAN_CXXFLAGS="$($XAPIAN_CONFIG --cxxflags)" XAPIAN_CXXFLAGS="$($XAPIAN_CONFIG --cxxflags)"
XAPIAN_LIBS="$($XAPIAN_CONFIG --libs)" XAPIAN_LIBS="$($XAPIAN_CONFIG --libs)"
@ -252,12 +255,10 @@ AS_IF([test "x$PMCCABE" = "xno"],[
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
mu/Makefile mu/Makefile
mu/tests/Makefile
lib/Makefile lib/Makefile
lib/doxyfile lib/doxyfile
lib/utils/Makefile lib/utils/Makefile
lib/parser/Makefile lib/parser/Makefile
lib/tests/Makefile
mu4e/Makefile mu4e/Makefile
mu4e/mu4e-meta.el mu4e/mu4e-meta.el
guile/Makefile guile/Makefile

View File

@ -16,20 +16,19 @@
TEST_PROGS= TEST_PROGS=
#
# NOTE: we set the locale/tz to some well-know values, so the tests # NOTE: we set the locale/tz to some well-know values, so the tests
# (at least when running under 'make check') run in a predictable # (at least when running under 'make check') run in a predictable
# environment. There are specific tests different timezone, though. # environment. There are specific tests different timezone, though.
# #
test: all $(TEST_PROGS) test: all $(TEST_PROGS)
@export LC_ALL="en_US.utf8" @export LC_ALL="en_US.utf8"
@export TZ="Europe/Helsinki" @export TZ="Europe/Helsinki"
@test -z "$(TEST_PROGS)" || gtester --verbose $(TEST_PROGS) || exit $$?; \ @test -z "$(TEST_PROGS)" || gtester --verbose $(TEST_PROGS) || exit $$?; \
test -z "$(SUBDIRS)" || \ test -z "$(SUBDIRS)" || \
for subdir in $(SUBDIRS); do \ for subdir in $(SUBDIRS); do \
test "$$subdir" = "." || \ test "$$subdir" = "." || \
(cd ./$$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $$? ; \ (cd ./$$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $$? ; \
done done
.PHONY: test gprof .PHONY: test gprof

View File

@ -1,4 +1,4 @@
## Copyright (C) 2017-2019 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ## Copyright (C) 2017-2020 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
## ##
## This program is free software; you can redistribute it and/or modify ## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by ## it under the terms of the GNU General Public License as published by
@ -24,41 +24,22 @@ AM_CXXFLAGS= \
$(GLIB_CFLAGS) \ $(GLIB_CFLAGS) \
$(XAPIAN_CXXFLAGS) \ $(XAPIAN_CXXFLAGS) \
$(WARN_CXXFLAGS) \ $(WARN_CXXFLAGS) \
$(GCOV_CFLAGS) \
$(ASAN_CXXFLAGS) \ $(ASAN_CXXFLAGS) \
$(CODE_COVERAGE_CFLAGS) \
-Wno-inline \ -Wno-inline \
-Wno-switch-enum -Wno-switch-enum
AM_CPPFLAGS= \ AM_CPPFLAGS= \
$(GCOV_CFLAGS) $(CODE_COVERAGE_CPPFLAGS)
AM_LDFLAGS= \ AM_LDFLAGS= \
$(ASAN_LDFLAGS) \ $(ASAN_LDFLAGS) \
$(WARN_LDFLAGS) \ $(WARN_LDFLAGS)
$(GCOV_LDADD)
noinst_PROGRAMS= \ noinst_PROGRAMS= \
tokenize \ tokenize \
parse parse
tokenize_SOURCES= \
tokenize.cc
tokenize_LDADD= \
$(WARN_LDFLAGS) \
$(GCOV_LDADD) \
libmu-parser.la \
../utils/libmu-utils.la
parse_SOURCES= \
parse.cc
parse_LDADD= \
$(WARN_LDFLAGS) \
$(GCOV_LDADD) \
libmu-parser.la \
../utils/libmu-utils.la
noinst_LTLIBRARIES= \ noinst_LTLIBRARIES= \
libmu-parser.la libmu-parser.la
@ -76,12 +57,27 @@ libmu_parser_la_SOURCES= \
libmu_parser_la_LIBADD= \ libmu_parser_la_LIBADD= \
$(WARN_LDFLAGS) \ $(WARN_LDFLAGS) \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(XAPIAN_LIBS) $(XAPIAN_LIBS) \
../utils/libmu-utils.la \
$(CODE_COVERAGE_LIBS)
VALGRIND_SUPPRESSIONS_FILES= \ VALGRIND_SUPPRESSIONS_FILES= \
${top_srcdir}/mu.supp ${top_srcdir}/mu.supp
tokenize_SOURCES= \
tokenize.cc
tokenize_LDADD= \
$(WARN_LDFLAGS) \
libmu-parser.la
parse_SOURCES= \
parse.cc
parse_LDADD= \
$(WARN_LDFLAGS) \
libmu-parser.la
noinst_PROGRAMS+=$(TEST_PROGS) noinst_PROGRAMS+=$(TEST_PROGS)
TEST_PROGS+= \ TEST_PROGS+= \
@ -89,18 +85,15 @@ TEST_PROGS+= \
test_tokenizer_SOURCES= \ test_tokenizer_SOURCES= \
test-tokenizer.cc test-tokenizer.cc
test_tokenizer_LDADD= \ test_tokenizer_LDADD= \
$(GCOV_LDADD) \ libmu-parser.la
libmu-parser.la \
../utils/libmu-utils.la
TEST_PROGS+= \ TEST_PROGS+= \
test-parser test-parser
test_parser_SOURCES= \ test_parser_SOURCES= \
test-parser.cc test-parser.cc
test_parser_LDADD= \ test_parser_LDADD= \
$(GCOV_LDADD) \ libmu-parser.la
libmu-parser.la \
../utils/libmu-utils.la
TESTS=$(TEST_PROGS) TESTS=$(TEST_PROGS)
include $(top_srcdir)/aminclude_static.am

View File

@ -20,17 +20,25 @@ AM_CFLAGS= \
$(WARN_CFLAGS) \ $(WARN_CFLAGS) \
$(GLIB_CFLAGS) \ $(GLIB_CFLAGS) \
$(ASAN_CFLAGS) \ $(ASAN_CFLAGS) \
-DMU_TESTMAILDIR=\"${abs_top_srcdir}/lib/tests/testdir\" \ $(CODE_COVERAGE_CFLAGS) \
-DMU_TESTMAILDIR2=\"${abs_top_srcdir}/lib/tests/testdir2\" \ -DMU_TESTMAILDIR=\"${abs_top_srcdir}/lib/testdir\" \
-DMU_TESTMAILDIR2=\"${abs_top_srcdir}/lib/testdir2\" \
-Wno-format-nonliteral \ -Wno-format-nonliteral \
-Wno-switch-enum \ -Wno-switch-enum \
-Wno-deprecated-declarations \ -Wno-deprecated-declarations \
-Wno-inline -Wno-inline
AM_CPPFLAGS= \
$(CODE_COVERAGE_CPPFLAGS)
AM_CXXFLAGS= \ AM_CXXFLAGS= \
$(WARN_CXXFLAGS) \ $(WARN_CXXFLAGS) \
$(GLIB_CFLAGS) \ $(GLIB_CFLAGS) \
$(ASAN_CXXFLAGS) $(ASAN_CXXFLAGS) \
$(CODE_COVERAGE_CFLAGS)
AM_LDFLAGS= \
$(ASAN_LDFLAGS)
noinst_LTLIBRARIES= \ noinst_LTLIBRARIES= \
libmu-utils.la libmu-utils.la
@ -49,10 +57,8 @@ libmu_utils_la_SOURCES= \
mu-utils.hh mu-utils.hh
libmu_utils_la_LIBADD= \ libmu_utils_la_LIBADD= \
$(GLIB_LIBS) $(GLIB_LIBS) \
$(CODE_COVERAGE_LIBS)
libmu_utils_la_LDFLAGS= \
$(ASAN_LDFLAGS)
noinst_PROGRAMS= \ noinst_PROGRAMS= \
$(TEST_PROGS) $(TEST_PROGS)
@ -77,3 +83,7 @@ test_mu_str_SOURCES= \
test-mu-str.c test-mu-str.c
test_mu_str_LDADD= \ test_mu_str_LDADD= \
libmu-utils.la libmu-utils.la
TESTS=$(TEST_PROGS)
include $(top_srcdir)/aminclude_static.am