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

Proposed by Pete Woods on 2016-12-07
Status: Merged
Approved by: Pete Woods on 2016-12-12
Approved revision: 46
Merged at revision: 46
Proposed branch: lp:~pete-woods/libqtdbusmock/cmake-extras-compatibility
Merge into: lp:libqtdbusmock
Diff against target: 173 lines (+15/-99)
6 files modified
CMakeLists.txt (+13/-1)
cmake/COPYING-CMAKE-SCRIPTS (+0/-22)
cmake/Coverage.cmake (+0/-37)
cmake/FindValgrind.cmake (+0/-35)
debian/control (+1/-1)
tests/CMakeLists.txt (+1/-3)
To merge this branch: bzr merge lp:~pete-woods/libqtdbusmock/cmake-extras-compatibility
Reviewer Review Type Date Requested Status
Unity Team 2016-12-07 Pending
Review via email: mp+312718@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.
46. By Pete Woods on 2016-12-12

Switch entirely to cmake-extras provided modules

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

Subscribers

People subscribed via source and target branches

to all changes: