Skip to content

Commit

Permalink
The coverage script now works.
Browse files Browse the repository at this point in the history
  • Loading branch information
László Pere committed Jun 14, 2010
1 parent ba15faa commit fbd8539
Show file tree
Hide file tree
Showing 48 changed files with 127 additions and 4 deletions.
28 changes: 28 additions & 0 deletions gen-coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#! /bin/sh

LCOV=`which lcov`

if test "x$LCOV" = x; then
echo "You need to install lcov to get actual reports!";
echo "See http://ltp.sf.net/coverage/lcov.php";
echo "!!! ATTENTION !!!"
echo "The current lcov-1.8 contains some silly bug.";
echo "Please, use a newer one or the cvs version."
exit 1;
fi

if test "x$SBOX_USE_CCACHE" = xyes; then
export SBOX_USE_CCACHE=no
fi

rm -fr ./coverage/*

echo "qmake BUILD_FEATURES=coverage"
qmake BUILD_FEATURES=coverage

echo "make coverage"
make clean
make coverage

ls -lh ./coverage/index.html

15 changes: 13 additions & 2 deletions project.pro
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
TEMPLATE = subdirs

SUBDIRS = src \
translations \
translations \
themes \
demos \
demos \
tests

QMAKE_CLEAN += configure-stamp build-stamp

contains(BUILD_FEATURES,coverage) {
QMAKE_EXTRA_TARGETS += coverage
coverage.depends = src/Makefile
coverage.commands = \
cd tests && make coverage && cd .. \
&& genhtml --no-branch-coverage --legend -o coverage/ \
-t \"SystemUI Coverage Report\" \
tests/ut_*/selected.cov
}

include(doc/doc.pri)
9 changes: 9 additions & 0 deletions src/coverage.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# We just need an extra target so that the recursive make will pass, we don't
# need to do anything else.
#
contains(BUILD_FEATURES,coverage) {
QMAKE_EXTRA_TARGETS += coverage
coverage.commands = $$system(true)
}

1 change: 1 addition & 0 deletions src/src.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(coverage.pri)
include(../mconfig.pri)

MOC_DIR = .moc
Expand Down
2 changes: 1 addition & 1 deletion tests/check.pri
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONFIG += link_prl
QMAKE_EXTRA_TARGETS = check
QMAKE_EXTRA_TARGETS += check
check.depends = $$TARGET
check.commands = LD_LIBRARY_PATH=../../lib ./$$TARGET

Expand Down
14 changes: 14 additions & 0 deletions tests/coverage.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
contains(BUILD_FEATURES,coverage) {
QMAKE_CXXFLAGS += --coverage
QMAKE_LFLAGS += --coverage
QMAKE_EXTRA_TARGETS += coverage
coverage.commands = \
lcov --directory . --zerocounters \
&& make check \
&& lcov --base-directory `pwd` --directory . --capture --output-file all.cov \
&& lcov --remove all.cov \"*debug.cpp\" --output-file tmp.cov \
&& lcov --extract tmp.cov \"*src*.cpp\" --output-file selected.cov
}

QMAKE_CLEAN += .tmp*gcov ./.tmp/*.gcda ./.tmp/*.gcno *.cov

13 changes: 12 additions & 1 deletion tests/tests.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ TEMPLATE = subdirs
# compiled but left out from the xml (or the insignificant property will be set
# using the 'disabled' file).
#
SUBDIRS = $$system(ls -1d ut_*/*.pro ft_*/*.pro 2>/dev/null | sed 's!/.*!!')
contains(BUILD_FEATURES,coverage) {
SUBDIRS = $$system(ls -1d ut_*/ | grep -v ut_template)
#SUBDIRS = $$system(ls -1d ut_*/*.pro 2>/dev/null | sed 's!/.*!!')
} else {
SUBDIRS = $$system(ls -1d ut_*/*.pro ft_*/*.pro 2>/dev/null | sed 's!/.*!!')
}

QMAKE_STRIP = echo

Expand All @@ -21,6 +26,12 @@ QMAKE_EXTRA_TARGETS += check-xml

QMAKE_CLEAN += **/*.log.xml

contains(BUILD_FEATURES,coverage) {
QMAKE_EXTRA_TARGETS += coverage
coverage.target = coverage
coverage.CONFIG = recursive
}

support_files.commands += $$PWD/gen-tests-xml.sh > $$OUT_PWD/tests.xml
support_files.target = support_files
support_files.files += $$OUT_PWD/tests.xml
Expand Down
1 change: 1 addition & 0 deletions tests/ut_batterybusinesslogic/ut_batterybusinesslogic.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_batterybusinesslogic

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_batterybusinesslogicadaptor
INCLUDEPATH += $$SRCDIR
Expand Down
1 change: 1 addition & 0 deletions tests/ut_clock/ut_clock.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_clock

Expand Down
1 change: 1 addition & 0 deletions tests/ut_clockview/ut_clockview.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_clockview

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_dbusinterfacenotificationsource
INCLUDEPATH += $$SRCDIR/notifications
Expand Down
1 change: 1 addition & 0 deletions tests/ut_eventtypestore/ut_eventtypestore.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_eventtypestore
INCLUDEPATH += $$SRCDIR/notifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_lockscreenbusinesslogic

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_lockscreenbusinesslogicadaptor
INCLUDEPATH += $$SRCDIR
Expand Down
1 change: 1 addition & 0 deletions tests/ut_lockscreenui/ut_lockscreenui.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_lockscreenui

Expand Down
1 change: 1 addition & 0 deletions tests/ut_lowbatterynotifier/ut_lowbatterynotifier.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_lowbatterynotifier

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_mcompositornotificationsink
INCLUDEPATH += $$SRCDIR/notifications
Expand Down
1 change: 1 addition & 0 deletions tests/ut_ngfadapter/ut_ngfadapter.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_ngfadapter
INCLUDEPATH += $$SRCDIR/notifications
Expand Down
1 change: 1 addition & 0 deletions tests/ut_ngfnotificationsink/ut_ngfnotificationsink.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_ngfnotificationsink
INCLUDEPATH += $$SRCDIR/notifications
Expand Down
1 change: 1 addition & 0 deletions tests/ut_notification/ut_notification.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_notification
INCLUDEPATH += $$SRCDIR/notifications
Expand Down
1 change: 1 addition & 0 deletions tests/ut_notificationarea/ut_notificationarea.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_notificationarea
INCLUDEPATH += $$SRCDIR/notifications $$SRCDIR/statusindicatormenu
Expand Down
1 change: 1 addition & 0 deletions tests/ut_notificationareasink/ut_notificationareasink.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_notificationareasink
INCLUDEPATH += $$SRCDIR/notifications $$SRCDIR
Expand Down
1 change: 1 addition & 0 deletions tests/ut_notificationareaview/ut_notificationareaview.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_notificationareaview
INCLUDEPATH += $$SRCDIR/notifications $$SRCDIR/statusindicatormenu
Expand Down
1 change: 1 addition & 0 deletions tests/ut_notificationgroup/ut_notificationgroup.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_notificationgroup
INCLUDEPATH += $$SRCDIR/notifications
Expand Down
1 change: 1 addition & 0 deletions tests/ut_notificationmanager/ut_notificationmanager.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_notificationmanager
INCLUDEPATH += $$SRCDIR/notifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_notificationparameter
INCLUDEPATH += $$SRCDIR/notifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_notificationparameters
INCLUDEPATH += $$SRCDIR/notifications
Expand Down
1 change: 1 addition & 0 deletions tests/ut_notifier/ut_notifier.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_notifier
INCLUDEPATH += $$SRCDIR/statusarea $$SRCDIR/notifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_notifiernotificationsink
INCLUDEPATH += $$SRCDIR/notifications
Expand Down
1 change: 1 addition & 0 deletions tests/ut_pluginlist/ut_pluginlist.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_pluginlist

Expand Down
1 change: 1 addition & 0 deletions tests/ut_statusarearenderer/ut_statusarearenderer.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_statusarearenderer
INCLUDEPATH += $$SRCDIR/statusarea
Expand Down
1 change: 1 addition & 0 deletions tests/ut_statusareaview/ut_statusareaview.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_statusareaview
INCLUDEPATH += $$SRCDIR/statusarea $$SRCDIR/statusindicatormenu $$SRCDIR/notifications
Expand Down
1 change: 1 addition & 0 deletions tests/ut_statusindicator/ut_statusindicator.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_statusindicator

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_statusindicatoranimationview

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_statusindicatoriconview

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_statusindicatorlabelview

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_statusindicatormenuadaptor

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_statusindicatormenuwindow
INCLUDEPATH += $$SRCDIR/statusindicatormenu $$SRCDIR/notifications
Expand Down
1 change: 1 addition & 0 deletions tests/ut_sysuid/ut_sysuid.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_sysuid
INCLUDEPATH += $$SRCDIR $$SRCDIR/notifications $$SRCDIR/statusarea
Expand Down
1 change: 1 addition & 0 deletions tests/ut_template/ut_template.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_template

Expand Down
1 change: 1 addition & 0 deletions tests/ut_unlockmissedevents/ut_unlockmissedevents.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)

TARGET = ut_unlockmissedevents
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)

TARGET = ut_unlocknotificationsink
Expand Down
1 change: 1 addition & 0 deletions tests/ut_unlockwidgets/ut_unlockwidgets.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)

SRC_PREFIX = ../../src
Expand Down
1 change: 1 addition & 0 deletions tests/ut_usbui/ut_usbui.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_usbui
INCLUDEPATH += $$SRCDIR
Expand Down
1 change: 1 addition & 0 deletions tests/ut_volumebarlogic/ut_volumebarlogic.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_volumebarlogic

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include(../coverage.pri)
include(../common_top.pri)
TARGET = ut_widgetnotificationsink
INCLUDEPATH += $$SRCDIR/notifications
Expand Down
9 changes: 9 additions & 0 deletions themes/themes.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ SUBDIRS = \
INSTALLS += \
conf

#
# We just need an extra target so that the recursive make will pass, we don't
# need to do anything else.
#
contains(BUILD_FEATURES,coverage) {
QMAKE_EXTRA_TARGETS += coverage
coverage.commands = $$system(true)
}

conf.files = \
sysuid.conf
conf.path = $$SYSTEMUI_THEMES_DIR
Expand Down

0 comments on commit fbd8539

Please sign in to comment.