Skip to content

Commit

Permalink
[tests] Add 'coverage' make target
Browse files Browse the repository at this point in the history
  • Loading branch information
martyone committed Apr 30, 2013
1 parent fec60b6 commit 9766508
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.rst
Expand Up @@ -45,3 +45,4 @@ Extra make targets
-----------

* check: run tests directly inside build tree
* coverage: generate code coverage report
3 changes: 3 additions & 0 deletions connman-qt.pro
Expand Up @@ -6,6 +6,9 @@ check.depends = all
check.CONFIG = phony recursive
QMAKE_EXTRA_TARGETS += check

# Adds 'coverage' target
include(coverage.pri)

# CONFIG flag to disable qml plugin
!noplugin {
SUBDIRS += plugin
Expand Down
20 changes: 20 additions & 0 deletions coverage.pri
@@ -0,0 +1,20 @@
COVERAGE_EXCLUDES = \
/usr/* \
*/moc_*.cpp \
*/*.moc \
*/qrc_*.cpp \
/build/* \
/tests/* \

coverage.CONFIG = phony
coverage.commands = '\
echo "--- coverage: extracting info" \
&& lcov -c -o lcov.info -d . \
&& echo "--- coverage: excluding $$join(COVERAGE_EXCLUDES, ", ")" \
&& lcov -r lcov.info $$join(COVERAGE_EXCLUDES, "' '", "'", "'") -o lcov.info \
&& echo "--- coverage: generating html" \
&& genhtml -o coverage lcov.info --demangle-cpp \
&& echo -e "--- coverage: done\\n\\n\\tfile://$${OUT_PWD}/coverage/index.html\\n" \
'

QMAKE_EXTRA_TARGETS += coverage

0 comments on commit 9766508

Please sign in to comment.