Merge lp:~compiz-team/compiz/compiz.fix_1120009.3.debug into lp:compiz/0.9.9

Proposed by Sam Spilsbury
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
Reviewer Review Type Date Requested Status
MC Return Pending
Brandon Schaefer Pending
PS Jenkins bot continuous-integration Pending
Review via email: mp+148369@code.launchpad.net

This proposal supersedes a proposal from 2013-02-14.

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/.

This change also refreshes some distro patches. A new option was added to not auto-load the ccp plugin, and also modifies one of the tests depending on a modified setting value.

(LP: #1120009)

Description of the change

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/

This change also refreshes some distro patches. A new option was added to not auto-load the ccp plugin, and also modifies one of the tests depending on a modified setting value.

(LP: #1120009)

To post a comment you must log in.
Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

More useful tests can only be good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
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

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
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.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Okay, I think the cause of the failures was the ccp-autoloading distro patch. That was just causing problems with the child process, but our test framework doesn't handle the case of a crashing compiz yet. I've filed bug 1124843 about that.

Unmerged revisions

3562. By Sam Spilsbury

More debugging and disable problematic patches

3561. By Sam Spilsbury

Some debugging info

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2012-11-05 20:50:59 +0000
+++ CMakeLists.txt 2013-02-14 04:52:23 +0000
@@ -22,6 +22,10 @@
22# GSettings schema recompilation22# GSettings schema recompilation
23include (CompizGSettings)23include (CompizGSettings)
2424
25# Google Test and Xorg-GTest
26include (GoogleTest)
27include (XorgGTest)
28
25include (cmake/base.cmake)29include (cmake/base.cmake)
26# Check if specific function is present in library.30# Check if specific function is present in library.
27include (CheckFunctionExists)31include (CheckFunctionExists)
@@ -137,45 +141,38 @@
137141
138if (COMPIZ_BUILD_TESTING)142if (COMPIZ_BUILD_TESTING)
139143
140 # Build Google Test and make its headers known144 find_package (GoogleTest)
141 find_package (GTest)145
142146 if (GOOGLE_TEST_AND_MOCK_FOUND)
143 if (NOT GTEST_FOUND)147
144148 build_google_test_locally (${CMAKE_BINARY_DIR}/__gtest)
145 # Check for google test and build it locally149
146 set (GTEST_ROOT_DIR150 if (BUILD_XORG_GTEST)
147 "/usr/src/gtest" # Default value, adjustable by user with e.g., ccmake151
148 CACHE152 find_package (XorgGTest)
149 PATH153
150 "Path to Google Test srcs"154 if (XORG_GTEST_FOUND)
151 FORCE155
152 )156 build_xorg_gtest_locally (${CMAKE_BINARY_DIR}/__xorg_gtest)
153157
154 find_path (GTEST_INCLUDE_DIR gtest/gtest.h)158 else (XORG_GTEST_FOUND)
155159
156 if (GTEST_INCLUDE_DIR)160 set (BUILD_XORG_GTEST FALSE)
157 add_subdirectory (${GTEST_ROOT_DIR}161
158 gtest)162 endif (XORG_GTEST_FOUND)
159 endif (GTEST_INCLUDE_DIR)163
160164 endif (BUILD_XORG_GTEST)
161 set (GTEST_BOTH_LIBRARIES gtest gtest_main)165
162 set (GTEST_FOUND TRUE)166 else (GOOGLE_TEST_AND_MOCK_FOUND)
163167
164 endif (NOT GTEST_FOUND)
165
166 find_library (GMOCK_LIBRARY gmock)
167 find_library (GMOCK_MAIN_LIBRARY gmock_main)
168
169 if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND)
170
171 message ("Google Mock and Google Test not found - cannot build tests!")
172 set (COMPIZ_BUILD_TESTING OFF CACHE BOOL "" FORCE)168 set (COMPIZ_BUILD_TESTING OFF CACHE BOOL "" FORCE)
173169 set (BUILD_XORG_GTEST OFF CACHE BOOL "" FORCE)
174 else (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND)170
175171 endif (GOOGLE_TEST_AND_MOCK_FOUND)
176 include_directories (${GTEST_INCLUDE_DIRS})172
177173else (COMPIZ_BUILD_TESTING)
178 endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND)174
175 set (BUILD_XORG_GTEST OFF CACHE BOOL "" FORCE)
179176
180endif (COMPIZ_BUILD_TESTING)177endif (COMPIZ_BUILD_TESTING)
181178
182179
=== modified file 'cmake/CompizCommon.cmake'
--- cmake/CompizCommon.cmake 2013-01-04 04:46:01 +0000
+++ cmake/CompizCommon.cmake 2013-02-14 04:52:23 +0000
@@ -31,6 +31,7 @@
31option (COMPIZ_RUN_LDCONFIG "Leave OFF unless you need to run ldconfig after install")31option (COMPIZ_RUN_LDCONFIG "Leave OFF unless you need to run ldconfig after install")
32option (COMPIZ_PACKAGING_ENABLED "Enable to manually set prefix, exec_prefix, libdir, includedir, datadir" OFF)32option (COMPIZ_PACKAGING_ENABLED "Enable to manually set prefix, exec_prefix, libdir, includedir, datadir" OFF)
33option (COMPIZ_BUILD_TESTING "Build Unit Tests" ON)33option (COMPIZ_BUILD_TESTING "Build Unit Tests" ON)
34option (BUILD_XORG_GTEST "Build Xorg GTest integration tests" ON)
3435
35set (COMPIZ_DATADIR ${CMAKE_INSTALL_PREFIX}/share)36set (COMPIZ_DATADIR ${CMAKE_INSTALL_PREFIX}/share)
36set (COMPIZ_METADATADIR ${CMAKE_INSTALL_PREFIX}/share/compiz)37set (COMPIZ_METADATADIR ${CMAKE_INSTALL_PREFIX}/share/compiz)
3738
=== added file 'cmake/FindGoogleTest.cmake'
--- cmake/FindGoogleTest.cmake 1970-01-01 00:00:00 +0000
+++ cmake/FindGoogleTest.cmake 2013-02-14 04:52:23 +0000
@@ -0,0 +1,46 @@
1# Find Google Test and Google Mock, either with pkg-config or by
2# searching the system install paths. This sets:
3#
4# GOOGLE_TEST_AND_MOCK_FOUND
5# GTEST_INCLUDE_DIR
6# GTEST_ROOT_DIR
7# GMOCK_LIBRARY
8# GMOCK_MAIN_LIBRARY
9
10find_package (GTest)
11
12if (NOT GTEST_FOUND)
13
14 # Check for google test and build it locally
15 set (GTEST_ROOT_DIR
16 "/usr/src/gtest" # Default value, adjustable by user with e.g., ccmake
17 CACHE
18 PATH
19 "Path to Google Test srcs"
20 FORCE)
21
22 find_path (GTEST_INCLUDE_DIR gtest/gtest.h)
23
24 set (GTEST_BOTH_LIBRARIES gtest gtest_main)
25 set (GTEST_FOUND TRUE)
26 set (GTEST_LOCAL_BUILD_REQUIRED TRUE)
27
28else (NOT GTEST_FOUND)
29
30 set (GTEST_LOCAL_BUILD_REQUIRED FALSE)
31
32endif (NOT GTEST_FOUND)
33
34find_library (GMOCK_LIBRARY gmock)
35find_library (GMOCK_MAIN_LIBRARY gmock_main)
36
37if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND)
38
39 message ("Google Mock and Google Test not found - cannot build tests!")
40 set (GOOGLE_TEST_AND_MOCK_FOUND OFF CACHE BOOL "" FORCE)
41
42else (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND)
43
44 set (GOOGLE_TEST_AND_MOCK_FOUND ON CACHE BOOL "" FORCE)
45
46endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND)
047
=== added file 'cmake/FindXorgGTest.cmake'
--- cmake/FindXorgGTest.cmake 1970-01-01 00:00:00 +0000
+++ cmake/FindXorgGTest.cmake 2013-02-14 04:52:23 +0000
@@ -0,0 +1,43 @@
1# Find xorg-gtest,with pkg-config. This sets:
2#
3# XORG_GTEST_FOUND
4# XORG_SERVER_INCLUDE_XORG_GTEST
5# XORG_SERVER_GTEST_SRC
6
7# xorg-gtest
8pkg_check_modules (XORG_SERVER
9 xorg-gtest>=0.7.0
10 xorg-server
11 x11
12 xi)
13
14if (XORG_SERVER_FOUND)
15
16 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=prefix xorg-gtest OUTPUT_VARIABLE _xorg_gtest_prefix)
17 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=includedir xorg-gtest OUTPUT_VARIABLE _xorg_gtest_include_dir)
18 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=sourcedir xorg-gtest OUTPUT_VARIABLE _xorg_gtest_source_dir)
19 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=CPPflags xorg-gtest OUTPUT_VARIABLE _xorg_gtest_cflags)
20
21 string (STRIP ${_xorg_gtest_prefix} _xorg_gtest_prefix)
22 string (STRIP ${_xorg_gtest_include_dir} _xorg_gtest_include_dir)
23 string (STRIP ${_xorg_gtest_source_dir} _xorg_gtest_source_dir)
24 string (STRIP ${_xorg_gtest_cflags} _xorg_gtest_cflags)
25
26 set (XORG_SERVER_GTEST_INCLUDES ${XORG_SERVER_INCLUDE_DIRS})
27 set (XORG_SERVER_GTEST_LIBRARY_DIRS ${XORG_SERVER_LIBRARIES})
28 set (XORG_SERVER_GTEST_LIBRARIES} ${XORG_SERVER_LIBRARIES})
29 set (XORG_SERVER_INCLUDE_XORG_GTEST ${_xorg_gtest_include_dir} CACHE PATH "Path to Xorg GTest Headers")
30 set (XORG_SERVER_GTEST_SRC ${_xorg_gtest_source_dir} CACHE PATH "Path to Xorg GTest Sources")
31 set (XORG_SERVER_GTEST_CFLAGS ${_xorg_gtest_cflags})
32 set (XORG_SERVER_GTEST_ROOT ${CMAKE_SOURCE_DIR}/tests/xorg-gtest CACHE PATH "Path to Xorg GTest CMake sources")
33 set (COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/tests/xorg-gtest/include CACHE PATH "Path to Compiz Xorg GTest Headers")
34
35 message (STATUS "Found xorg-gtest sources at " ${XORG_SERVER_GTEST_SRC})
36 set (XORG_GTEST_FOUND ON)
37
38else (XORG_SERVER_FOUND)
39
40 message (WARNING "Could not found xorg-gtest, can't build xserver tests")
41 set (XORG_GTEST_FOUND OFF)
42
43endif (XORG_SERVER_FOUND)
044
=== added file 'cmake/GoogleTest.cmake'
--- cmake/GoogleTest.cmake 1970-01-01 00:00:00 +0000
+++ cmake/GoogleTest.cmake 2013-02-14 04:52:23 +0000
@@ -0,0 +1,20 @@
1# GoogleTest.cmake
2# build_google_test_locally (dir) takes a subdirectory
3# and builds Google Test in there locally if required
4
5function (build_google_test_locally build_directory)
6
7 if (GOOGLE_TEST_AND_MOCK_FOUND)
8
9 if (GTEST_LOCAL_BUILD_REQUIRED)
10
11 add_subdirectory (${GTEST_ROOT_DIR}
12 ${build_directory})
13
14 endif (GTEST_LOCAL_BUILD_REQUIRED)
15
16 include_directories (${GTEST_INCLUDE_DIRS})
17
18 endif (GOOGLE_TEST_AND_MOCK_FOUND)
19
20endfunction ()
021
=== added file 'cmake/XorgGTest.cmake'
--- cmake/XorgGTest.cmake 1970-01-01 00:00:00 +0000
+++ cmake/XorgGTest.cmake 2013-02-14 04:52:23 +0000
@@ -0,0 +1,14 @@
1# XorgGTest.cmake
2#
3# build_xorg_gtest_locally (dir) specifies a subdirectory to
4# build xorg-gtest in locally
5
6function (build_xorg_gtest_locally build_directory)
7
8 if (XORG_GTEST_FOUND)
9
10 add_subdirectory (${XORG_SERVER_GTEST_ROOT} ${build_directory})
11
12 endif (XORG_GTEST_FOUND)
13
14endfunction ()
015
=== modified file 'debian/control'
--- debian/control 2012-11-05 21:35:41 +0000
+++ debian/control 2013-02-14 04:52:23 +0000
@@ -34,8 +34,10 @@
34 libxext-dev,34 libxext-dev,
35 libxdamage-dev (>=1:1.0.3),35 libxdamage-dev (>=1:1.0.3),
36 libxfixes-dev (>= 1:4.0.1),36 libxfixes-dev (>= 1:4.0.1),
37 libxi-dev,
37 libxinerama-dev, 38 libxinerama-dev,
38 libxml-parser-perl,39 libxml-parser-perl,
40 libxorg-gtest-dev,
39 libxrandr-dev (>= 2:1.1.0.2),41 libxrandr-dev (>= 2:1.1.0.2),
40 libxrender-dev (>= 1:0.9.1), 42 libxrender-dev (>= 1:0.9.1),
41 libxcursor-dev,43 libxcursor-dev,
@@ -54,6 +56,7 @@
54 python-pyrex,56 python-pyrex,
55 gnome-control-center-dev,57 gnome-control-center-dev,
56 gsettings-desktop-schemas-dev,58 gsettings-desktop-schemas-dev,
59 xserver-xorg-dev (>= 0.7.0),
57Standards-Version: 3.9.360Standards-Version: 3.9.3
58# If you aren't a member of ~compiz-team but need to upload packaging changes,61# If you aren't a member of ~compiz-team but need to upload packaging changes,
59# just go ahead. ~compiz-team will notice and sync up the code again.62# just go ahead. ~compiz-team will notice and sync up the code again.
6063
=== modified file 'debian/patches/series'
--- debian/patches/series 2012-12-10 03:28:47 +0000
+++ debian/patches/series 2013-02-14 04:52:23 +0000
@@ -1,7 +1,7 @@
1ubuntu-config.patch1ubuntu-config.patch
2ccp_plugin.patch2#ccp_plugin.patch
3ccsm_remove_redundant_sliders.patch3ccsm_remove_redundant_sliders.patch
4ccsm_add_first_run_warning.patch4ccsm_add_first_run_warning.patch
5ccsm_disable_unity_checkbox.patch5ccsm_disable_unity_checkbox.patch
699_valid_ccsm_desktop_file.patch699_valid_ccsm_desktop_file.patch
7unity_support_test.patch7#unity_support_test.patch
88
=== modified file 'src/event.cpp'
--- src/event.cpp 2013-01-03 16:06:41 +0000
+++ src/event.cpp 2013-02-14 04:52:23 +0000
@@ -1217,6 +1217,8 @@
1217 * Non-critical event handling that might be overridden by plugins1217 * Non-critical event handling that might be overridden by plugins
1218 */1218 */
12191219
1220 fprintf (stderr, "received event of type 0x%x\n", event->type);
1221
1220 CompWindow *w = NULL;1222 CompWindow *w = NULL;
1221 XWindowAttributes wa;1223 XWindowAttributes wa;
12221224
@@ -1281,6 +1283,8 @@
1281 {1283 {
1282 bool create = true;1284 bool create = true;
12831285
1286 fprintf (stderr, "received CreateNotify on 0x%x\n", (unsigned int) event->xcreatewindow.window);
1287
1284 /* Failure means that window has been destroyed. We still have to add 1288 /* Failure means that window has been destroyed. We still have to add
1285 * the window to the window list as we might get configure requests1289 * the window to the window list as we might get configure requests
1286 * which require us to stack other windows relative to it. Setting1290 * which require us to stack other windows relative to it. Setting
12871291
=== modified file 'src/screen.cpp'
--- src/screen.cpp 2013-02-03 17:58:29 +0000
+++ src/screen.cpp 2013-02-14 04:52:23 +0000
@@ -3582,6 +3582,8 @@
3582 bool updateClientListStacking = false;3582 bool updateClientListStacking = false;
3583 int n = 0;3583 int n = 0;
35843584
3585 fprintf (stderr, "cps::WM::updateClientList\n");
3586
3585 screen->forEachWindow (boost::bind (countClientListWindow, _1, &n));3587 screen->forEachWindow (boost::bind (countClientListWindow, _1, &n));
35863588
3587 if (n == 0)3589 if (n == 0)
@@ -3620,7 +3622,10 @@
3620 {3622 {
3621 CompWindow* const w(*i);3623 CompWindow* const w(*i);
3622 if (isClientListWindow (w))3624 if (isClientListWindow (w))
3625 {
3626 fprintf (stderr, "found window 0x%x\n", (unsigned int) w->id ());
3623 clientListStacking.push_back (w);3627 clientListStacking.push_back (w);
3628 }
3624 }3629 }
36253630
3626 /* clear clientList and copy clientListStacking into clientList */3631 /* clear clientList and copy clientListStacking into clientList */
@@ -3659,11 +3664,14 @@
3659 (unsigned char *) &clientIdList.at (0), n);3664 (unsigned char *) &clientIdList.at (0), n);
36603665
3661 if (updateClientListStacking)3666 if (updateClientListStacking)
3667 {
3668 fprintf (stderr, "called XChangeProperty\n");
3662 XChangeProperty (ps.dpy, ps.rootWindow(),3669 XChangeProperty (ps.dpy, ps.rootWindow(),
3663 Atoms::clientListStacking,3670 Atoms::clientListStacking,
3664 XA_WINDOW, 32, PropModeReplace,3671 XA_WINDOW, 32, PropModeReplace,
3665 (unsigned char *) &clientIdListStacking.at (0),3672 (unsigned char *) &clientIdListStacking.at (0),
3666 n);3673 n);
3674 }
3667}3675}
36683676
3669const CompWindowVector &3677const CompWindowVector &
36703678
=== modified file 'src/window.cpp'
--- src/window.cpp 2013-02-12 22:02:10 +0000
+++ src/window.cpp 2013-02-14 04:52:23 +0000
@@ -6093,6 +6093,8 @@
60936093
6094 priv->window = this;6094 priv->window = this;
60956095
6096 fprintf (stderr, "new window 0x%x created above 0x%x\n", (unsigned int) priv->id, (unsigned int) aboveId);
6097
6096 screen->insertWindow (this, aboveId);6098 screen->insertWindow (this, aboveId);
6097 screen->insertServerWindow (this, aboveServerId);6099 screen->insertServerWindow (this, aboveServerId);
60986100
60996101
=== modified file 'tests/system/xorg-gtest/CMakeLists.txt'
--- tests/system/xorg-gtest/CMakeLists.txt 2012-11-28 14:33:20 +0000
+++ tests/system/xorg-gtest/CMakeLists.txt 2013-02-14 04:52:23 +0000
@@ -1,33 +1,5 @@
1include (FindPkgConfig)1if (BUILD_XORG_GTEST)
22
3pkg_check_modules (XORG_SERVER xorg-gtest xorg-server x11)
4
5option (BUILD_XORG_GTEST "Build Xorg GTest integration tests" OFF)
6
7if (XORG_SERVER_FOUND AND BUILD_XORG_GTEST)
8
9 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=prefix xorg-gtest OUTPUT_VARIABLE _xorg_gtest_prefix)
10 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=includedir xorg-gtest OUTPUT_VARIABLE _xorg_gtest_include_dir)
11 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=sourcedir xorg-gtest OUTPUT_VARIABLE _xorg_gtest_source_dir)
12 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=CPPflags xorg-gtest OUTPUT_VARIABLE _xorg_gtest_cflags)
13
14 string (STRIP ${_xorg_gtest_prefix} _xorg_gtest_prefix)
15 string (STRIP ${_xorg_gtest_include_dir} _xorg_gtest_include_dir)
16 string (STRIP ${_xorg_gtest_source_dir} _xorg_gtest_source_dir)
17 string (STRIP ${_xorg_gtest_cflags} _xorg_gtest_cflags)
18
19 set (XORG_SERVER_INCLUDE_XORG_GTEST ${_xorg_gtest_include_dir} CACHE PATH "Path to Xorg GTest Headers")
20 set (XORG_SERVER_GTEST_SRC ${_xorg_gtest_source_dir} CACHE PATH "Path to Xorg GTest Sources")
21 set (COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE PATH "Path to Compiz Xorg GTest Headers")
22
23 message (STATUS "Found xorg-gtest sources at " ${XORG_SERVER_GTEST_SRC})
24
25 add_subdirectory (src)
26 add_subdirectory (tests)3 add_subdirectory (tests)
274
28else (XORG_SERVER_FOUND AND BUILD_XORG_GTEST)5endif (BUILD_XORG_GTEST)
29
30 message (WARNING "Could not found xorg-gtest, not building system tests")
31 set (BUILD_XORG_GTEST OFF)
32
33endif (XORG_SERVER_FOUND AND BUILD_XORG_GTEST)
346
=== modified file 'tests/system/xorg-gtest/tests/CMakeLists.txt'
--- tests/system/xorg-gtest/tests/CMakeLists.txt 2013-01-11 07:57:32 +0000
+++ tests/system/xorg-gtest/tests/CMakeLists.txt 2013-02-14 04:52:23 +0000
@@ -2,6 +2,8 @@
22
3if (BUILD_XORG_GTEST AND X11_XI_FOUND)3if (BUILD_XORG_GTEST AND X11_XI_FOUND)
44
5 message ("idir: " ${COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR})
6
5 include_directories (${compiz_SOURCE_DIR}/tests/shared7 include_directories (${compiz_SOURCE_DIR}/tests/shared
6 ${COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR}8 ${COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR}
7 ${X11_INCLUDE_DIRS}9 ${X11_INCLUDE_DIRS}
810
=== added directory 'tests/xorg-gtest'
=== added file 'tests/xorg-gtest/CMakeLists.txt'
--- tests/xorg-gtest/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ tests/xorg-gtest/CMakeLists.txt 2013-02-14 04:52:23 +0000
@@ -0,0 +1,49 @@
1set (COMPIZ_LD_LIBRARY_PATH ${CMAKE_BINARY_DIR}/src CACHE STRING "" FORCE)
2set (COMPIZ_BINARY ${CMAKE_BINARY_DIR}/src/compiz CACHE STRING "" FORCE)
3
4configure_file (${CMAKE_CURRENT_SOURCE_DIR}/src/compiz-xorg-gtest-config.h.in
5 ${CMAKE_CURRENT_BINARY_DIR}/src/compiz-xorg-gtest-config.h
6 @ONLY)
7
8include_directories (${compiz_SOURCE_DIR}/tests/shared
9 ${XORG_SERVER_INCLUDE_XORG_GTEST}
10 ${XORG_SERVER_GTEST_INCLUDES}
11 ${COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR}
12 ${CMAKE_CURRENT_BINARY_DIR}/src)
13
14link_directories (${XORG_SERVER_LIBRARY_DIRS})
15
16add_definitions (${XORG_SERVER_GTEST_CFLAGS})
17
18set (_xorg_gtest_all_srcs
19 ${XORG_SERVER_GTEST_SRC}/src/xorg-gtest-all.cpp)
20
21set (_xorg_gtest_main_srcs
22 ${XORG_SERVER_GTEST_SRC}/src/xorg-gtest_main.cpp)
23
24add_library (xorg_gtest_all STATIC
25 ${_xorg_gtest_all_srcs})
26
27add_library (xorg_gtest_main STATIC
28 ${_xorg_gtest_main_srcs})
29
30add_library (compiz_xorg_gtest_system_test STATIC
31 ${CMAKE_CURRENT_SOURCE_DIR}/src/compiz-xorg-gtest.cpp)
32
33target_link_libraries (xorg_gtest_all
34 ${GTEST_BOTH_LIBRARIES}
35 ${CMAKE_THREAD_LIBS_INIT}
36 ${XORG_SERVER_GTEST_LIBRARIES})
37
38target_link_libraries (xorg_gtest_main
39 ${GTEST_BOTH_LIBRARIES}
40 ${CMAKE_THREAD_LIBS_INIT}
41 ${XORG_SERVER_GTEST_LIBRARIES})
42
43target_link_libraries (compiz_xorg_gtest_system_test
44 xorg_gtest_all
45 xorg_gtest_main
46 ${GTEST_BOTH_LIBRARIES}
47 ${CMAKE_THREAD_LIBS_INIT}
48 ${XORG_SERVER_LIBRARIES}
49 ${X11_XI_LIBRARIES})
050
=== renamed directory 'tests/system/xorg-gtest/include' => 'tests/xorg-gtest/include'
=== renamed directory 'tests/system/xorg-gtest/src' => 'tests/xorg-gtest/src'
=== modified file 'tests/xorg-gtest/src/CMakeLists.txt'
--- tests/system/xorg-gtest/src/CMakeLists.txt 2012-09-18 13:17:09 +0000
+++ tests/xorg-gtest/src/CMakeLists.txt 2013-02-14 04:52:23 +0000
@@ -1,51 +0,0 @@
1set (COMPIZ_LD_LIBRARY_PATH ${CMAKE_BINARY_DIR}/src CACHE STRING "" FORCE)
2set (COMPIZ_BINARY ${CMAKE_BINARY_DIR}/src/compiz CACHE STRING "" FORCE)
3
4configure_file (${CMAKE_CURRENT_SOURCE_DIR}/compiz-xorg-gtest-config.h.in
5 ${CMAKE_CURRENT_BINARY_DIR}/compiz-xorg-gtest-config.h
6 @ONLY)
7
8add_definitions (${_xorg_gtest_cflags})
9
10include_directories (${COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR}
11 ${XORG_SERVER_INCLUDE_DIRS}
12 ${GTEST_INCLUDE_DIRS}
13 ${XORG_SERVER_INCLUDE_XORG_GTEST}
14 ${XORG_SERVER_GTEST_SRC}
15 ${CMAKE_CURRENT_BINARY_DIR})
16
17link_directories (${XORG_SERVER_LIBRARY_DIRS})
18
19# This actually includes xorg-gtest-all and the defines
20set (_xorg_gtest_all_srcs
21 ${XORG_SERVER_GTEST_SRC}/src/xorg-gtest-all.cpp)
22
23set (_xorg_gtest_main_srcs
24 ${XORG_SERVER_GTEST_SRC}/src/xorg-gtest_main.cpp)
25
26add_library (xorg_gtest_all STATIC
27 ${_xorg_gtest_all_srcs})
28
29add_library (xorg_gtest_main STATIC
30 ${_xorg_gtest_main_srcs})
31
32add_library (compiz_xorg_gtest_system_test STATIC
33 ${CMAKE_CURRENT_SOURCE_DIR}/compiz-xorg-gtest.cpp)
34
35target_link_libraries (xorg_gtest_all
36 ${GTEST_BOTH_LIBRARIES}
37 ${CMAKE_THREAD_LIBS_INIT}
38 ${XORG_SERVER_LIBRARIES})
39
40target_link_libraries (xorg_gtest_main
41 ${GTEST_BOTH_LIBRARIES}
42 ${CMAKE_THREAD_LIBS_INIT}
43 ${XORG_SERVER_LIBRARIES})
44
45target_link_libraries (compiz_xorg_gtest_system_test
46 xorg_gtest_all
47 xorg_gtest_main
48 ${GTEST_BOTH_LIBRARIES}
49 ${CMAKE_THREAD_LIBS_INIT}
50 ${XORG_SERVER_LIBRARIES}
51 ${X11_XI_LIBRARIES})
520
=== modified file 'tests/xorg-gtest/src/compiz-xorg-gtest.cpp'
--- tests/system/xorg-gtest/src/compiz-xorg-gtest.cpp 2012-12-05 16:01:37 +0000
+++ tests/xorg-gtest/src/compiz-xorg-gtest.cpp 2013-02-14 04:52:23 +0000
@@ -28,6 +28,7 @@
28#include <boost/shared_ptr.hpp>28#include <boost/shared_ptr.hpp>
29#include <xorg/gtest/xorg-gtest.h>29#include <xorg/gtest/xorg-gtest.h>
30#include <compiz-xorg-gtest.h>30#include <compiz-xorg-gtest.h>
31#include <gtest_shared_tmpenv.h>
31#include <X11/Xlib.h>32#include <X11/Xlib.h>
32#include <X11/Xatom.h>33#include <X11/Xatom.h>
3334
@@ -386,6 +387,8 @@
386387
387 std::vector <std::string> args;388 std::vector <std::string> args;
388389
390 args.push_back ("--debug");
391
389 if (flags & ct::CompizProcess::ReplaceCurrentWM)392 if (flags & ct::CompizProcess::ReplaceCurrentWM)
390 args.push_back ("--replace");393 args.push_back ("--replace");
391394
@@ -420,7 +423,13 @@
420{423{
421 public:424 public:
422425
426 PrivateCompizXorgSystemTest () :
427 env ("XORG_GTEST_CHILD_STDOUT", "1")
428 {
429 }
430
423 boost::shared_ptr <ct::CompizProcess> mProcess;431 boost::shared_ptr <ct::CompizProcess> mProcess;
432 TmpEnv env;
424};433};
425434
426ct::CompizXorgSystemTest::CompizXorgSystemTest () :435ct::CompizXorgSystemTest::CompizXorgSystemTest () :

Subscribers

People subscribed via source and target branches