Merge lp:~pete-woods/libqtdbustest/cmake-extras-compatibility into lp:libqtdbustest

Proposed by Pete Woods on 2016-12-07
Status: Merged
Approved by: Pete Woods on 2016-12-07
Approved revision: 41
Merged at revision: 41
Proposed branch: lp:~pete-woods/libqtdbustest/cmake-extras-compatibility
Merge into: lp:libqtdbustest
Diff against target: 201 lines (+17/-112)
6 files modified
CMakeLists.txt (+14/-13)
cmake/COPYING-CMAKE-SCRIPTS (+0/-22)
cmake/Coverage.cmake (+0/-37)
cmake/FindValgrind.cmake (+0/-35)
debian/control (+1/-1)
tests/CMakeLists.txt (+2/-4)
To merge this branch: bzr merge lp:~pete-woods/libqtdbustest/cmake-extras-compatibility
Reviewer Review Type Date Requested Status
Unity Team 2016-12-07 Pending
Review via email: mp+312719@code.launchpad.net

Commit message

Compatibility with unversioned cmake-extras modules

Description of the change

Compatibility with unversioned cmake-extras modules

To post a comment you must log in.
42. By Pete Woods on 2016-12-08

Fix coverage report usage

43. By Pete Woods on 2016-12-08

Not a test target

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 2013-08-08 09:59:39 +0000
3+++ CMakeLists.txt 2016-12-08 15:01:28 +0000
4@@ -29,7 +29,6 @@
5 include_directories(${SOURCE_BINARY_DIR})
6
7 include(GNUInstallDirs)
8-include(Coverage)
9
10 # Workaround for libexecdir on debian
11 if (EXISTS "/etc/debian_version")
12@@ -50,23 +49,11 @@
13 -Wextra
14 )
15
16-#set(DOXYFILE_SOURCE_DIR "include")
17-#set(DOXYFILE_EXTRA_SOURCES "doc")
18-#include(UseDoxygen)
19-#if(DOXYGEN_FOUND AND BUILD_DOXYGEN)
20-# install(
21-# DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html
22-# DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/libusermetrics-doc/
23-# )
24-#endif()
25-
26 configure_file(
27 "${SOURCE_DIR}/libqtdbustest/config.h.in"
28 "${SOURCE_BINARY_DIR}/libqtdbustest/config.h"
29 )
30
31-
32-#add_subdirectory("po")
33 add_subdirectory("src")
34 add_subdirectory("data")
35
36@@ -77,3 +64,17 @@
37 check
38 ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure
39 )
40+
41+find_package(CoverageReport)
42+enable_coverage_report(
43+ TARGETS
44+ qtdbustest
45+ qdbus-simple-test-runner
46+ unit-tests
47+ watchdog
48+ FILTER
49+ ${CMAKE_SOURCE_DIR}/tests/*
50+ ${CMAKE_BINARY_DIR}/*
51+ TESTS
52+ unit-tests
53+)
54
55=== removed directory 'cmake'
56=== removed file 'cmake/COPYING-CMAKE-SCRIPTS'
57--- cmake/COPYING-CMAKE-SCRIPTS 2013-07-24 09:42:07 +0000
58+++ cmake/COPYING-CMAKE-SCRIPTS 1970-01-01 00:00:00 +0000
59@@ -1,22 +0,0 @@
60-Redistribution and use in source and binary forms, with or without
61-modification, are permitted provided that the following conditions
62-are met:
63-
64-1. Redistributions of source code must retain the copyright
65- notice, this list of conditions and the following disclaimer.
66-2. Redistributions in binary form must reproduce the copyright
67- notice, this list of conditions and the following disclaimer in the
68- documentation and/or other materials provided with the distribution.
69-3. The name of the author may not be used to endorse or promote products
70- derived from this software without specific prior written permission.
71-
72-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
73-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
74-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
75-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
76-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
77-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
78-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
79-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
80-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
81-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
82
83=== removed file 'cmake/Coverage.cmake'
84--- cmake/Coverage.cmake 2013-07-24 09:42:07 +0000
85+++ cmake/Coverage.cmake 1970-01-01 00:00:00 +0000
86@@ -1,37 +0,0 @@
87-if (CMAKE_BUILD_TYPE MATCHES coverage)
88- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
89- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
90- set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage")
91- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage")
92-
93- find_program(GCOVR_EXECUTABLE gcovr HINTS ${GCOVR_ROOT} "${GCOVR_ROOT}/bin")
94- if (NOT GCOVR_EXECUTABLE)
95- message(STATUS "Gcovr binary was not found, can not generate XML coverage info.")
96- else ()
97- message(STATUS "Gcovr found, can generate XML coverage info.")
98- add_custom_target (coverage-xml
99- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
100- COMMAND "${GCOVR_EXECUTABLE}" --exclude="test.*" --exclude="obj.*" -x -r "${CMAKE_SOURCE_DIR}"
101- --object-directory=${CMAKE_BINARY_DIR} -o coverage.xml)
102- endif()
103-
104- find_program(LCOV_EXECUTABLE lcov HINTS ${LCOV_ROOT} "${GCOVR_ROOT}/bin")
105- find_program(GENHTML_EXECUTABLE genhtml HINTS ${GENHTML_ROOT})
106- if (NOT LCOV_EXECUTABLE)
107- message(STATUS "Lcov binary was not found, can not generate HTML coverage info.")
108- else ()
109- if(NOT GENHTML_EXECUTABLE)
110- message(STATUS "Genthml binary not found, can not generate HTML coverage info.")
111- else()
112- message(STATUS "Lcov and genhtml found, can generate HTML coverage info.")
113- add_custom_target (coverage-html
114- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
115- COMMAND "${LCOV_EXECUTABLE}" --capture --output-file "${CMAKE_BINARY_DIR}/coverage.info" --no-checksum --directory "${CMAKE_BINARY_DIR}"
116- COMMAND "${LCOV_EXECUTABLE}" --remove "${CMAKE_BINARY_DIR}/coverage.info" '/usr/*' --output-file "${CMAKE_BINARY_DIR}/coverage.info"
117- COMMAND "${LCOV_EXECUTABLE}" --remove "${CMAKE_BINARY_DIR}/coverage.info" '${CMAKE_BINARY_DIR}/*' --output-file "${CMAKE_BINARY_DIR}/coverage.info"
118- COMMAND "${LCOV_EXECUTABLE}" --remove "${CMAKE_BINARY_DIR}/coverage.info" '${CMAKE_SOURCE_DIR}/tests/*' --output-file "${CMAKE_BINARY_DIR}/coverage.info"
119- COMMAND "${GENHTML_EXECUTABLE}" --prefix "${CMAKE_BINARY_DIR}" --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
120- )
121- endif()
122- endif()
123-endif()
124
125=== removed file 'cmake/FindValgrind.cmake'
126--- cmake/FindValgrind.cmake 2015-05-05 08:46:26 +0000
127+++ cmake/FindValgrind.cmake 1970-01-01 00:00:00 +0000
128@@ -1,35 +0,0 @@
129-
130-option(
131- ENABLE_MEMCHECK_OPTION
132- "If set to ON, enables automatic creation of memcheck targets"
133- OFF
134-)
135-
136-find_program(
137- VALGRIND_PROGRAM
138- NAMES valgrind
139-)
140-
141-if(VALGRIND_PROGRAM)
142- set(VALGRIND_PROGRAM_OPTIONS
143- "--suppressions=${CMAKE_SOURCE_DIR}/tests/data/valgrind.suppression"
144- "--error-exitcode=1"
145- "--leak-check=full"
146- "--gen-suppressions=all"
147- "--show-leak-kinds=definite"
148- "--quiet"
149- )
150-endif()
151-
152-find_package_handle_standard_args(
153- VALGRIND DEFAULT_MSG
154- VALGRIND_PROGRAM
155-)
156-
157-function(add_valgrind_test NAME EXECUTABLE)
158- if(ENABLE_MEMCHECK_OPTION AND VALGRIND_PROGRAM)
159- add_test(${NAME} ${VALGRIND_PROGRAM} ${VALGRIND_PROGRAM_OPTIONS} "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}")
160- else()
161- add_test(${NAME} ${EXECUTABLE})
162- endif()
163-endfunction()
164
165=== modified file 'debian/control'
166--- debian/control 2015-09-18 09:56:46 +0000
167+++ debian/control 2016-12-08 15:01:28 +0000
168@@ -3,7 +3,7 @@
169 Priority: optional
170 Maintainer: Ubuntu Developers <ubunu-devel.discuss@lists.ubuntu.com>
171 Build-Depends: cmake,
172- cmake-extras,
173+ cmake-extras (>= 0.10),
174 debhelper (>= 9),
175 gettext,
176 google-mock (>= 1.6.0+svn437),
177
178=== modified file 'tests/CMakeLists.txt'
179--- tests/CMakeLists.txt 2013-08-13 09:35:49 +0000
180+++ tests/CMakeLists.txt 2016-12-08 15:01:28 +0000
181@@ -1,10 +1,8 @@
182
183 set(CMAKE_AUTOMOC OFF)
184-include(FindGMock)
185+find_package(GMock)
186 set(CMAKE_AUTOMOC ON)
187
188-find_package("Valgrind" REQUIRED)
189-
190 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
191 include_directories(${GMOCK_INCLUDE_DIRS})
192 include_directories(${GTEST_INCLUDE_DIRS})
193@@ -40,7 +38,7 @@
194 ${GMOCK_LIBRARIES}
195 )
196
197-add_valgrind_test(
198+add_test(
199 unit-tests
200 unit-tests
201 )

Subscribers

People subscribed via source and target branches

to all changes: