summaryrefslogtreecommitdiff
path: root/overrides
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 /overrides
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 'overrides')
-rw-r--r--overrides/Makefile.am.inc8
1 files changed, 6 insertions, 2 deletions
diff --git a/overrides/Makefile.am.inc b/overrides/Makefile.am.inc
index be0f9cd..2d4023c 100644
--- a/overrides/Makefile.am.inc
+++ b/overrides/Makefile.am.inc
@@ -4,11 +4,15 @@
gjsdir = ${datadir}/gjs-1.0
-# Put override files here for custom js API outside of normal introspection
-nobase_dist_gjs_DATA = \
+overrides_sources = \
overrides/Endless.js \
overrides/endless_private/asset_button.js \
overrides/endless_private/connection_test.js \
overrides/endless_private/search_box.js \
overrides/endless_private/topbar_nav_button.js \
$(NULL)
+
+# Put override files here for custom js API outside of normal introspection
+nobase_dist_gjs_DATA = $(overrides_sources)
+
+EOS_JS_COVERAGE_FILES += $(overrides_sources)