ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-include tools/lcov.am
+# Add rules for code-coverage testing, as defined by AX_CODE_COVERAGE
+@CODE_COVERAGE_RULES@
dbus_daemon_execdir = $(DBUS_DAEMONDIR)
DBUS_BUS_LIBS = \
+ $(CODE_COVERAGE_LDFLAGS) \
$(XML_LIBS) \
$(SELINUX_LIBS) \
$(APPARMOR_LIBS) \
$(NULL)
DBUS_LAUNCHER_LIBS = \
+ $(CODE_COVERAGE_LDFLAGS) \
$(XML_LIBS) \
$(THREAD_LIBS) \
$(NETWORK_libs) \
$(NULL)
AM_CPPFLAGS = \
+ $(CODE_COVERAGE_CPPFLAGS) \
-I$(top_srcdir) \
$(DBUS_STATIC_BUILD_CPPFLAGS) \
$(XML_CFLAGS) \
# if assertions are enabled, improve backtraces
AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
+AM_CFLAGS = \
+ $(CODE_COVERAGE_CFLAGS) \
+ $(NULL)
+
EFENCE=
CONFIG_IN_FILES= \
$(DBUS_BUS_LIBS) \
$(NULL)
-## mop up the gcov files
-clean-local:
- /bin/rm *.bb *.bbg *.da *.gcov || true
-
install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(dbusdatadir)/session.d
$(mkinstalldirs) $(DESTDIR)$(dbusdatadir)/services
$(NULL)
endif
+# Add rules for code-coverage testing, as defined by AX_CODE_COVERAGE
+@CODE_COVERAGE_RULES@
+
#### Extra dist
EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES)
AC_C_INLINE
AM_PROG_LIBTOOL
AC_PROG_MKDIR_P
-COMPILER_COVERAGE
COMPILER_OPTIMISATIONS
PKG_PROG_PKG_CONFIG
# define DBUS_ENABLE_CHECKS 1
#endif])
-if test x$enable_compiler_coverage = xyes; then
- ## so that config.h changes when you toggle gcov support
- AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
-fi
+# Test for code-coverage tools if --enable-code-coverage
+AX_CODE_COVERAGE
+
+AS_IF([test x$enable_code_coverage = xyes],[
+ AC_DEFINE_UNQUOTED(
+ [DBUS_GCOV_ENABLED], [1],
+ [Defined if gcov is enabled to force a rebuild due to config.h changing])
+ ])
#### Integer sizes
echo "
Rebuilding generated files: ${USE_MAINTAINER_MODE}
- gcc coverage profiling: ${enable_compiler_coverage}
+ gcc coverage profiling: ${enable_code_coverage}
Building embedded tests: ${enable_embedded_tests}
Building modular tests: ${enable_modular_tests}
- with GLib: ${with_glib}
if test x$enable_embedded_tests = xyes -a x$enable_asserts = xno; then
echo "NOTE: building with embedded tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
fi
-if test x$enable_compiler_coverage = xyes; then
- echo "NOTE: building with coverage profiling is definitely for developers only."
-fi
+AS_IF([test x$enable_code_coverage = xyes],[
+ AC_MSG_WARN([Building with coverage profiling is definitely for developers only.])
+ ])
if test x$enable_verbose_mode = xyes; then
echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
fi
dbusdatadir=$(datadir)/dbus-1
AM_CPPFLAGS = \
+ $(CODE_COVERAGE_CPPFLAGS) \
-I$(top_builddir) \
-I$(top_srcdir) \
$(DBUS_STATIC_BUILD_CPPFLAGS) \
-DDBUS_SESSION_CONFIG_FILE=\""$(dbusdatadir)/session.conf"\" \
$(NULL)
-AM_CFLAGS =
+AM_CFLAGS = \
+ $(CODE_COVERAGE_CFLAGS) \
+ $(NULL)
if HAVE_VISIBILITY
if !DBUS_WIN
libdbus_internal_la_LIBADD=$(LIBDBUS_LIBS) libdbus-1.la
if DBUS_WIN
+AM_CXXFLAGS = \
+ $(CODE_COVERAGE_CXXFLAGS) \
+ $(NULL)
+
# This must be a separate convenience library, otherwise libtool notices
# that libdbus-1 might contain C++, links it with g++ and links in libstdc++,
# even on Unix where in fact it doesn't contain any C++. For Windows, where
test_dbus_LDADD = libdbus-internal.la
-## mop up the gcov files
-clean-local:
- /bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true
+# Add rules for code-coverage testing, as defined by AX_CODE_COVERAGE
+@CODE_COVERAGE_RULES@
-## the "name-test" subdir in fact contains a bunch of tests now that need a temporary bus
+## the "name-test" subdir in fact contains a bunch of tests now that need a temporary bus
## to be running to do stuff with. The directory should be renamed.
## We want to build the current directory first to pick up the testutils lib
-SUBDIRS= . name-test
+SUBDIRS= . name-test
DIST_SUBDIRS=name-test
CLEANFILES =
EXTRA_DIST =
AM_CPPFLAGS = \
+ $(CODE_COVERAGE_CPPFLAGS) \
-I$(top_srcdir) \
$(DBUS_STATIC_BUILD_CPPFLAGS) \
-DDBUS_COMPILATION \
# improve backtraces from test stuff
AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
+AM_CFLAGS = \
+ $(CODE_COVERAGE_CFLAGS) \
+ $(NULL)
+
noinst_LTLIBRARIES = libdbus-testutils.la
libdbus_testutils_la_SOURCES = \
libdbus_testutils_la_LIBADD = \
$(top_builddir)/dbus/libdbus-1.la \
$(top_builddir)/dbus/libdbus-internal.la \
+ $(CODE_COVERAGE_LDFLAGS) \
$(NULL)
TEST_EXTENSIONS = .sh
echo 'Output=TAP'; \
echo 'Exec=env DBUS_TEST_DATA=$(testexecdir)/data $(testexecdir)/$* --tap'; \
) > $@.tmp && mv $@.tmp $@
+
+# Add rules for code-coverage testing, as defined by AX_CODE_COVERAGE
+@CODE_COVERAGE_RULES@
+++ /dev/null
-# Copyright © 2008-2011 Collabora Ltd.
-# Copyright © 2008-2011 Nokia Corporation
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-lcov-reset:
- lcov --directory @abs_top_builddir@ --zerocounters
-
-lcov-report:
- lcov --directory @abs_top_builddir@ --capture \
- --output-file @abs_top_builddir@/lcov.info
- $(mkdir_p) @abs_top_builddir@/lcov.html
- git_commit=`GIT_DIR=@abs_top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`;\
- genhtml --title "@PACKAGE_STRING@ $$git_commit" \
- --output-directory @abs_top_builddir@/lcov.html lcov.info
- @echo
- @echo 'lcov report can be found in:'
- @echo 'file://@abs_top_builddir@/lcov.html/index.html'
- @echo
-
-lcov-check:
- $(MAKE) lcov-reset
- $(MAKE) check $(LCOV_CHECK_ARGS)
- $(MAKE) lcov-report
-
-## vim:set ft=automake: