aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.am
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-01-16 16:39:37 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-01-16 16:39:37 +0100
commitef8f767f0cfb558b75d5b2533c57c97b050a7830 (patch)
treeea36f812e923e526c10bdbcf77f8f1e05814370d /Makefile.am
parenttests: actually run the main loop properly to be able to enter in idle state. (diff)
downloadelementary-ef8f767f0cfb558b75d5b2533c57c97b050a7830.tar.gz
tests: add coverage support.
And our current score is 19% functions coverage for Elementary.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am34
1 files changed, 31 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 70f7a92fa..30de680d1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -54,9 +54,6 @@ po/Rules-quot
endif
-
-
-
EXTRA_DIST = \
README \
AUTHORS \
@@ -125,3 +122,34 @@ doc:
screenshots: all
@echo "entering src/examples/"
$(MAKE) -C src/examples screenshots
+
+if ELEMENTARY_ENABLE_COVERAGE
+
+lcov-reset:
+ @rm -rf $(top_builddir)/coverage
+ @find $(top_builddir) -name "*.gcda" -delete
+ @lcov --zerocounters --directory $(top_builddir)
+
+lcov-report:
+ @mkdir $(top_builddir)/coverage
+ lcov --capture --compat-libtool --no-external --output-file $(top_builddir)/coverage/coverage.info --directory $(top_builddir) --base-directory $(top_srcdir)/src/lib/
+ lcov --remove $(top_builddir)/coverage/coverage.info '*.h' --output-file $(top_builddir)/coverage/coverage.cleaned.info
+ lcov --remove $(top_builddir)/coverage/coverage.cleaned.info '*/elm_test_*' --output-file $(top_builddir)/coverage/coverage.cleaned2.info
+ lcov --remove $(top_builddir)/coverage/coverage.cleaned2.info '*/elm_suite.c' --output-file $(top_builddir)/coverage/coverage.cleaned3.info
+ lcov --remove $(top_builddir)/coverage/coverage.cleaned3.info '*NONE*' --output-file $(top_builddir)/coverage/coverage.cleaned4.info
+ genhtml --branch-coverage -t "$(PACKAGE_STRING)" -o $(top_builddir)/coverage/html $(top_builddir)/coverage/coverage.cleaned4.info
+ @echo "Coverage Report at $(top_builddir)/coverage/html"
+
+endif
+
+if ELEMENTARY_ENABLE_TESTS
+
+lcov-check:
+if ELEMENTARY_ENABLE_COVERAGE
+ @$(MAKE) $(AM_MAKEFLAGS) lcov-reset
+endif
+ @$(MAKE) $(AM_MAKEFLAGS) check
+if ELEMENTARY_ENABLE_COVERAGE
+ @$(MAKE) $(AM_MAKEFLAGS) lcov-report
+endif
+endif