aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib
diff options
context:
space:
mode:
authorJakub Sitnicki <jsitnicki@gmail.com>2015-01-11 15:07:22 +0100
committerAleksander Morgado <aleksander@aleksander.es>2015-01-11 19:32:43 +0100
commit7552030ef90004857b4535f835e19fe734b22a39 (patch)
tree8565c8684d90213d38888fed7f108ea24eb1dd4a /libmm-glib
parentffe2106d4e556526119b89eedb62047fd8eab7de (diff)
build: add code coverage support
Build all targets, except for CLI tools (mmcli, uml290), with special flags needed for collecting code coverage information when the build has been configured with --enable-code-coverage. Three new targets are available in the top build directory: - `check-code-coverage' runs the test suite and generates a code coverage report, - `code-coverage-capture' generates a code coverage report from already collected data, which can come in handy when one wants to see code paths touched by a particular test, - `code-coverage-clean' removes the collected coverage data and the generated reports.
Diffstat (limited to 'libmm-glib')
-rw-r--r--libmm-glib/Makefile.am6
-rw-r--r--libmm-glib/generated/Makefile.am3
-rw-r--r--libmm-glib/generated/tests/Makefile.am3
-rw-r--r--libmm-glib/tests/Makefile.am3
4 files changed, 13 insertions, 2 deletions
diff --git a/libmm-glib/Makefile.am b/libmm-glib/Makefile.am
index 54e79fc9..da1f5d4a 100644
--- a/libmm-glib/Makefile.am
+++ b/libmm-glib/Makefile.am
@@ -1,5 +1,8 @@
SUBDIRS = generated . tests
+AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
+AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
+
lib_LTLIBRARIES = libmm-glib.la
libmm_glib_la_SOURCES = \
@@ -91,7 +94,8 @@ libmm_glib_la_LIBADD = \
$(LIBMM_GLIB_LIBS)
libmm_glib_la_LDFLAGS = \
- -version-info $(MM_GLIB_LT_CURRENT):$(MM_GLIB_LT_REVISION):$(MM_GLIB_LT_AGE)
+ -version-info $(MM_GLIB_LT_CURRENT):$(MM_GLIB_LT_REVISION):$(MM_GLIB_LT_AGE) \
+ $(AM_LDFLAGS)
includedir = @includedir@/libmm-glib
include_HEADERS = \
diff --git a/libmm-glib/generated/Makefile.am b/libmm-glib/generated/Makefile.am
index 2a608fc1..5a90b90d 100644
--- a/libmm-glib/generated/Makefile.am
+++ b/libmm-glib/generated/Makefile.am
@@ -1,6 +1,9 @@
SUBDIRS = . tests
+AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
+AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
+
noinst_LTLIBRARIES = libmm-generated.la
GENERATED_H = \
diff --git a/libmm-glib/generated/tests/Makefile.am b/libmm-glib/generated/tests/Makefile.am
index a4bed421..0cebb720 100644
--- a/libmm-glib/generated/tests/Makefile.am
+++ b/libmm-glib/generated/tests/Makefile.am
@@ -1,4 +1,5 @@
-
+AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
+AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
noinst_LTLIBRARIES = libmm-test-generated.la
diff --git a/libmm-glib/tests/Makefile.am b/libmm-glib/tests/Makefile.am
index be93d4c6..f98f9d7c 100644
--- a/libmm-glib/tests/Makefile.am
+++ b/libmm-glib/tests/Makefile.am
@@ -1,5 +1,8 @@
include $(top_srcdir)/gtester.make
+AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
+AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
+
noinst_PROGRAMS = test-common-helpers
TEST_PROGS += $(noinst_PROGRAMS)