Merge lp:~smspillaz/compiz-core/compiz-core.optional-tests into lp:compiz-core/0.9.5

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 2937
Proposed branch: lp:~smspillaz/compiz-core/compiz-core.optional-tests
Merge into: lp:compiz-core/0.9.5
Diff against target: 256 lines (+47/-6)
17 files modified
CMakeLists.txt (+5/-4)
cmake/CompizCommon.cmake (+1/-0)
plugins/place/src/constrain-to-workarea/CMakeLists.txt (+2/-0)
plugins/place/src/screen-size-change/CMakeLists.txt (+2/-0)
src/CMakeLists.txt (+4/-1)
src/logmessage/CMakeLists.txt (+2/-0)
src/option/tests/CMakeLists.txt (+11/-1)
src/pluginclasshandler/CMakeLists.txt (+2/-0)
src/point/CMakeLists.txt (+2/-0)
src/rect/CMakeLists.txt (+2/-0)
src/string/CMakeLists.txt (+2/-0)
src/timer/CMakeLists.txt (+2/-0)
src/window/constrainment/CMakeLists.txt (+2/-0)
src/window/extents/CMakeLists.txt (+2/-0)
src/window/geometry-saver/CMakeLists.txt (+2/-0)
src/window/geometry/CMakeLists.txt (+2/-0)
tests/CMakeLists.txt (+2/-0)
To merge this branch: bzr merge lp:~smspillaz/compiz-core/compiz-core.optional-tests
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Review via email: mp+89668@code.launchpad.net

Description of the change

