Merge lp:~compiz-team/compiz/compiz.fix_1120009.3.debug into lp:compiz/0.9.9
- compiz.fix_1120009.3.debug
- Merge into 0.9.9
Status: | Superseded |
---|---|
Proposed branch: | lp:~compiz-team/compiz/compiz.fix_1120009.3.debug |
Merge into: | lp:compiz/0.9.9 |
Diff against target: |
559 lines (+241/-122) 16 files modified
CMakeLists.txt (+35/-38) cmake/CompizCommon.cmake (+1/-0) cmake/FindGoogleTest.cmake (+46/-0) cmake/FindXorgGTest.cmake (+43/-0) cmake/GoogleTest.cmake (+20/-0) cmake/XorgGTest.cmake (+14/-0) debian/control (+3/-0) debian/patches/series (+2/-2) src/event.cpp (+4/-0) src/screen.cpp (+8/-0) src/window.cpp (+2/-0) tests/system/xorg-gtest/CMakeLists.txt (+3/-31) tests/system/xorg-gtest/tests/CMakeLists.txt (+2/-0) tests/xorg-gtest/CMakeLists.txt (+49/-0) tests/xorg-gtest/src/CMakeLists.txt (+0/-51) tests/xorg-gtest/src/compiz-xorg-gtest.cpp (+9/-0) |
To merge this branch: | bzr merge lp:~compiz-team/compiz/compiz.fix_1120009.3.debug |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
MC Return | Pending | ||
Brandon Schaefer | Pending | ||
Review via email: mp+148223@code.launchpad.net |
This proposal supersedes a proposal from 2013-02-13.
This proposal has been superseded by a proposal from 2013-02-14.
Commit message
Enable xorg-gtest tests by default and build in CI.
This change also refactors a number of parts of the code to find and build the tests. It puts the logic to find Google Test and Xorg GTest in their own cmake files, and also splits the find logic with the build logic. Finally, it makes the xorg-gtest variables available to all subdirectories and not just the ones under tests/
(LP: #1120009)
Description of the change
Don't merge yet.
Enable xorg-gtest tests by default and build in CI.
This change also refactors a number of parts of the code to find and build the tests. It puts the logic to find Google Test and Xorg GTest in their own cmake files, and also splits the find logic with the build logic. Finally, it makes the xorg-gtest variables available to all subdirectories and not just the ones under tests/
(LP: #1120009)
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:3555
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:3557
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:3558
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Brandon Schaefer (brandontschaefer) wrote : Posted in a previous version of this proposal | # |
Cool, looks good to me. Yay for fixing that mis leading warning message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:3559
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal | # |
Argh. I thought we upgraded xorg-gtest in the distro to 0.8.
I'll have to leave this as WIP until that happens.
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal | # |
Okay, I've been informed that we have 0.7 in the distro, and that is only in raring. I've bumped the required version and mmrazik has bumped the distro in CI.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:3560
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal | # |
Seems like the tests are failing because the xserver isn't sending back the events we expect. Debugging this now.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3561
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 3562. By Sam Spilsbury
-
More debugging and disable problematic patches
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3562
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Unmerged revisions
- 3562. By Sam Spilsbury
-
More debugging and disable problematic patches
- 3561. By Sam Spilsbury
-
Some debugging info
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2012-11-05 20:50:59 +0000 |
3 | +++ CMakeLists.txt 2013-02-14 02:19:20 +0000 |
4 | @@ -22,6 +22,10 @@ |
5 | # GSettings schema recompilation |
6 | include (CompizGSettings) |
7 | |
8 | +# Google Test and Xorg-GTest |
9 | +include (GoogleTest) |
10 | +include (XorgGTest) |
11 | + |
12 | include (cmake/base.cmake) |
13 | # Check if specific function is present in library. |
14 | include (CheckFunctionExists) |
15 | @@ -137,45 +141,38 @@ |
16 | |
17 | if (COMPIZ_BUILD_TESTING) |
18 | |
19 | - # Build Google Test and make its headers known |
20 | - find_package (GTest) |
21 | - |
22 | - if (NOT GTEST_FOUND) |
23 | - |
24 | - # Check for google test and build it locally |
25 | - set (GTEST_ROOT_DIR |
26 | - "/usr/src/gtest" # Default value, adjustable by user with e.g., ccmake |
27 | - CACHE |
28 | - PATH |
29 | - "Path to Google Test srcs" |
30 | - FORCE |
31 | - ) |
32 | - |
33 | - find_path (GTEST_INCLUDE_DIR gtest/gtest.h) |
34 | - |
35 | - if (GTEST_INCLUDE_DIR) |
36 | - add_subdirectory (${GTEST_ROOT_DIR} |
37 | - gtest) |
38 | - endif (GTEST_INCLUDE_DIR) |
39 | - |
40 | - set (GTEST_BOTH_LIBRARIES gtest gtest_main) |
41 | - set (GTEST_FOUND TRUE) |
42 | - |
43 | - endif (NOT GTEST_FOUND) |
44 | - |
45 | - find_library (GMOCK_LIBRARY gmock) |
46 | - find_library (GMOCK_MAIN_LIBRARY gmock_main) |
47 | - |
48 | - if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
49 | - |
50 | - message ("Google Mock and Google Test not found - cannot build tests!") |
51 | + find_package (GoogleTest) |
52 | + |
53 | + if (GOOGLE_TEST_AND_MOCK_FOUND) |
54 | + |
55 | + build_google_test_locally (${CMAKE_BINARY_DIR}/__gtest) |
56 | + |
57 | + if (BUILD_XORG_GTEST) |
58 | + |
59 | + find_package (XorgGTest) |
60 | + |
61 | + if (XORG_GTEST_FOUND) |
62 | + |
63 | + build_xorg_gtest_locally (${CMAKE_BINARY_DIR}/__xorg_gtest) |
64 | + |
65 | + else (XORG_GTEST_FOUND) |
66 | + |
67 | + set (BUILD_XORG_GTEST FALSE) |
68 | + |
69 | + endif (XORG_GTEST_FOUND) |
70 | + |
71 | + endif (BUILD_XORG_GTEST) |
72 | + |
73 | + else (GOOGLE_TEST_AND_MOCK_FOUND) |
74 | + |
75 | set (COMPIZ_BUILD_TESTING OFF CACHE BOOL "" FORCE) |
76 | - |
77 | - else (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
78 | - |
79 | - include_directories (${GTEST_INCLUDE_DIRS}) |
80 | - |
81 | - endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
82 | + set (BUILD_XORG_GTEST OFF CACHE BOOL "" FORCE) |
83 | + |
84 | + endif (GOOGLE_TEST_AND_MOCK_FOUND) |
85 | + |
86 | +else (COMPIZ_BUILD_TESTING) |
87 | + |
88 | + set (BUILD_XORG_GTEST OFF CACHE BOOL "" FORCE) |
89 | |
90 | endif (COMPIZ_BUILD_TESTING) |
91 | |
92 | |
93 | === modified file 'cmake/CompizCommon.cmake' |
94 | --- cmake/CompizCommon.cmake 2013-01-04 04:46:01 +0000 |
95 | +++ cmake/CompizCommon.cmake 2013-02-14 02:19:20 +0000 |
96 | @@ -31,6 +31,7 @@ |
97 | option (COMPIZ_RUN_LDCONFIG "Leave OFF unless you need to run ldconfig after install") |
98 | option (COMPIZ_PACKAGING_ENABLED "Enable to manually set prefix, exec_prefix, libdir, includedir, datadir" OFF) |
99 | option (COMPIZ_BUILD_TESTING "Build Unit Tests" ON) |
100 | +option (BUILD_XORG_GTEST "Build Xorg GTest integration tests" ON) |
101 | |
102 | set (COMPIZ_DATADIR ${CMAKE_INSTALL_PREFIX}/share) |
103 | set (COMPIZ_METADATADIR ${CMAKE_INSTALL_PREFIX}/share/compiz) |
104 | |
105 | === added file 'cmake/FindGoogleTest.cmake' |
106 | --- cmake/FindGoogleTest.cmake 1970-01-01 00:00:00 +0000 |
107 | +++ cmake/FindGoogleTest.cmake 2013-02-14 02:19:20 +0000 |
108 | @@ -0,0 +1,46 @@ |
109 | +# Find Google Test and Google Mock, either with pkg-config or by |
110 | +# searching the system install paths. This sets: |
111 | +# |
112 | +# GOOGLE_TEST_AND_MOCK_FOUND |
113 | +# GTEST_INCLUDE_DIR |
114 | +# GTEST_ROOT_DIR |
115 | +# GMOCK_LIBRARY |
116 | +# GMOCK_MAIN_LIBRARY |
117 | + |
118 | +find_package (GTest) |
119 | + |
120 | +if (NOT GTEST_FOUND) |
121 | + |
122 | + # Check for google test and build it locally |
123 | + set (GTEST_ROOT_DIR |
124 | + "/usr/src/gtest" # Default value, adjustable by user with e.g., ccmake |
125 | + CACHE |
126 | + PATH |
127 | + "Path to Google Test srcs" |
128 | + FORCE) |
129 | + |
130 | + find_path (GTEST_INCLUDE_DIR gtest/gtest.h) |
131 | + |
132 | + set (GTEST_BOTH_LIBRARIES gtest gtest_main) |
133 | + set (GTEST_FOUND TRUE) |
134 | + set (GTEST_LOCAL_BUILD_REQUIRED TRUE) |
135 | + |
136 | +else (NOT GTEST_FOUND) |
137 | + |
138 | + set (GTEST_LOCAL_BUILD_REQUIRED FALSE) |
139 | + |
140 | +endif (NOT GTEST_FOUND) |
141 | + |
142 | +find_library (GMOCK_LIBRARY gmock) |
143 | +find_library (GMOCK_MAIN_LIBRARY gmock_main) |
144 | + |
145 | +if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
146 | + |
147 | + message ("Google Mock and Google Test not found - cannot build tests!") |
148 | + set (GOOGLE_TEST_AND_MOCK_FOUND OFF CACHE BOOL "" FORCE) |
149 | + |
150 | +else (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
151 | + |
152 | + set (GOOGLE_TEST_AND_MOCK_FOUND ON CACHE BOOL "" FORCE) |
153 | + |
154 | +endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND) |
155 | |
156 | === added file 'cmake/FindXorgGTest.cmake' |
157 | --- cmake/FindXorgGTest.cmake 1970-01-01 00:00:00 +0000 |
158 | +++ cmake/FindXorgGTest.cmake 2013-02-14 02:19:20 +0000 |
159 | @@ -0,0 +1,43 @@ |
160 | +# Find xorg-gtest,with pkg-config. This sets: |
161 | +# |
162 | +# XORG_GTEST_FOUND |
163 | +# XORG_SERVER_INCLUDE_XORG_GTEST |
164 | +# XORG_SERVER_GTEST_SRC |
165 | + |
166 | +# xorg-gtest |
167 | +pkg_check_modules (XORG_SERVER |
168 | + xorg-gtest>=0.7.0 |
169 | + xorg-server |
170 | + x11 |
171 | + xi) |
172 | + |
173 | +if (XORG_SERVER_FOUND) |
174 | + |
175 | + execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=prefix xorg-gtest OUTPUT_VARIABLE _xorg_gtest_prefix) |
176 | + execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=includedir xorg-gtest OUTPUT_VARIABLE _xorg_gtest_include_dir) |
177 | + execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=sourcedir xorg-gtest OUTPUT_VARIABLE _xorg_gtest_source_dir) |
178 | + execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=CPPflags xorg-gtest OUTPUT_VARIABLE _xorg_gtest_cflags) |
179 | + |
180 | + string (STRIP ${_xorg_gtest_prefix} _xorg_gtest_prefix) |
181 | + string (STRIP ${_xorg_gtest_include_dir} _xorg_gtest_include_dir) |
182 | + string (STRIP ${_xorg_gtest_source_dir} _xorg_gtest_source_dir) |
183 | + string (STRIP ${_xorg_gtest_cflags} _xorg_gtest_cflags) |
184 | + |
185 | + set (XORG_SERVER_GTEST_INCLUDES ${XORG_SERVER_INCLUDE_DIRS}) |
186 | + set (XORG_SERVER_GTEST_LIBRARY_DIRS ${XORG_SERVER_LIBRARIES}) |
187 | + set (XORG_SERVER_GTEST_LIBRARIES} ${XORG_SERVER_LIBRARIES}) |
188 | + set (XORG_SERVER_INCLUDE_XORG_GTEST ${_xorg_gtest_include_dir} CACHE PATH "Path to Xorg GTest Headers") |
189 | + set (XORG_SERVER_GTEST_SRC ${_xorg_gtest_source_dir} CACHE PATH "Path to Xorg GTest Sources") |
190 | + set (XORG_SERVER_GTEST_CFLAGS ${_xorg_gtest_cflags}) |
191 | + set (XORG_SERVER_GTEST_ROOT ${CMAKE_SOURCE_DIR}/tests/xorg-gtest CACHE PATH "Path to Xorg GTest CMake sources") |
192 | + set (COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/tests/xorg-gtest/include CACHE PATH "Path to Compiz Xorg GTest Headers") |
193 | + |
194 | + message (STATUS "Found xorg-gtest sources at " ${XORG_SERVER_GTEST_SRC}) |
195 | + set (XORG_GTEST_FOUND ON) |
196 | + |
197 | +else (XORG_SERVER_FOUND) |
198 | + |
199 | + message (WARNING "Could not found xorg-gtest, can't build xserver tests") |
200 | + set (XORG_GTEST_FOUND OFF) |
201 | + |
202 | +endif (XORG_SERVER_FOUND) |
203 | |
204 | === added file 'cmake/GoogleTest.cmake' |
205 | --- cmake/GoogleTest.cmake 1970-01-01 00:00:00 +0000 |
206 | +++ cmake/GoogleTest.cmake 2013-02-14 02:19:20 +0000 |
207 | @@ -0,0 +1,20 @@ |
208 | +# GoogleTest.cmake |
209 | +# build_google_test_locally (dir) takes a subdirectory |
210 | +# and builds Google Test in there locally if required |
211 | + |
212 | +function (build_google_test_locally build_directory) |
213 | + |
214 | + if (GOOGLE_TEST_AND_MOCK_FOUND) |
215 | + |
216 | + if (GTEST_LOCAL_BUILD_REQUIRED) |
217 | + |
218 | + add_subdirectory (${GTEST_ROOT_DIR} |
219 | + ${build_directory}) |
220 | + |
221 | + endif (GTEST_LOCAL_BUILD_REQUIRED) |
222 | + |
223 | + include_directories (${GTEST_INCLUDE_DIRS}) |
224 | + |
225 | + endif (GOOGLE_TEST_AND_MOCK_FOUND) |
226 | + |
227 | +endfunction () |
228 | |
229 | === added file 'cmake/XorgGTest.cmake' |
230 | --- cmake/XorgGTest.cmake 1970-01-01 00:00:00 +0000 |
231 | +++ cmake/XorgGTest.cmake 2013-02-14 02:19:20 +0000 |
232 | @@ -0,0 +1,14 @@ |
233 | +# XorgGTest.cmake |
234 | +# |
235 | +# build_xorg_gtest_locally (dir) specifies a subdirectory to |
236 | +# build xorg-gtest in locally |
237 | + |
238 | +function (build_xorg_gtest_locally build_directory) |
239 | + |
240 | + if (XORG_GTEST_FOUND) |
241 | + |
242 | + add_subdirectory (${XORG_SERVER_GTEST_ROOT} ${build_directory}) |
243 | + |
244 | + endif (XORG_GTEST_FOUND) |
245 | + |
246 | +endfunction () |
247 | |
248 | === modified file 'debian/control' |
249 | --- debian/control 2012-11-05 21:35:41 +0000 |
250 | +++ debian/control 2013-02-14 02:19:20 +0000 |
251 | @@ -34,8 +34,10 @@ |
252 | libxext-dev, |
253 | libxdamage-dev (>=1:1.0.3), |
254 | libxfixes-dev (>= 1:4.0.1), |
255 | + libxi-dev, |
256 | libxinerama-dev, |
257 | libxml-parser-perl, |
258 | + libxorg-gtest-dev, |
259 | libxrandr-dev (>= 2:1.1.0.2), |
260 | libxrender-dev (>= 1:0.9.1), |
261 | libxcursor-dev, |
262 | @@ -54,6 +56,7 @@ |
263 | python-pyrex, |
264 | gnome-control-center-dev, |
265 | gsettings-desktop-schemas-dev, |
266 | + xserver-xorg-dev (>= 0.7.0), |
267 | Standards-Version: 3.9.3 |
268 | # If you aren't a member of ~compiz-team but need to upload packaging changes, |
269 | # just go ahead. ~compiz-team will notice and sync up the code again. |
270 | |
271 | === modified file 'debian/patches/series' |
272 | --- debian/patches/series 2012-12-10 03:28:47 +0000 |
273 | +++ debian/patches/series 2013-02-14 02:19:20 +0000 |
274 | @@ -1,7 +1,7 @@ |
275 | ubuntu-config.patch |
276 | -ccp_plugin.patch |
277 | +#ccp_plugin.patch |
278 | ccsm_remove_redundant_sliders.patch |
279 | ccsm_add_first_run_warning.patch |
280 | ccsm_disable_unity_checkbox.patch |
281 | 99_valid_ccsm_desktop_file.patch |
282 | -unity_support_test.patch |
283 | +#unity_support_test.patch |
284 | |
285 | === modified file 'src/event.cpp' |
286 | --- src/event.cpp 2013-01-03 16:06:41 +0000 |
287 | +++ src/event.cpp 2013-02-14 02:19:20 +0000 |
288 | @@ -1217,6 +1217,8 @@ |
289 | * Non-critical event handling that might be overridden by plugins |
290 | */ |
291 | |
292 | + fprintf (stderr, "received event of type 0x%x\n", event->type); |
293 | + |
294 | CompWindow *w = NULL; |
295 | XWindowAttributes wa; |
296 | |
297 | @@ -1281,6 +1283,8 @@ |
298 | { |
299 | bool create = true; |
300 | |
301 | + fprintf (stderr, "received CreateNotify on 0x%x\n", (unsigned int) event->xcreatewindow.window); |
302 | + |
303 | /* Failure means that window has been destroyed. We still have to add |
304 | * the window to the window list as we might get configure requests |
305 | * which require us to stack other windows relative to it. Setting |
306 | |
307 | === modified file 'src/screen.cpp' |
308 | --- src/screen.cpp 2013-02-03 17:58:29 +0000 |
309 | +++ src/screen.cpp 2013-02-14 02:19:20 +0000 |
310 | @@ -3582,6 +3582,8 @@ |
311 | bool updateClientListStacking = false; |
312 | int n = 0; |
313 | |
314 | + fprintf (stderr, "cps::WM::updateClientList\n"); |
315 | + |
316 | screen->forEachWindow (boost::bind (countClientListWindow, _1, &n)); |
317 | |
318 | if (n == 0) |
319 | @@ -3620,7 +3622,10 @@ |
320 | { |
321 | CompWindow* const w(*i); |
322 | if (isClientListWindow (w)) |
323 | + { |
324 | + fprintf (stderr, "found window 0x%x\n", (unsigned int) w->id ()); |
325 | clientListStacking.push_back (w); |
326 | + } |
327 | } |
328 | |
329 | /* clear clientList and copy clientListStacking into clientList */ |
330 | @@ -3659,11 +3664,14 @@ |
331 | (unsigned char *) &clientIdList.at (0), n); |
332 | |
333 | if (updateClientListStacking) |
334 | + { |
335 | + fprintf (stderr, "called XChangeProperty\n"); |
336 | XChangeProperty (ps.dpy, ps.rootWindow(), |
337 | Atoms::clientListStacking, |
338 | XA_WINDOW, 32, PropModeReplace, |
339 | (unsigned char *) &clientIdListStacking.at (0), |
340 | n); |
341 | + } |
342 | } |
343 | |
344 | const CompWindowVector & |
345 | |
346 | === modified file 'src/window.cpp' |
347 | --- src/window.cpp 2013-02-12 22:02:10 +0000 |
348 | +++ src/window.cpp 2013-02-14 02:19:20 +0000 |
349 | @@ -6093,6 +6093,8 @@ |
350 | |
351 | priv->window = this; |
352 | |
353 | + fprintf (stderr, "new window 0x%x created above 0x%x\n", (unsigned int) priv->id, (unsigned int) aboveId); |
354 | + |
355 | screen->insertWindow (this, aboveId); |
356 | screen->insertServerWindow (this, aboveServerId); |
357 | |
358 | |
359 | === modified file 'tests/system/xorg-gtest/CMakeLists.txt' |
360 | --- tests/system/xorg-gtest/CMakeLists.txt 2012-11-28 14:33:20 +0000 |
361 | +++ tests/system/xorg-gtest/CMakeLists.txt 2013-02-14 02:19:20 +0000 |
362 | @@ -1,33 +1,5 @@ |
363 | -include (FindPkgConfig) |
364 | - |
365 | -pkg_check_modules (XORG_SERVER xorg-gtest xorg-server x11) |
366 | - |
367 | -option (BUILD_XORG_GTEST "Build Xorg GTest integration tests" OFF) |
368 | - |
369 | -if (XORG_SERVER_FOUND AND BUILD_XORG_GTEST) |
370 | - |
371 | - execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=prefix xorg-gtest OUTPUT_VARIABLE _xorg_gtest_prefix) |
372 | - execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=includedir xorg-gtest OUTPUT_VARIABLE _xorg_gtest_include_dir) |
373 | - execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=sourcedir xorg-gtest OUTPUT_VARIABLE _xorg_gtest_source_dir) |
374 | - execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=CPPflags xorg-gtest OUTPUT_VARIABLE _xorg_gtest_cflags) |
375 | - |
376 | - string (STRIP ${_xorg_gtest_prefix} _xorg_gtest_prefix) |
377 | - string (STRIP ${_xorg_gtest_include_dir} _xorg_gtest_include_dir) |
378 | - string (STRIP ${_xorg_gtest_source_dir} _xorg_gtest_source_dir) |
379 | - string (STRIP ${_xorg_gtest_cflags} _xorg_gtest_cflags) |
380 | - |
381 | - set (XORG_SERVER_INCLUDE_XORG_GTEST ${_xorg_gtest_include_dir} CACHE PATH "Path to Xorg GTest Headers") |
382 | - set (XORG_SERVER_GTEST_SRC ${_xorg_gtest_source_dir} CACHE PATH "Path to Xorg GTest Sources") |
383 | - set (COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE PATH "Path to Compiz Xorg GTest Headers") |
384 | - |
385 | - message (STATUS "Found xorg-gtest sources at " ${XORG_SERVER_GTEST_SRC}) |
386 | - |
387 | - add_subdirectory (src) |
388 | +if (BUILD_XORG_GTEST) |
389 | + |
390 | add_subdirectory (tests) |
391 | |
392 | -else (XORG_SERVER_FOUND AND BUILD_XORG_GTEST) |
393 | - |
394 | - message (WARNING "Could not found xorg-gtest, not building system tests") |
395 | - set (BUILD_XORG_GTEST OFF) |
396 | - |
397 | -endif (XORG_SERVER_FOUND AND BUILD_XORG_GTEST) |
398 | +endif (BUILD_XORG_GTEST) |
399 | |
400 | === modified file 'tests/system/xorg-gtest/tests/CMakeLists.txt' |
401 | --- tests/system/xorg-gtest/tests/CMakeLists.txt 2013-01-11 07:57:32 +0000 |
402 | +++ tests/system/xorg-gtest/tests/CMakeLists.txt 2013-02-14 02:19:20 +0000 |
403 | @@ -2,6 +2,8 @@ |
404 | |
405 | if (BUILD_XORG_GTEST AND X11_XI_FOUND) |
406 | |
407 | + message ("idir: " ${COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR}) |
408 | + |
409 | include_directories (${compiz_SOURCE_DIR}/tests/shared |
410 | ${COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR} |
411 | ${X11_INCLUDE_DIRS} |
412 | |
413 | === added directory 'tests/xorg-gtest' |
414 | === added file 'tests/xorg-gtest/CMakeLists.txt' |
415 | --- tests/xorg-gtest/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
416 | +++ tests/xorg-gtest/CMakeLists.txt 2013-02-14 02:19:20 +0000 |
417 | @@ -0,0 +1,49 @@ |
418 | +set (COMPIZ_LD_LIBRARY_PATH ${CMAKE_BINARY_DIR}/src CACHE STRING "" FORCE) |
419 | +set (COMPIZ_BINARY ${CMAKE_BINARY_DIR}/src/compiz CACHE STRING "" FORCE) |
420 | + |
421 | +configure_file (${CMAKE_CURRENT_SOURCE_DIR}/src/compiz-xorg-gtest-config.h.in |
422 | + ${CMAKE_CURRENT_BINARY_DIR}/src/compiz-xorg-gtest-config.h |
423 | + @ONLY) |
424 | + |
425 | +include_directories (${compiz_SOURCE_DIR}/tests/shared |
426 | + ${XORG_SERVER_INCLUDE_XORG_GTEST} |
427 | + ${XORG_SERVER_GTEST_INCLUDES} |
428 | + ${COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR} |
429 | + ${CMAKE_CURRENT_BINARY_DIR}/src) |
430 | + |
431 | +link_directories (${XORG_SERVER_LIBRARY_DIRS}) |
432 | + |
433 | +add_definitions (${XORG_SERVER_GTEST_CFLAGS}) |
434 | + |
435 | +set (_xorg_gtest_all_srcs |
436 | + ${XORG_SERVER_GTEST_SRC}/src/xorg-gtest-all.cpp) |
437 | + |
438 | +set (_xorg_gtest_main_srcs |
439 | + ${XORG_SERVER_GTEST_SRC}/src/xorg-gtest_main.cpp) |
440 | + |
441 | +add_library (xorg_gtest_all STATIC |
442 | + ${_xorg_gtest_all_srcs}) |
443 | + |
444 | +add_library (xorg_gtest_main STATIC |
445 | + ${_xorg_gtest_main_srcs}) |
446 | + |
447 | +add_library (compiz_xorg_gtest_system_test STATIC |
448 | + ${CMAKE_CURRENT_SOURCE_DIR}/src/compiz-xorg-gtest.cpp) |
449 | + |
450 | +target_link_libraries (xorg_gtest_all |
451 | + ${GTEST_BOTH_LIBRARIES} |
452 | + ${CMAKE_THREAD_LIBS_INIT} |
453 | + ${XORG_SERVER_GTEST_LIBRARIES}) |
454 | + |
455 | +target_link_libraries (xorg_gtest_main |
456 | + ${GTEST_BOTH_LIBRARIES} |
457 | + ${CMAKE_THREAD_LIBS_INIT} |
458 | + ${XORG_SERVER_GTEST_LIBRARIES}) |
459 | + |
460 | +target_link_libraries (compiz_xorg_gtest_system_test |
461 | + xorg_gtest_all |
462 | + xorg_gtest_main |
463 | + ${GTEST_BOTH_LIBRARIES} |
464 | + ${CMAKE_THREAD_LIBS_INIT} |
465 | + ${XORG_SERVER_LIBRARIES} |
466 | + ${X11_XI_LIBRARIES}) |
467 | |
468 | === renamed directory 'tests/system/xorg-gtest/include' => 'tests/xorg-gtest/include' |
469 | === renamed directory 'tests/system/xorg-gtest/src' => 'tests/xorg-gtest/src' |
470 | === modified file 'tests/xorg-gtest/src/CMakeLists.txt' |
471 | --- tests/system/xorg-gtest/src/CMakeLists.txt 2012-09-18 13:17:09 +0000 |
472 | +++ tests/xorg-gtest/src/CMakeLists.txt 2013-02-14 02:19:20 +0000 |
473 | @@ -1,51 +0,0 @@ |
474 | -set (COMPIZ_LD_LIBRARY_PATH ${CMAKE_BINARY_DIR}/src CACHE STRING "" FORCE) |
475 | -set (COMPIZ_BINARY ${CMAKE_BINARY_DIR}/src/compiz CACHE STRING "" FORCE) |
476 | - |
477 | -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/compiz-xorg-gtest-config.h.in |
478 | - ${CMAKE_CURRENT_BINARY_DIR}/compiz-xorg-gtest-config.h |
479 | - @ONLY) |
480 | - |
481 | -add_definitions (${_xorg_gtest_cflags}) |
482 | - |
483 | -include_directories (${COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR} |
484 | - ${XORG_SERVER_INCLUDE_DIRS} |
485 | - ${GTEST_INCLUDE_DIRS} |
486 | - ${XORG_SERVER_INCLUDE_XORG_GTEST} |
487 | - ${XORG_SERVER_GTEST_SRC} |
488 | - ${CMAKE_CURRENT_BINARY_DIR}) |
489 | - |
490 | -link_directories (${XORG_SERVER_LIBRARY_DIRS}) |
491 | - |
492 | -# This actually includes xorg-gtest-all and the defines |
493 | -set (_xorg_gtest_all_srcs |
494 | - ${XORG_SERVER_GTEST_SRC}/src/xorg-gtest-all.cpp) |
495 | - |
496 | -set (_xorg_gtest_main_srcs |
497 | - ${XORG_SERVER_GTEST_SRC}/src/xorg-gtest_main.cpp) |
498 | - |
499 | -add_library (xorg_gtest_all STATIC |
500 | - ${_xorg_gtest_all_srcs}) |
501 | - |
502 | -add_library (xorg_gtest_main STATIC |
503 | - ${_xorg_gtest_main_srcs}) |
504 | - |
505 | -add_library (compiz_xorg_gtest_system_test STATIC |
506 | - ${CMAKE_CURRENT_SOURCE_DIR}/compiz-xorg-gtest.cpp) |
507 | - |
508 | -target_link_libraries (xorg_gtest_all |
509 | - ${GTEST_BOTH_LIBRARIES} |
510 | - ${CMAKE_THREAD_LIBS_INIT} |
511 | - ${XORG_SERVER_LIBRARIES}) |
512 | - |
513 | -target_link_libraries (xorg_gtest_main |
514 | - ${GTEST_BOTH_LIBRARIES} |
515 | - ${CMAKE_THREAD_LIBS_INIT} |
516 | - ${XORG_SERVER_LIBRARIES}) |
517 | - |
518 | -target_link_libraries (compiz_xorg_gtest_system_test |
519 | - xorg_gtest_all |
520 | - xorg_gtest_main |
521 | - ${GTEST_BOTH_LIBRARIES} |
522 | - ${CMAKE_THREAD_LIBS_INIT} |
523 | - ${XORG_SERVER_LIBRARIES} |
524 | - ${X11_XI_LIBRARIES}) |
525 | |
526 | === modified file 'tests/xorg-gtest/src/compiz-xorg-gtest.cpp' |
527 | --- tests/system/xorg-gtest/src/compiz-xorg-gtest.cpp 2012-12-05 16:01:37 +0000 |
528 | +++ tests/xorg-gtest/src/compiz-xorg-gtest.cpp 2013-02-14 02:19:20 +0000 |
529 | @@ -28,6 +28,7 @@ |
530 | #include <boost/shared_ptr.hpp> |
531 | #include <xorg/gtest/xorg-gtest.h> |
532 | #include <compiz-xorg-gtest.h> |
533 | +#include <gtest_shared_tmpenv.h> |
534 | #include <X11/Xlib.h> |
535 | #include <X11/Xatom.h> |
536 | |
537 | @@ -386,6 +387,8 @@ |
538 | |
539 | std::vector <std::string> args; |
540 | |
541 | + args.push_back ("--debug"); |
542 | + |
543 | if (flags & ct::CompizProcess::ReplaceCurrentWM) |
544 | args.push_back ("--replace"); |
545 | |
546 | @@ -420,7 +423,13 @@ |
547 | { |
548 | public: |
549 | |
550 | + PrivateCompizXorgSystemTest () : |
551 | + env ("XORG_GTEST_CHILD_STDOUT", "1") |
552 | + { |
553 | + } |
554 | + |
555 | boost::shared_ptr <ct::CompizProcess> mProcess; |
556 | + TmpEnv env; |
557 | }; |
558 | |
559 | ct::CompizXorgSystemTest::CompizXorgSystemTest () : |
More useful tests can only be good.