summaryrefslogtreecommitdiff
path: root/endless/Makefile.am
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2014-04-30 21:33:40 +0800
committerSam Spilsbury <smspillaz@gmail.com>2015-01-10 03:42:45 +0800
commit89f56642a644522761914431a8fa952e8a79a482 (patch)
treec8069400ca33ea8543a4cb268451b4900360aaa6 /endless/Makefile.am
parentab8e54781bf8c9f09396204e3e9c1caa10c8c356 (diff)
Enable Gjs and C coverage reports.
We now provide a new m4 module eos-coverage.m4, which is installed into the system aclocal directory. This macro provides three new commands for SDK consumers to use: EOS_COVERAGE_REPORT([languages]) - Enables a "coverage report". The first argument is a space separated list of unquoted languages to collect coverage information for. Valid values at the moment are "c" and "js". For each language specified, the macro will check for support for collecting coverage and enable reporting accordingly. Raw coverage output goes in $(abs_top_builddir)/_coverage/output/$language accordingly. The macro then checks to see if a coverage reporter, either genhtml, or cobertura, is available and enables them. A reporter must be installed and available for coverage reports to be generated. The coverage-genhtml is enabled if lcov is installed and available. This is generally used by developers themselves as it creates a self-contained report. The coverage-covertura is enabled if a program called lcov-result-merger is installed and a python module called lcov_cobertura are installed. lcov-result-merger can be installed from Node Package Manager. lcov_cobertura can be installed from PyPI. lcov-result-merger is necessary because each test suite is run in a separate subprocess and so there will be multiple entries per source file in the coverage.lcov file generated by gjs. lcov_cobertura doesn't handle that properly and so the results need to be merged together properly. JavaScript Coverage Details =========================== A variable called EOS_JS_COVERAGE_FILES should be defined containing a list of all javascript files to be considered a "part of" the coverage report, before EOS_COVERAGE_RULES are substituted. For example: EOS_JS_COVERAGE_FILES = $(SRCS) @EOS_COVERAGE_RULES@ AM_JS_LOG_FLAGS += @EOS_COVERAGE_JS_LOG_FLAGS@ C/C++ Coverage Details ====================== Certain additions also need to be made for Makefiles where coverage reporting is enabled on a C project: @EOS_COVERAGE_RULES@ AM_CFLAGS += @EOS_C_COVERAGE_CFLAGS@ AM_LDFLAGS += @EOS_C_COVERAGE_LDFLAGS@ If a target's CFLAGS is overridden and AM_CFLAGS is not used, then @EOS_C_COVERAGE_CFLAGS@ must be added to its CFLAGS. Blacklisting patterns ===================== If a path should not appear in the coverage report, then it can be blacklisted by adding a glob expression to EOS_COVERAGE_BLACKLIST_PATTERNS. Clean rules =========== A clean-coverage target is added to the dependencies for the clean-local target automatically by EOS_COVERAGE_RULES. [endlessm/eos-shell#2264]
Diffstat (limited to 'endless/Makefile.am')
-rw-r--r--endless/Makefile.am6
1 files changed, 5 insertions, 1 deletions
diff --git a/endless/Makefile.am b/endless/Makefile.am
index 35e31d0..623970e 100644
--- a/endless/Makefile.am
+++ b/endless/Makefile.am
@@ -63,6 +63,10 @@ libendless_@EOS_SDK_API_VERSION@_la_CPPFLAGS = \
-DSYSCONFDIR=\""$(sysconfdir)"\"
libendless_@EOS_SDK_API_VERSION@_la_CFLAGS = $(AM_CFLAGS)
libendless_@EOS_SDK_API_VERSION@_la_LIBADD = @EOS_SDK_LIBS@
+
+# AM_LDFLAGS won't be applied automatically where we have an override
+# so we need to add EOS_C_COVERAGE_LDFLAGS here
libendless_@EOS_SDK_API_VERSION@_la_LDFLAGS = \
-version-info @EOS_SDK_LT_VERSION_INFO@ \
- -export-symbols-regex "^eos_"
+ -export-symbols-regex "^eos_" \
+ @EOS_C_COVERAGE_LDFLAGS@