Makes building the unit tests optional (on by default)

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) :
review: Approve

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 2012-01-20 16:29:27 +0000
3+++ CMakeLists.txt 2012-01-23 12:05:24 +0000
4@@ -120,13 +120,14 @@
5 )
6
7 # Build Google Test and make its headers known
8-find_package (GTest REQUIRED)
9+find_package (GTest)
10 find_library (GMOCK_LIBRARY gmock)
11 find_library (GMOCK_MAIN_LIBRARY gmock_main)
12
13-if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY)
14- message (FATAL_ERROR "Google Mock not found!")
15-endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY)
16+if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND)
17+ message ("Google Mock and Google Test not found - cannot build tests!")
18+ set (COMPIZ_BUILD_TESTING OFF CACHE FORCE)
19+endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND)
20
21 include_directories (${GTEST_INCLUDE_DIRS})
22
23
24=== modified file 'cmake/CompizCommon.cmake'
25--- cmake/CompizCommon.cmake 2012-01-22 09:34:55 +0000
26+++ cmake/CompizCommon.cmake 2012-01-23 12:05:24 +0000
27@@ -21,6 +21,7 @@
28 option (COMPIZ_BUILD_WITH_RPATH "Leave as ON unless building packages" ON)
29 option (COMPIZ_RUN_LDCONFIG "Leave OFF unless you need to run ldconfig after install")
30 option (COMPIZ_PACKAGING_ENABLED "Enable to manually set prefix, exec_prefix, libdir, includedir, datadir" OFF)
31+option (COMPIZ_BUILD_TESTING "Build Unit Tests" ON)
32 set (COMPIZ_DESTDIR "${DESTDIR}" CACHE STRING "Leave blank unless building packages")
33
34 if (NOT COMPIZ_DESTDIR)
35
36=== modified file 'plugins/place/src/constrain-to-workarea/CMakeLists.txt'
37--- plugins/place/src/constrain-to-workarea/CMakeLists.txt 2012-01-22 09:34:55 +0000
38+++ plugins/place/src/constrain-to-workarea/CMakeLists.txt 2012-01-23 12:05:24 +0000
39@@ -46,7 +46,9 @@
40 ${PRIVATE_HEADERS}
41 )
42
43+if (COMPIZ_BUILD_TESTING)
44 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
45+endif (COMPIZ_BUILD_TESTING)
46
47 SET_TARGET_PROPERTIES(
48 compiz_place_constrain_to_workarea PROPERTIES
49
50=== modified file 'plugins/place/src/screen-size-change/CMakeLists.txt'
51--- plugins/place/src/screen-size-change/CMakeLists.txt 2012-01-22 09:34:55 +0000
52+++ plugins/place/src/screen-size-change/CMakeLists.txt 2012-01-23 12:05:24 +0000
53@@ -46,7 +46,9 @@
54 ${PRIVATE_HEADERS}
55 )
56
57+if (COMPIZ_BUILD_TESTING)
58 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
59+endif (COMPIZ_BUILD_TESTING)
60
61 SET_TARGET_PROPERTIES(
62 compiz_place_screen_size_change PROPERTIES
63
64=== modified file 'src/CMakeLists.txt'
65--- src/CMakeLists.txt 2012-01-23 10:25:24 +0000
66+++ src/CMakeLists.txt 2012-01-23 12:05:24 +0000
67@@ -8,7 +8,11 @@
68 add_subdirectory( point )
69 add_subdirectory( rect )
70 add_subdirectory( window )
71+
72+IF (COMPIZ_BUILD_TESTING)
73 add_subdirectory( wrapsystem/tests )
74+add_subdirectory( option/tests )
75+ENDIF (COMPIZ_BUILD_TESTING)
76
77 compiz_add_bcop_targets (
78 core
79@@ -162,6 +166,5 @@
80 LIBRARY DESTINATION ${COMPIZ_DESTDIR}${libdir}
81 ARCHIVE DESTINATION ${COMPIZ_DESTDIR}${libdir}
82 )
83-add_subdirectory(tests)
84
85 enable_coverage_report( TARGETS compiz )
86
87=== modified file 'src/logmessage/CMakeLists.txt'
88--- src/logmessage/CMakeLists.txt 2012-01-16 07:29:26 +0000
89+++ src/logmessage/CMakeLists.txt 2012-01-23 12:05:24 +0000
90@@ -21,7 +21,9 @@
91 ${PRIVATE_HEADERS}
92 )
93
94+IF (COMPIZ_BUILD_TESTING)
95 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
96+ENDIF (COMPIZ_BUILD_TESTING)
97
98 SET_TARGET_PROPERTIES(
99 compiz_logmessage PROPERTIES
100
101=== added directory 'src/option'
102=== renamed directory 'src/tests' => 'src/option/tests'
103=== modified file 'src/option/tests/CMakeLists.txt'
104--- src/tests/CMakeLists.txt 2012-01-16 14:13:44 +0000
105+++ src/option/tests/CMakeLists.txt 2012-01-23 12:05:24 +0000
106@@ -1,5 +1,15 @@
107 include_directories(
108- ${CMAKE_CURRENT_SOURCE_DIR}
109+ ${CMAKE_CURRENT_SOURCE_DIR}
110+ ${compiz_SOURCE_DIR}/include
111+ ${compiz_SOURCE_DIR}/src/pluginclasshandler/include
112+ ${compiz_SOURCE_DIR}/src/timer/include
113+ ${compiz_SOURCE_DIR}/src/logmessage/include
114+ ${compiz_SOURCE_DIR}/src/string/include
115+ ${compiz_SOURCE_DIR}/src/rect/include
116+ ${compiz_SOURCE_DIR}/src/point/include
117+ ${compiz_SOURCE_DIR}/src/window/geometry/include
118+ ${compiz_SOURCE_DIR}/src/window/extents/include
119+ ${COMPIZ_INCLUDE_DIRS}
120 )
121
122 add_executable(
123
124=== modified file 'src/pluginclasshandler/CMakeLists.txt'
125--- src/pluginclasshandler/CMakeLists.txt 2012-01-16 07:29:26 +0000
126+++ src/pluginclasshandler/CMakeLists.txt 2012-01-23 12:05:24 +0000
127@@ -35,7 +35,9 @@
128 ${PRIVATE_HEADERS}
129 )
130
131+IF (COMPIZ_BUILD_TESTING)
132 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
133+ENDIF (COMPIZ_BUILD_TESTING)
134
135 SET_TARGET_PROPERTIES(
136 compiz_pluginclasshandler PROPERTIES
137
138=== modified file 'src/point/CMakeLists.txt'
139--- src/point/CMakeLists.txt 2012-01-19 19:16:27 +0000
140+++ src/point/CMakeLists.txt 2012-01-23 12:05:24 +0000
141@@ -43,7 +43,9 @@
142 ${PRIVATE_HEADERS}
143 )
144
145+IF (COMPIZ_BUILD_TESTING)
146 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
147+ENDIF (COMPIZ_BUILD_TESTING)
148
149 SET_TARGET_PROPERTIES(
150 compiz_point PROPERTIES
151
152=== modified file 'src/rect/CMakeLists.txt'
153--- src/rect/CMakeLists.txt 2012-01-19 19:32:29 +0000
154+++ src/rect/CMakeLists.txt 2012-01-23 12:05:24 +0000
155@@ -41,7 +41,9 @@
156 ${PRIVATE_HEADERS}
157 )
158
159+IF (COMPIZ_BUILD_TESTING)
160 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
161+ENDIF (COMPIZ_BUILD_TESTING)
162
163 SET_TARGET_PROPERTIES(
164 compiz_rect PROPERTIES
165
166=== modified file 'src/string/CMakeLists.txt'
167--- src/string/CMakeLists.txt 2011-12-19 07:06:22 +0000
168+++ src/string/CMakeLists.txt 2012-01-23 12:05:24 +0000
169@@ -19,7 +19,9 @@
170 ${PRIVATE_HEADERS}
171 )
172
173+IF (COMPIZ_BUILD_TESTING)
174 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
175+ENDIF (COMPIZ_BUILD_TESTING)
176
177 SET_TARGET_PROPERTIES(
178 compiz_string PROPERTIES
179
180=== modified file 'src/timer/CMakeLists.txt'
181--- src/timer/CMakeLists.txt 2012-01-16 07:29:26 +0000
182+++ src/timer/CMakeLists.txt 2012-01-23 12:05:24 +0000
183@@ -46,7 +46,9 @@
184 ${PRIVATE_HEADERS}
185 )
186
187+IF (COMPIZ_BUILD_TESTING)
188 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
189+ENDIF (COMPIZ_BUILD_TESTING)
190
191 SET_TARGET_PROPERTIES(
192 compiz_timer PROPERTIES
193
194=== modified file 'src/window/constrainment/CMakeLists.txt'
195--- src/window/constrainment/CMakeLists.txt 2012-01-22 09:34:55 +0000
196+++ src/window/constrainment/CMakeLists.txt 2012-01-23 12:05:24 +0000
197@@ -44,7 +44,9 @@
198 ${PRIVATE_HEADERS}
199 )
200
201+IF (COMPIZ_BUILD_TESTING)
202 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
203+ENDIF (COMPIZ_BUILD_TESTING)
204
205 SET_TARGET_PROPERTIES(
206 compiz_window_constrainment PROPERTIES
207
208=== modified file 'src/window/extents/CMakeLists.txt'
209--- src/window/extents/CMakeLists.txt 2012-01-22 09:34:55 +0000
210+++ src/window/extents/CMakeLists.txt 2012-01-23 12:05:24 +0000
211@@ -42,7 +42,9 @@
212 ${PRIVATE_HEADERS}
213 )
214
215+IF (COMPIZ_BUILD_TESTING)
216 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
217+ENDIF (COMPIZ_BUILD_TESTING)
218
219 SET_TARGET_PROPERTIES(
220 compiz_window_extents PROPERTIES
221
222=== modified file 'src/window/geometry-saver/CMakeLists.txt'
223--- src/window/geometry-saver/CMakeLists.txt 2012-01-22 09:34:55 +0000
224+++ src/window/geometry-saver/CMakeLists.txt 2012-01-23 12:05:24 +0000
225@@ -44,7 +44,9 @@
226 ${PRIVATE_HEADERS}
227 )
228
229+IF (COMPIZ_BUILD_TESTING)
230 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
231+ENDIF (COMPIZ_BUILD_TESTING)
232
233 SET_TARGET_PROPERTIES(
234 compiz_window_geometry_saver PROPERTIES
235
236=== modified file 'src/window/geometry/CMakeLists.txt'
237--- src/window/geometry/CMakeLists.txt 2012-01-22 09:34:55 +0000
238+++ src/window/geometry/CMakeLists.txt 2012-01-23 12:05:24 +0000
239@@ -42,7 +42,9 @@
240 ${PRIVATE_HEADERS}
241 )
242
243+IF (COMPIZ_BUILD_TESTING)
244 ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
245+ENDIF (COMPIZ_BUILD_TESTING)
246
247 SET_TARGET_PROPERTIES(
248 compiz_window_geometry PROPERTIES
249
250=== modified file 'tests/CMakeLists.txt'
251--- tests/CMakeLists.txt 2012-01-20 16:29:27 +0000
252+++ tests/CMakeLists.txt 2012-01-23 12:05:24 +0000
253@@ -1,1 +1,3 @@
254+if (COMPIZ_BUILD_TESTING)
255 add_subdirectory (integration)
256+endif (COMPIZ_BUILD_TESTING)

Subscribers

People subscribed via source and target branches