Merge lp:~dobey/indicator-datetime/fix-coverage into lp:indicator-datetime

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 478
Merged at revision: 475
Proposed branch: lp:~dobey/indicator-datetime/fix-coverage
Merge into: lp:indicator-datetime
Prerequisite: lp:~dobey/indicator-datetime/fix-gtest
Diff against target: 354 lines (+29/-212)
7 files modified
CMakeLists.txt (+12/-17)
cmake/GCov.cmake (+0/-51)
debian/control (+2/-0)
m4/gcov.m4 (+0/-86)
src/CMakeLists.txt (+4/-4)
tests/CMakeLists.txt (+11/-1)
trim-lcov.py (+0/-53)
To merge this branch: bzr merge lp:~dobey/indicator-datetime/fix-coverage
Reviewer Review Type Date Requested Status
unity-api-1-bot continuous-integration Approve
Pete Woods (community) Approve
Charles Kerr (community) Approve
Review via email: mp+316274@code.launchpad.net

Commit message

Use cmake-extras for coverage support and always enable testing.

To post a comment you must log in.
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:475
https://jenkins.canonical.com/unity-api-1/job/lp-indicator-datetime-ci/12/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1590
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1597
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1375
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1375/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1375
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1375/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1375
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1375/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1375
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1375/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1375
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1375/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1375
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1375/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-indicator-datetime-ci/12/rebuild

review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) :
review: Approve
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:477
https://jenkins.canonical.com/unity-api-1/job/lp-indicator-datetime-ci/14/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1592
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1599
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1377
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1377/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1377
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1377/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1377
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1377/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1377
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1377/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1377
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1377/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1377
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1377/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-indicator-datetime-ci/14/rebuild

review: Approve (continuous-integration)
Revision history for this message
Pete Woods (pete-woods) :
review: Needs Fixing
Revision history for this message
Pete Woods (pete-woods) :
review: Approve
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:478
https://jenkins.canonical.com/unity-api-1/job/lp-indicator-datetime-ci/18/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1669
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1676
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1451
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1451/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1451
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1451/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1451
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1451/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1451
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1451/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1451
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1451/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1451
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1451/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-indicator-datetime-ci/18/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2017-02-10 16:15:55 +0000
3+++ CMakeLists.txt 2017-02-10 16:15:55 +0000
4@@ -15,8 +15,10 @@
5 -DCALENDAR_DEFAULT_SOUND="${CALENDAR_DEFAULT_SOUND}")
6
7
8-option (enable_tests "Build the package's automatic tests." ON)
9-option (enable_lcov "Generate lcov code coverage reports." ON)
10+##
11+## Always Be Testing
12+##
13+enable_testing()
14
15 ##
16 ## GNU standard installation directories
17@@ -63,9 +65,6 @@
18 COMMAND bzr export --root=${ARCHIVE_NAME} ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz
19 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
20
21-add_custom_target (clean-coverage
22- COMMAND find ${CMAKE_BINARY_DIR} -name '*.gcda' | xargs rm -f)
23-
24 add_custom_target (cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2 --inline-suppr
25 ${CMAKE_SOURCE_DIR}/src
26 ${CMAKE_SOURCE_DIR}/tests)
27@@ -80,21 +79,17 @@
28 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
29 include_directories (${CMAKE_CURRENT_BINARY_DIR}/include)
30
31-# testing & coverage
32-if (${enable_tests})
33- pkg_check_modules (DBUSTEST REQUIRED dbustest-1>=14.04.0)
34- enable_testing ()
35- if (${enable_lcov})
36- include(GCov)
37- endif ()
38-endif ()
39-
40 # actually build things
41 add_subdirectory(include)
42 add_subdirectory(src)
43 add_subdirectory(data)
44 add_subdirectory(po)
45-if (${enable_tests})
46- add_subdirectory(tests)
47-endif ()
48+add_subdirectory(tests)
49
50+# testing & coverage
51+find_package(CoverageReport)
52+ENABLE_COVERAGE_REPORT(
53+ TARGETS indicatordatetimeservice indicator-datetime-service
54+ TESTS ${COVERAGE_TEST_TARGETS}
55+ FILTER /usr/include ${CMAKE_BINARY_DIR}/*
56+)
57
58=== removed file 'cmake/GCov.cmake'
59--- cmake/GCov.cmake 2014-01-27 07:24:20 +0000
60+++ cmake/GCov.cmake 1970-01-01 00:00:00 +0000
61@@ -1,51 +0,0 @@
62-if (CMAKE_BUILD_TYPE MATCHES coverage)
63- set(GCOV_FLAGS "${GCOV_FLAGS} --coverage")
64- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCOV_FLAGS}")
65- set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${GCOV_FLAGS}")
66- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GCOV_FLAGS}")
67- set(GCOV_LIBS ${GCOV_LIBS} gcov)
68-
69- find_program(GCOVR_EXECUTABLE gcovr HINTS ${GCOVR_ROOT} "${GCOVR_ROOT}/bin")
70- if (NOT GCOVR_EXECUTABLE)
71- message(STATUS "Gcovr binary was not found, can not generate XML coverage info.")
72- else ()
73- message(STATUS "Gcovr found, can generate XML coverage info.")
74- add_custom_target (coverage-xml
75- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
76- COMMAND "${GCOVR_EXECUTABLE}" --exclude="test.*" -x -r "${CMAKE_SOURCE_DIR}"
77- --object-directory=${CMAKE_BINARY_DIR} -o coverage.xml)
78- endif()
79-
80- find_program(LCOV_EXECUTABLE lcov HINTS ${LCOV_ROOT} "${GCOVR_ROOT}/bin")
81- find_program(GENHTML_EXECUTABLE genhtml HINTS ${GENHTML_ROOT})
82- if (NOT LCOV_EXECUTABLE)
83- message(STATUS "Lcov binary was not found, can not generate HTML coverage info.")
84- else ()
85- if(NOT GENHTML_EXECUTABLE)
86- message(STATUS "Genthml binary not found, can not generate HTML coverage info.")
87- else()
88- message(STATUS "Lcov and genhtml found, can generate HTML coverage info.")
89- add_custom_target (coverage-html
90- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
91- COMMAND "${CMAKE_CTEST_COMMAND}" --force-new-ctest-process --verbose
92- COMMAND "${LCOV_EXECUTABLE}" --directory ${CMAKE_BINARY_DIR} --capture | ${CMAKE_SOURCE_DIR}/trim-lcov.py > dconf-lcov.info
93- COMMAND "${LCOV_EXECUTABLE}" -r dconf-lcov.info /usr/include/\\* -o nosys-lcov.info
94- COMMAND LANG=C "${GENHTML_EXECUTABLE}" --prefix ${CMAKE_BINARY_DIR} --output-directory lcov-html --legend --show-details nosys-lcov.info
95- COMMAND ${CMAKE_COMMAND} -E echo ""
96- COMMAND ${CMAKE_COMMAND} -E echo "file://${CMAKE_BINARY_DIR}/lcov-html/index.html"
97- COMMAND ${CMAKE_COMMAND} -E echo "")
98- #COMMAND "${LCOV_EXECUTABLE}" --directory ${CMAKE_BINARY_DIR} --capture --output-file coverage.info --no-checksum
99- #COMMAND "${GENHTML_EXECUTABLE}" --prefix ${CMAKE_BINARY_DIR} --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
100- #COMMAND ${CMAKE_COMMAND} -E echo "\\#define foo \\\"bar\\\""
101- #)
102- endif()
103- endif()
104-endif()
105-
106-
107- #$(MAKE) $(AM_MAKEFLAGS) check
108- #lcov --directory $(top_builddir) --capture --test-name dconf | $(top_srcdir)/trim-lcov.py > dconf-lcov.info
109- #LANG=C genhtml --prefix $(top_builddir) --output-directory lcov-html --legend --show-details dconf-lcov.info
110- #@echo
111- #@echo " file://$(abs_top_builddir)/lcov-html/index.html"
112- #@echo
113
114=== modified file 'debian/control'
115--- debian/control 2017-02-10 16:15:55 +0000
116+++ debian/control 2017-02-10 16:15:55 +0000
117@@ -7,6 +7,8 @@
118 dbus,
119 debhelper (>= 9),
120 dh-translations,
121+ gcovr,
122+ lcov,
123 libglib2.0-dev (>= 2.35.4),
124 libnotify-dev (>= 0.7.6),
125 libgstreamer1.0-dev,
126
127=== removed directory 'm4'
128=== removed file 'm4/gcov.m4'
129--- m4/gcov.m4 2012-03-27 22:17:43 +0000
130+++ m4/gcov.m4 1970-01-01 00:00:00 +0000
131@@ -1,86 +0,0 @@
132-# Checks for existence of coverage tools:
133-# * gcov
134-# * lcov
135-# * genhtml
136-# * gcovr
137-#
138-# Sets ac_cv_check_gcov to yes if tooling is present
139-# and reports the executables to the variables LCOV, GCOVR and GENHTML.
140-AC_DEFUN([AC_TDD_GCOV],
141-[
142- AC_ARG_ENABLE(gcov,
143- AS_HELP_STRING([--enable-gcov],
144- [enable coverage testing with gcov]),
145- [use_gcov=$enableval], [use_gcov=no])
146-
147- if test "x$use_gcov" = "xyes"; then
148- # we need gcc:
149- if test "$GCC" != "yes"; then
150- AC_MSG_ERROR([GCC is required for --enable-gcov])
151- fi
152-
153- # Check if ccache is being used
154- AC_CHECK_PROG(SHTOOL, shtool, shtool)
155- case `$SHTOOL path $CC` in
156- *ccache*[)] gcc_ccache=yes;;
157- *[)] gcc_ccache=no;;
158- esac
159-
160- if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
161- AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
162- fi
163-
164- lcov_version_list="1.6 1.7 1.8 1.9"
165- AC_CHECK_PROG(LCOV, lcov, lcov)
166- AC_CHECK_PROG(GENHTML, genhtml, genhtml)
167-
168- if test "$LCOV"; then
169- AC_CACHE_CHECK([for lcov version], glib_cv_lcov_version, [
170- glib_cv_lcov_version=invalid
171- lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
172- for lcov_check_version in $lcov_version_list; do
173- if test "$lcov_version" = "$lcov_check_version"; then
174- glib_cv_lcov_version="$lcov_check_version (ok)"
175- fi
176- done
177- ])
178- else
179- lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
180- AC_MSG_ERROR([$lcov_msg])
181- fi
182-
183- case $glib_cv_lcov_version in
184- ""|invalid[)]
185- lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
186- AC_MSG_ERROR([$lcov_msg])
187- LCOV="exit 0;"
188- ;;
189- esac
190-
191- if test -z "$GENHTML"; then
192- AC_MSG_ERROR([Could not find genhtml from the lcov package])
193- fi
194-
195- ac_cv_check_gcov=yes
196- ac_cv_check_lcov=yes
197-
198- # Remove all optimization flags from CFLAGS
199- changequote({,})
200- CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
201- changequote([,])
202-
203- # Add the special gcc flags
204- COVERAGE_CFLAGS="-O0 -fprofile-arcs -ftest-coverage"
205- COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage"
206- COVERAGE_LDFLAGS="-lgcov"
207-
208- # Check availability of gcovr
209- AC_CHECK_PROG(GCOVR, gcovr, gcovr)
210- if test -z "$GCOVR"; then
211- ac_cv_check_gcovr=no
212- else
213- ac_cv_check_gcovr=yes
214- fi
215-
216-fi
217-]) # AC_TDD_GCOV
218
219=== modified file 'src/CMakeLists.txt'
220--- src/CMakeLists.txt 2016-05-14 02:07:10 +0000
221+++ src/CMakeLists.txt 2017-02-10 16:15:55 +0000
222@@ -54,9 +54,9 @@
223 # add warnings/coverage info on handwritten files
224 # but not the autogenerated ones...
225 set_source_files_properties(${SERVICE_CXX_SOURCES}
226- PROPERTIES COMPILE_FLAGS "${CXX_WARNING_ARGS} ${GCOV_FLAGS} -g -std=c++11")
227+ PROPERTIES COMPILE_FLAGS "${CXX_WARNING_ARGS} -std=c++11")
228 set_source_files_properties(${SERVICE_C_SOURCES}
229- PROPERTIES COMPILE_FLAGS "${CXX_WARNING_ARGS} ${GCOV_FLAGS} -g -std=c99")
230+ PROPERTIES COMPILE_FLAGS "${CXX_WARNING_ARGS} -std=c99")
231
232 # add the bin dir to our include path so our code can find the generated header files
233 include_directories (${CMAKE_CURRENT_BINARY_DIR})
234@@ -66,7 +66,7 @@
235 link_directories (${SERVICE_DEPS_LIBRARY_DIRS})
236
237 add_executable (${SERVICE_EXEC} main.cpp)
238-set_source_files_properties(${SERVICE_SOURCES} main.cpp PROPERTIES COMPILE_FLAGS "${CXX_WARNING_ARGS} -g -std=c++11")
239-target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES} ${GCOV_LIBS})
240+set_source_files_properties(${SERVICE_SOURCES} main.cpp PROPERTIES COMPILE_FLAGS "${CXX_WARNING_ARGS} -std=c++11")
241+target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES})
242 install (TARGETS ${SERVICE_EXEC} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR})
243
244
245=== modified file 'tests/CMakeLists.txt'
246--- tests/CMakeLists.txt 2017-02-10 16:15:55 +0000
247+++ tests/CMakeLists.txt 2017-02-10 16:15:55 +0000
248@@ -1,6 +1,6 @@
249 find_package(GMock REQUIRED)
250
251-SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g ${CC_WARNING_ARGS}")
252+SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${CC_WARNING_ARGS}")
253
254 # dbustest
255 pkg_check_modules(DBUSTEST REQUIRED
256@@ -37,6 +37,7 @@
257
258 function(add_test_by_name name)
259 set (TEST_NAME ${name})
260+ set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME} PARENT_SCOPE)
261 add_executable (${TEST_NAME} ${TEST_NAME}.cpp gschemas.compiled)
262 add_test (${TEST_NAME} ${TEST_NAME})
263 target_link_libraries (${TEST_NAME} indicatordatetimeservice ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES})
264@@ -61,6 +62,7 @@
265 add_test_by_name(test-utils)
266
267 set (TEST_NAME manual-test-snap)
268+set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME})
269 add_executable (${TEST_NAME} ${TEST_NAME}.cpp)
270 target_link_libraries (${TEST_NAME} indicatordatetimeservice ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES})
271
272@@ -72,6 +74,7 @@
273
274 function(add_eds_ics_test_by_name name)
275 set (TEST_NAME ${name})
276+ set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME} PARENT_SCOPE)
277 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}.ics.in"
278 "${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}.ics")
279 add_executable(${TEST_NAME} ${TEST_NAME}.cpp gschemas.compiled)
280@@ -102,9 +105,16 @@
281 # which hasn't landed yet. These can be re-enabled as soon as that lands.
282 #function(add_dbusmock_test_by_name name)
283 # set (TEST_NAME ${name})
284+# set (COVERAGE_TEST_TARGETS ${COVERAGE_TEST_TARGETS} ${TEST_NAME} PARENT_SCOPE)
285 # add_executable (${TEST_NAME} ${TEST_NAME}.cpp gschemas.compiled)
286 # add_test (${TEST_NAME} ${TEST_NAME})
287 # target_link_libraries (${TEST_NAME} indicatordatetimeservice ${SERVICE_DEPS_LIBRARIES} ${DBUSTEST_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES})
288 #endfunction()
289 #add_dbusmock_test_by_name(test-timezone-geoclue)
290 #add_dbusmock_test_by_name(test-timezones)
291+
292+set(
293+ COVERAGE_TEST_TARGETS
294+ ${COVERAGE_TEST_TARGETS}
295+ PARENT_SCOPE
296+)
297
298=== removed file 'trim-lcov.py'
299--- trim-lcov.py 2014-01-27 07:24:20 +0000
300+++ trim-lcov.py 1970-01-01 00:00:00 +0000
301@@ -1,53 +0,0 @@
302-#!/usr/bin/python
303-
304-# This script removes branch and/or line coverage data for lines that
305-# contain a particular substring.
306-#
307-# In the interest of "fairness" it removes all branch or coverage data
308-# when a match is found -- not just negative data. It is therefore
309-# likely that running this script will actually reduce the total number
310-# of lines and branches that are marked as covered (in absolute terms).
311-#
312-# This script intentionally avoids checking for errors. Any exceptions
313-# will trigger make to fail.
314-#
315-# Author: Ryan Lortie <desrt@desrt.ca>
316-
317-import sys
318-
319-line_suppress = ['g_assert_not_reached']
320-branch_suppress = ['g_assert', 'g_return_if_fail', 'g_clear_object', 'g_clear_pointer', 'g_return_val_if_fail', 'G_DEFINE_TYPE']
321-
322-def check_suppress(suppressions, source, data):
323- line, _, rest = data.partition(',')
324- line = int(line) - 1
325-
326- assert line < len(source)
327-
328- for suppression in suppressions:
329- if suppression in source[line]:
330- return True
331-
332- return False
333-
334-source = []
335-for line in sys.stdin:
336- line = line[:-1]
337-
338- keyword, _, rest = line.partition(':')
339-
340- # Source file
341- if keyword == 'SF':
342- source = file(rest).readlines()
343-
344- # Branch coverage data
345- elif keyword == 'BRDA':
346- if check_suppress(branch_suppress, source, rest):
347- continue
348-
349- # Line coverage data
350- elif keyword == 'DA':
351- if check_suppress(line_suppress, source, rest):
352- continue
353-
354- print line

Subscribers

People subscribed via source and target branches