Merge lp:~alan-griffiths/mir/revert-c2254-to-fix-1414630 into lp:mir
- revert-c2254-to-fix-1414630
- Merge into development-branch
Status: | Rejected |
---|---|
Rejected by: | Alan Griffiths |
Proposed branch: | lp:~alan-griffiths/mir/revert-c2254-to-fix-1414630 |
Merge into: | lp:mir |
Diff against target: |
2918 lines (+335/-1282) 82 files modified
CMakeLists.txt (+0/-4) debian/control (+33/-35) debian/libmirplatform6driver-android.install (+1/-0) debian/libmirplatform6driver-mesa.install (+1/-0) debian/mir-platform-graphics-android.install (+0/-1) debian/mir-platform-graphics-mesa.install (+0/-1) debian/mir-test-tools.install (+1/-1) debian/rules (+14/-1) include/platform/mir/graphics/platform.h (+1/-31) include/platform/mir/module_properties.h (+0/-37) platform-ABI-sha1sums (+1/-2) server-ABI-sha1sums (+1/-2) src/CMakeLists.txt (+6/-1) src/client/default_connection_configuration.cpp (+1/-1) src/common/graphics/android/mir_native_window.cpp (+1/-0) src/include/platform/mir/graphics/platform_probe.h (+0/-37) src/include/platform/mir/options/configuration.h (+0/-2) src/include/platform/mir/options/default_configuration.h (+0/-5) src/include/platform/mir/shared_library_loader.h (+28/-0) src/include/server/mir/default_server_configuration.h (+0/-3) src/platform/CMakeLists.txt (+6/-6) src/platform/graphics/CMakeLists.txt (+0/-1) src/platform/graphics/platform_probe.cpp (+0/-59) src/platform/options/default_configuration.cpp (+19/-48) src/platform/symbols.map (+3/-3) src/platforms/CMakeLists.txt (+0/-16) src/platforms/android/server/CMakeLists.txt (+25/-16) src/platforms/android/server/platform.cpp (+1/-23) src/platforms/android/server/symbols.map (+0/-10) src/platforms/common/server/symbols.map (+2/-4) src/platforms/mesa/server/CMakeLists.txt (+26/-19) src/platforms/mesa/server/platform.cpp (+0/-31) src/platforms/mesa/server/symbols.map (+0/-16) src/server/CMakeLists.txt (+1/-5) src/server/graphics/CMakeLists.txt (+1/-1) src/server/graphics/default_configuration.cpp (+13/-45) src/server/report/default_server_configuration.cpp (+0/-9) src/server/report/logging/logging_report_factory.cpp (+0/-5) src/server/report/logging_report_factory.h (+0/-1) src/server/report/lttng/CMakeLists.txt (+0/-1) src/server/report/lttng/lttng_report_factory.cpp (+0/-6) src/server/report/lttng/shared_library_prober_report.cpp (+0/-52) src/server/report/lttng/shared_library_prober_report.h (+0/-48) src/server/report/lttng/shared_library_prober_report_tp.h (+0/-70) src/server/report/lttng/tracepoints.c (+0/-1) src/server/report/lttng_report_factory.h (+0/-1) src/server/report/null/null_report_factory.cpp (+0/-11) src/server/report/null_report_factory.h (+0/-2) src/server/report/report_factory.h (+0/-2) src/server/server.cpp (+5/-8) src/server/symbols.map (+0/-2) src/wrapper.c (+0/-3) tests/acceptance-tests/CMakeLists.txt (+5/-1) tests/acceptance-tests/server_configuration_wrapping.cpp (+0/-3) tests/acceptance-tests/test_symbols_required_by_mesa.cpp (+1/-1) tests/include/mir_test_framework/client_platform_factory.h (+2/-2) tests/include/mir_test_framework/executable_path.h (+0/-2) tests/include/mir_test_framework/headless_test.h (+1/-1) tests/include/mir_test_framework/stub_server_platform_factory.h (+0/-49) tests/integration-tests/CMakeLists.txt (+1/-10) tests/mir_test_doubles/CMakeLists.txt (+8/-10) tests/mir_test_framework/CMakeLists.txt (+18/-36) tests/mir_test_framework/executable_path.cpp (+0/-27) tests/mir_test_framework/headless_test.cpp (+27/-5) tests/mir_test_framework/platform_graphics_dummy.cpp (+0/-36) tests/mir_test_framework/stub_client_platform_factory.cpp (+0/-1) tests/mir_test_framework/stub_server_platform_factory.cpp (+0/-72) tests/mir_test_framework/stubbed_graphics_platform.cpp (+7/-11) tests/mir_test_framework/stubbed_server_configuration.cpp (+2/-2) tests/mir_test_framework/symbols-server.map (+0/-8) tests/mir_test_framework/testing_client_options.cpp (+53/-2) tests/unit-tests/CMakeLists.txt (+8/-27) tests/unit-tests/client/CMakeLists.txt (+0/-1) tests/unit-tests/client/test_client_platform.cpp (+4/-4) tests/unit-tests/client/test_probing_client_platform_factory.cpp (+3/-3) tests/unit-tests/graphics/CMakeLists.txt (+0/-1) tests/unit-tests/graphics/android/test_platform.cpp (+0/-26) tests/unit-tests/graphics/mesa/test_platform.cpp (+0/-24) tests/unit-tests/graphics/test_platform_prober.cpp (+0/-215) tests/unit-tests/shared_library_test.cpp (+1/-1) tools/install_on_android.sh (+3/-3) tools/valgrind_suppressions_armhf (+0/-9) |
To merge this branch: | bzr merge lp:~alan-griffiths/mir/revert-c2254-to-fix-1414630 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Alexandros Frantzis (community) | Abstain | ||
Cemil Azizoglu (community) | Approve | ||
Review via email: mp+247580@code.launchpad.net |
Commit message
revert -c2254 (to fix lp:1414630 "mir_demo_server exits immediately with boost bad_any_cast exception")
Description of the change
revert -c2254 (to fix lp:1414630 "mir_demo_server exits immediately with boost bad_any_cast exception")
Alexandros Frantzis (afrantzis) wrote : | # |
If we can fix the problem in a reasonable amount of time I would rather we didn't revert the original commit (i.e. let's wait a bit before reverting).
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2259
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Unmerged revisions
- 2259. By Alan Griffiths
-
merge -r2254..2253
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2015-01-22 15:39:35 +0000 |
3 | +++ CMakeLists.txt 2015-01-26 13:27:35 +0000 |
4 | @@ -30,10 +30,6 @@ |
5 | set(MIR_VERSION_MINOR 11) # This should change at least with every MIRSERVER_ABI |
6 | set(MIR_VERSION_PATCH 0) |
7 | |
8 | -add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR}) |
9 | -add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR}) |
10 | -add_definitions(-DMIR_VERSION_MICRO=${MIR_VERSION_PATCH}) |
11 | - |
12 | set(MIR_VERSION ${MIR_VERSION_MAJOR}.${MIR_VERSION_MINOR}.${MIR_VERSION_PATCH}) |
13 | |
14 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) |
15 | |
16 | === modified file 'debian/control' |
17 | --- debian/control 2015-01-23 16:25:00 +0000 |
18 | +++ debian/control 2015-01-26 13:27:35 +0000 |
19 | @@ -59,8 +59,6 @@ |
20 | Contains the shared library containing the Google Protobuf definitions |
21 | required for Mir clients and servers. |
22 | |
23 | -#TODO: Packaging infrastructure for better dependency generation, |
24 | -# ala pkg-xorg's xviddriver:Provides and ABI detection. |
25 | Package: libmirserver29 |
26 | Section: libs |
27 | Architecture: i386 amd64 armhf arm64 |
28 | @@ -68,7 +66,7 @@ |
29 | Pre-Depends: ${misc:Pre-Depends} |
30 | Depends: ${misc:Depends}, |
31 | ${shlibs:Depends}, |
32 | - mir-platform-graphics-mesa | mir-platform-graphics-android, |
33 | + libmir${platform-driver}-mesa | libmir${platform-driver}-android, |
34 | Description: Display server for Ubuntu - server library |
35 | Mir is a display server running on linux systems, with a focus on efficiency, |
36 | robust operation and a well-defined driver model. |
37 | @@ -268,34 +266,6 @@ |
38 | Contains the shared libraries required for the Mir server and client. |
39 | |
40 | # Longer-term these drivers should move out-of-tree |
41 | -Package: mir-platform-graphics-mesa |
42 | -Section: libs |
43 | -Architecture: i386 amd64 armhf arm64 |
44 | -Multi-Arch: same |
45 | -Pre-Depends: ${misc:Pre-Depends} |
46 | -Depends: ${misc:Depends}, |
47 | - ${shlibs:Depends}, |
48 | -Description: Display server for Ubuntu - platform library for Mesa |
49 | - Mir is a display server running on linux systems, with a focus on efficiency, |
50 | - robust operation and a well-defined driver model. |
51 | - . |
52 | - Contains the shared libraries required for the Mir server to interact with |
53 | - the hardware platform using the Mesa drivers. |
54 | - |
55 | -Package: mir-platform-graphics-android |
56 | -Section: libs |
57 | -Architecture: i386 amd64 armhf |
58 | -Multi-Arch: same |
59 | -Pre-Depends: ${misc:Pre-Depends} |
60 | -Depends: ${misc:Depends}, |
61 | - ${shlibs:Depends}, |
62 | -Description: Display server for Ubuntu - platform library for Android |
63 | - Mir is a display server running on linux systems, with a focus on efficiency, |
64 | - robust operation and a well-defined driver model. |
65 | - . |
66 | - Contains the shared libraries required for the Mir server to interact with |
67 | - the hardware platform using the Android drivers. |
68 | - |
69 | Package: mir-client-platform-mesa |
70 | Section: libs |
71 | Architecture: i386 amd64 armhf arm64 |
72 | @@ -339,14 +309,42 @@ |
73 | Contains the shared libraries required for the Mir clients to interact with |
74 | the underlying hardware platform using the Android drivers. |
75 | |
76 | +Package: libmirplatform6driver-mesa |
77 | +Section: libs |
78 | +Architecture: i386 amd64 armhf arm64 |
79 | +Multi-Arch: same |
80 | +Pre-Depends: ${misc:Pre-Depends} |
81 | +Depends: ${misc:Depends}, |
82 | + ${shlibs:Depends}, |
83 | +Description: Display server for Ubuntu - platform library for Mesa |
84 | + Mir is a display server running on linux systems, with a focus on efficiency, |
85 | + robust operation and a well-defined driver model. |
86 | + . |
87 | + Contains the shared libraries required for the Mir server to interact with |
88 | + the hardware platform using the Mesa drivers. |
89 | + |
90 | +Package: libmirplatform6driver-android |
91 | +Section: libs |
92 | +Architecture: i386 amd64 armhf |
93 | +Multi-Arch: same |
94 | +Pre-Depends: ${misc:Pre-Depends} |
95 | +Depends: ${misc:Depends}, |
96 | + ${shlibs:Depends}, |
97 | +Description: Display server for Ubuntu - platform library for Android |
98 | + Mir is a display server running on linux systems, with a focus on efficiency, |
99 | + robust operation and a well-defined driver model. |
100 | + . |
101 | + Contains the shared libraries required for the Mir server to interact with |
102 | + the hardware platform using the Android drivers. |
103 | + |
104 | Package: mir-graphics-drivers-desktop |
105 | Section: libs |
106 | Architecture: i386 amd64 armhf arm64 |
107 | Multi-Arch: same |
108 | Pre-Depends: ${misc:Pre-Depends} |
109 | Depends: ${misc:Depends}, |
110 | - mir-platform-graphics-mesa, |
111 | - mir-client-platform-mesa, |
112 | + libmir${platform-driver}-mesa, |
113 | + mir-client-platform-mesa |
114 | Description: Display server for Ubuntu - desktop driver metapackage |
115 | Mir is a display server running on linux systems, with a focus on efficiency, |
116 | robust operation and a well-defined driver model. |
117 | @@ -360,8 +358,8 @@ |
118 | Multi-Arch: same |
119 | Pre-Depends: ${misc:Pre-Depends} |
120 | Depends: ${misc:Depends}, |
121 | - mir-platform-graphics-android, |
122 | - mir-client-platform-android, |
123 | + libmir${platform-driver}-android, |
124 | + mir-client-platform-android |
125 | Description: Display server for Ubuntu - android driver metapackage |
126 | Mir is a display server running on linux systems, with a focus on efficiency, |
127 | robust operation and a well-defined driver model. |
128 | |
129 | === added file 'debian/libmirplatform6driver-android.install' |
130 | --- debian/libmirplatform6driver-android.install 1970-01-01 00:00:00 +0000 |
131 | +++ debian/libmirplatform6driver-android.install 2015-01-26 13:27:35 +0000 |
132 | @@ -0,0 +1,1 @@ |
133 | +usr/lib/*/mir/platform*driver/android/* |
134 | |
135 | === added file 'debian/libmirplatform6driver-mesa.install' |
136 | --- debian/libmirplatform6driver-mesa.install 1970-01-01 00:00:00 +0000 |
137 | +++ debian/libmirplatform6driver-mesa.install 2015-01-26 13:27:35 +0000 |
138 | @@ -0,0 +1,1 @@ |
139 | +usr/lib/*/mir/platform*driver/mesa/* |
140 | |
141 | === removed file 'debian/mir-platform-graphics-android.install' |
142 | --- debian/mir-platform-graphics-android.install 2015-01-14 13:09:48 +0000 |
143 | +++ debian/mir-platform-graphics-android.install 1970-01-01 00:00:00 +0000 |
144 | @@ -1,1 +0,0 @@ |
145 | -usr/lib/*/mir/server-platform/graphics-android.so |
146 | |
147 | === removed file 'debian/mir-platform-graphics-mesa.install' |
148 | --- debian/mir-platform-graphics-mesa.install 2015-01-14 13:09:48 +0000 |
149 | +++ debian/mir-platform-graphics-mesa.install 1970-01-01 00:00:00 +0000 |
150 | @@ -1,1 +0,0 @@ |
151 | -usr/lib/*/mir/server-platform/graphics-mesa.so |
152 | |
153 | === modified file 'debian/mir-test-tools.install' |
154 | --- debian/mir-test-tools.install 2015-01-19 06:55:41 +0000 |
155 | +++ debian/mir-test-tools.install 2015-01-26 13:27:35 +0000 |
156 | @@ -5,5 +5,5 @@ |
157 | usr/bin/mir_performance_tests |
158 | usr/lib/*/mir/tools/libmirclientlttng.so |
159 | usr/lib/*/mir/tools/libmirserverlttng.so |
160 | -usr/lib/*/mir/server-platform/graphics-dummy.so |
161 | +usr/lib/*/libmirplatformstub.so |
162 | usr/lib/*/mir/client-platform/dummy.so |
163 | |
164 | === modified file 'debian/rules' |
165 | --- debian/rules 2015-01-19 06:55:41 +0000 |
166 | +++ debian/rules 2015-01-26 13:27:35 +0000 |
167 | @@ -13,6 +13,8 @@ |
168 | export CC=$(DEB_HOST_GNU_TYPE)-gcc-4.9 |
169 | export CXX=$(DEB_HOST_GNU_TYPE)-g++-4.9 |
170 | |
171 | +export PLATFORM_DRIVER = platform6driver |
172 | + |
173 | %: |
174 | dh $@ --parallel --fail-missing |
175 | |
176 | @@ -55,4 +57,15 @@ |
177 | # Delete the symlink so that --fail-missing doesn't think we've missed it |
178 | # accidentally. |
179 | -rm debian/tmp/usr/lib/*/libmirprotobuf.so |
180 | - dh_install --fail-missing |
181 | + dh_install --fail-missing \ |
182 | + -Xusr/lib/$(DEB_HOST_MULTIARCH)/libmir$(PLATFORM_DRIVER).so |
183 | + sh debian/install_ld_so_conf.sh $(DEB_HOST_ARCH) $(DEB_HOST_MULTIARCH) |
184 | + |
185 | +override_dh_installdeb: |
186 | + sh debian/create_postinst_prerm_scripts.sh \ |
187 | + $(DEB_HOST_ARCH) $(DEB_HOST_MULTIARCH) |
188 | + dh_installdeb |
189 | + |
190 | +override_dh_gencontrol: |
191 | + dh_gencontrol -- \ |
192 | + -Vplatform-driver=$(PLATFORM_DRIVER) |
193 | |
194 | === modified file 'include/platform/mir/graphics/platform.h' |
195 | --- include/platform/mir/graphics/platform.h 2015-01-19 06:55:41 +0000 |
196 | +++ include/platform/mir/graphics/platform.h 2015-01-26 13:27:35 +0000 |
197 | @@ -24,8 +24,6 @@ |
198 | #include <EGL/egl.h> |
199 | #include <memory> |
200 | |
201 | -#include "mir/module_properties.h" |
202 | - |
203 | namespace mir |
204 | { |
205 | class EmergencyCleanupRegistry; |
206 | @@ -95,25 +93,6 @@ |
207 | }; |
208 | |
209 | /** |
210 | - * A measure of how well a platform supports a device |
211 | - * |
212 | - * \note This is compared as an integer; best + 1 is a valid PlatformPriority that |
213 | - * will be used in preference to a module that reports best. |
214 | - * Platform modules distributed with Mir will never use a priority higher |
215 | - * than best. |
216 | - */ |
217 | -enum PlatformPriority : uint32_t |
218 | -{ |
219 | - unsupported = 0, /**< Unable to function at all on this device */ |
220 | - supported = 128, /**< Capable of providing a functioning Platform on this device, |
221 | - * possibly with degraded performance or features. |
222 | - */ |
223 | - best = 256 /**< Capable of providing a Platform with the best features and |
224 | - * performance this device is capable of. |
225 | - */ |
226 | -}; |
227 | - |
228 | -/** |
229 | * Function prototype used to return a new host graphics platform. The host graphics platform |
230 | * is the system entity that owns the physical display and is a mir host server. |
231 | * |
232 | @@ -163,17 +142,8 @@ |
233 | */ |
234 | extern "C" typedef void(*AddPlatformOptions)( |
235 | boost::program_options::options_description& config); |
236 | -extern "C" void add_graphics_platform_options( |
237 | +extern "C" void add_platform_options( |
238 | boost::program_options::options_description& config); |
239 | - |
240 | -// TODO: We actually need to be more granular here; on a device with more |
241 | -// than one graphics system we may need a different platform per GPU, |
242 | -// so we should be associating platforms with graphics devices in some way |
243 | -extern "C" typedef PlatformPriority(*PlatformProbe)(); |
244 | -extern "C" PlatformPriority probe_graphcis_platform(); |
245 | - |
246 | -extern "C" typedef ModuleProperties const*(*DescribeModule)(); |
247 | -extern "C" ModuleProperties const* describe_graphics_module(); |
248 | } |
249 | } |
250 | |
251 | |
252 | === removed file 'include/platform/mir/module_properties.h' |
253 | --- include/platform/mir/module_properties.h 2014-12-10 01:05:27 +0000 |
254 | +++ include/platform/mir/module_properties.h 1970-01-01 00:00:00 +0000 |
255 | @@ -1,37 +0,0 @@ |
256 | -/* |
257 | - * Copyright © 2014 Canonical Ltd. |
258 | - * |
259 | - * This program is free software: you can redistribute it and/or modify it |
260 | - * under the terms of the GNU Lesser General Public License version 3, |
261 | - * as published by the Free Software Foundation. |
262 | - * |
263 | - * This program is distributed in the hope that it will be useful, |
264 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
265 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
266 | - * GNU Lesser General Public License for more details. |
267 | - * |
268 | - * You should have received a copy of the GNU Lesser General Public License |
269 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
270 | - * |
271 | - * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
272 | - */ |
273 | - |
274 | -#ifndef MIR_PLATFORM_MODULE_PROPERTIES_H_ |
275 | -#define MIR_PLATFORM_MODULE_PROPERTIES_H_ |
276 | - |
277 | -namespace mir |
278 | -{ |
279 | - |
280 | -/** |
281 | - * Describes a platform module |
282 | - */ |
283 | -struct ModuleProperties |
284 | -{ |
285 | - char const* name; |
286 | - int major_version; |
287 | - int minor_version; |
288 | - int micro_version; |
289 | -}; |
290 | -} |
291 | - |
292 | -#endif /* MIR_PLATFORM_MODULE_PROPERTIES_H_ */ |
293 | |
294 | === modified file 'platform-ABI-sha1sums' |
295 | --- platform-ABI-sha1sums 2015-01-23 16:46:01 +0000 |
296 | +++ platform-ABI-sha1sums 2015-01-26 13:27:35 +0000 |
297 | @@ -48,10 +48,9 @@ |
298 | 5dc095474ef3e294c0aa4008e9ed997bdb21d34c include/platform/mir/graphics/gl_config.h |
299 | d0442a5d5d88a4be6e3e1f99e433c1c43a86bfce include/platform/mir/graphics/gl_context.h |
300 | 979d2c1ac723ccef538d9a378228a02b0f173bd7 include/platform/mir/graphics/graphic_buffer_allocator.h |
301 | -d3da5e58e8e1d5953b459d18f9dfe628fe0a25bd include/platform/mir/graphics/platform.h |
302 | +5d72b98aecb0611060dec8995dbe017a342f7069 include/platform/mir/graphics/platform.h |
303 | d1ba61e687d75103e9e7aa0409080214f56a990b include/platform/mir/graphics/platform_ipc_operations.h |
304 | 1b77fb3290af00dc7d1c11dcc5388972dacb9ec3 include/platform/mir/graphics/platform_ipc_package.h |
305 | f0db0484b8ccc9091e73c80a2a200cb436b48bfb include/platform/mir/graphics/platform_operation_message.h |
306 | f18876766861e5d4f5ca999dbd176fe1fc520594 include/platform/mir/graphics/renderable.h |
307 | -5b3872b04b3686fe9a244572ca0787596431a2cb include/platform/mir/module_properties.h |
308 | b45f14082c4f8b29efaa1b13de795dcb29deb738 include/platform/mir/options/option.h |
309 | |
310 | === modified file 'server-ABI-sha1sums' |
311 | --- server-ABI-sha1sums 2015-01-23 16:46:01 +0000 |
312 | +++ server-ABI-sha1sums 2015-01-26 13:27:35 +0000 |
313 | @@ -48,12 +48,11 @@ |
314 | 5dc095474ef3e294c0aa4008e9ed997bdb21d34c include/platform/mir/graphics/gl_config.h |
315 | d0442a5d5d88a4be6e3e1f99e433c1c43a86bfce include/platform/mir/graphics/gl_context.h |
316 | 979d2c1ac723ccef538d9a378228a02b0f173bd7 include/platform/mir/graphics/graphic_buffer_allocator.h |
317 | -d3da5e58e8e1d5953b459d18f9dfe628fe0a25bd include/platform/mir/graphics/platform.h |
318 | +5d72b98aecb0611060dec8995dbe017a342f7069 include/platform/mir/graphics/platform.h |
319 | d1ba61e687d75103e9e7aa0409080214f56a990b include/platform/mir/graphics/platform_ipc_operations.h |
320 | 1b77fb3290af00dc7d1c11dcc5388972dacb9ec3 include/platform/mir/graphics/platform_ipc_package.h |
321 | f0db0484b8ccc9091e73c80a2a200cb436b48bfb include/platform/mir/graphics/platform_operation_message.h |
322 | f18876766861e5d4f5ca999dbd176fe1fc520594 include/platform/mir/graphics/renderable.h |
323 | -5b3872b04b3686fe9a244572ca0787596431a2cb include/platform/mir/module_properties.h |
324 | b45f14082c4f8b29efaa1b13de795dcb29deb738 include/platform/mir/options/option.h |
325 | f4030e400baf8baa9c38e7c6ec6b4a5ad7134aeb include/server/mir/compositor/compositor.h |
326 | a9f284ba4b05d58fd3eeb628d1f56fe4ac188526 include/server/mir/compositor/compositor_id.h |
327 | |
328 | === modified file 'src/CMakeLists.txt' |
329 | --- src/CMakeLists.txt 2015-01-22 15:39:35 +0000 |
330 | +++ src/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
331 | @@ -2,6 +2,12 @@ |
332 | # and the platform implementations. |
333 | set(MIRPLATFORM_ABI 6) |
334 | |
335 | +set(PLATFORM_DRIVER platform${MIRPLATFORM_ABI}driver) |
336 | +set(MIR_PLATFORM_DRIVER mir${PLATFORM_DRIVER}) |
337 | +set(MIR_PLATFORM_DRIVER_BINARY lib${MIR_PLATFORM_DRIVER}.so |
338 | + CACHE STRING "File name of Mir server platform drivers") |
339 | +add_definitions(-DMIR_PLATFORM_DRIVER_BINARY="${MIR_PLATFORM_DRIVER_BINARY}") |
340 | + |
341 | # We need MIR_CLIENT_PLATFORM_PATH in both libmirclient and the platform |
342 | # implementations |
343 | set(MIR_CLIENT_PLATFORM_PATH |
344 | @@ -41,4 +47,3 @@ |
345 | set(MIR_COMMON_OBJECTS ${MIR_COMMON_OBJECTS} PARENT_SCOPE) |
346 | set(MIR_COMMON_REFERENCES ${MIR_COMMON_REFERENCES} PARENT_SCOPE) |
347 | set(MIR_CLIENT_PLATFORM_PATH ${MIR_CLIENT_PLATFORM_PATH} PARENT_SCOPE) |
348 | -set(MIR_SERVER_PLATFORM_PATH ${MIR_SERVER_PLATFORM_PATH} PARENT_SCOPE) |
349 | |
350 | === modified file 'src/client/default_connection_configuration.cpp' |
351 | --- src/client/default_connection_configuration.cpp 2015-01-19 06:55:41 +0000 |
352 | +++ src/client/default_connection_configuration.cpp 2015-01-26 13:27:35 +0000 |
353 | @@ -226,7 +226,7 @@ |
354 | [this] () -> std::shared_ptr<mir::SharedLibraryProberReport> |
355 | { |
356 | auto val_raw = getenv("MIR_CLIENT_SHARED_LIBRARY_PROBER_REPORT"); |
357 | - std::string const val{val_raw ? val_raw : log_opt_val}; |
358 | + std::string const val{val_raw ? val_raw : off_opt_val}; |
359 | if (val == log_opt_val) |
360 | return std::make_shared<mir::logging::SharedLibraryProberReport>(the_logger()); |
361 | else if (val == lttng_opt_val) |
362 | |
363 | === modified file 'src/common/graphics/android/mir_native_window.cpp' |
364 | --- src/common/graphics/android/mir_native_window.cpp 2015-01-19 06:55:41 +0000 |
365 | +++ src/common/graphics/android/mir_native_window.cpp 2015-01-26 13:27:35 +0000 |
366 | @@ -20,6 +20,7 @@ |
367 | #include "mir/graphics/android/android_driver_interpreter.h" |
368 | #include "mir/graphics/android/sync_fence.h" |
369 | |
370 | +#include <iostream> |
371 | #include <boost/exception/diagnostic_information.hpp> |
372 | |
373 | namespace mg=mir::graphics; |
374 | |
375 | === removed file 'src/include/platform/mir/graphics/platform_probe.h' |
376 | --- src/include/platform/mir/graphics/platform_probe.h 2014-12-17 13:48:10 +0000 |
377 | +++ src/include/platform/mir/graphics/platform_probe.h 1970-01-01 00:00:00 +0000 |
378 | @@ -1,37 +0,0 @@ |
379 | -/* |
380 | - * Copyright © 2014 Canonical Ltd. |
381 | - * |
382 | - * This program is free software: you can redistribute it and/or modify it |
383 | - * under the terms of the GNU Lesser General Public License version 3, |
384 | - * as published by the Free Software Foundation. |
385 | - * |
386 | - * This program is distributed in the hope that it will be useful, |
387 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
388 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
389 | - * GNU Lesser General Public License for more details. |
390 | - * |
391 | - * You should have received a copy of the GNU Lesser General Public License |
392 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
393 | - * |
394 | - * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
395 | - */ |
396 | - |
397 | -#ifndef MIR_GRAPHICS_PLATFORM_PROBE_H_ |
398 | -#define MIR_GRAPHICS_PLATFORM_PROBE_H_ |
399 | - |
400 | -#include <vector> |
401 | -#include <memory> |
402 | -#include "mir/shared_library.h" |
403 | - |
404 | -namespace mir |
405 | -{ |
406 | -namespace graphics |
407 | -{ |
408 | -class Platform; |
409 | - |
410 | -std::shared_ptr<SharedLibrary> module_for_device(std::vector<std::shared_ptr<SharedLibrary>> const& modules); |
411 | - |
412 | -} |
413 | -} |
414 | - |
415 | -#endif // MIR_GRAPHICS_PLATFORM_PROBE_H_ |
416 | |
417 | === modified file 'src/include/platform/mir/options/configuration.h' |
418 | --- src/include/platform/mir/options/configuration.h 2015-01-19 06:55:41 +0000 |
419 | +++ src/include/platform/mir/options/configuration.h 2015-01-26 13:27:35 +0000 |
420 | @@ -33,7 +33,6 @@ |
421 | extern char const* const enable_input_opt; |
422 | extern char const* const session_mediator_report_opt; |
423 | extern char const* const msg_processor_report_opt; |
424 | -extern char const* const shared_library_prober_report_opt; |
425 | extern char const* const compositor_report_opt; |
426 | extern char const* const display_report_opt; |
427 | extern char const* const legacy_input_report_opt; |
428 | @@ -54,7 +53,6 @@ |
429 | extern char const* const lttng_opt_value; |
430 | |
431 | extern char const* const platform_graphics_lib; |
432 | -extern char const* const platform_path; |
433 | |
434 | class Configuration |
435 | { |
436 | |
437 | === modified file 'src/include/platform/mir/options/default_configuration.h' |
438 | --- src/include/platform/mir/options/default_configuration.h 2015-01-19 06:55:41 +0000 |
439 | +++ src/include/platform/mir/options/default_configuration.h 2015-01-26 13:27:35 +0000 |
440 | @@ -25,7 +25,6 @@ |
441 | |
442 | namespace mir |
443 | { |
444 | -class SharedLibrary; |
445 | namespace options |
446 | { |
447 | class DefaultConfiguration : public Configuration |
448 | @@ -43,10 +42,6 @@ |
449 | boost::program_options::options_description_easy_init add_options(); |
450 | |
451 | private: |
452 | - // MUST be the first member to ensure it's destroyed last, lest we attempt to |
453 | - // call destructors in DSOs we've unloaded. |
454 | - std::shared_ptr<SharedLibrary> platform_graphics_library; |
455 | - |
456 | void add_platform_options(); |
457 | // accessed via the base interface, when access to add_options() has been "lost" |
458 | std::shared_ptr<options::Option> the_options() const override; |
459 | |
460 | === added file 'src/include/platform/mir/shared_library_loader.h' |
461 | --- src/include/platform/mir/shared_library_loader.h 1970-01-01 00:00:00 +0000 |
462 | +++ src/include/platform/mir/shared_library_loader.h 2015-01-26 13:27:35 +0000 |
463 | @@ -0,0 +1,28 @@ |
464 | +/* |
465 | + * Copyright © 2013 Canonical Ltd. |
466 | + * |
467 | + * This program is free software: you can redistribute it and/or modify it |
468 | + * under the terms of the GNU Lesser General Public License version 3, |
469 | + * as published by the Free Software Foundation. |
470 | + * |
471 | + * This program is distributed in the hope that it will be useful, |
472 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
473 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
474 | + * GNU Lesser General Public License for more details. |
475 | + * |
476 | + * You should have received a copy of the GNU Lesser General Public License |
477 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
478 | + * |
479 | + * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
480 | + */ |
481 | + |
482 | +#ifndef MIR_SHARED_LIBRARY_LOADER_H_ |
483 | +#define MIR_SHARED_LIBRARY_LOADER_H_ |
484 | + |
485 | +#include <string> |
486 | +namespace mir |
487 | +{ |
488 | +class SharedLibrary; |
489 | +SharedLibrary const* load_library(std::string const& libname); |
490 | +} |
491 | +#endif |
492 | |
493 | === modified file 'src/include/server/mir/default_server_configuration.h' |
494 | --- src/include/server/mir/default_server_configuration.h 2015-01-23 16:46:01 +0000 |
495 | +++ src/include/server/mir/default_server_configuration.h 2015-01-26 13:27:35 +0000 |
496 | @@ -40,7 +40,6 @@ |
497 | namespace mir |
498 | { |
499 | class ServerActionQueue; |
500 | -class SharedLibraryProberReport; |
501 | |
502 | namespace compositor |
503 | { |
504 | @@ -316,7 +315,6 @@ |
505 | |
506 | virtual std::shared_ptr<time::Clock> the_clock(); |
507 | virtual std::shared_ptr<ServerActionQueue> the_server_action_queue(); |
508 | - virtual std::shared_ptr<SharedLibraryProberReport> the_shared_library_prober_report(); |
509 | |
510 | protected: |
511 | std::shared_ptr<options::Option> the_options() const; |
512 | @@ -425,7 +423,6 @@ |
513 | CachedPtr<scene::CoordinateTranslator> coordinate_translator; |
514 | CachedPtr<EmergencyCleanup> emergency_cleanup; |
515 | CachedPtr<shell::HostLifecycleEventListener> host_lifecycle_event_listener; |
516 | - CachedPtr<SharedLibraryProberReport> shared_library_prober_report; |
517 | |
518 | private: |
519 | std::shared_ptr<options::Configuration> const configuration_options; |
520 | |
521 | === modified file 'src/platform/CMakeLists.txt' |
522 | --- src/platform/CMakeLists.txt 2015-01-19 06:55:41 +0000 |
523 | +++ src/platform/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
524 | @@ -7,10 +7,12 @@ |
525 | |
526 | set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map) |
527 | |
528 | -add_definitions(-DMIR_SERVER_PLATFORM_PATH="${MIR_SERVER_PLATFORM_PATH}") |
529 | -add_definitions(-DMIR_SERVER_GRAPHICS_PLATFORM_VERSION="${MIR_SERVER_GRAPHICS_PLATFORM_VERSION}") |
530 | +add_library(mirplatformobjects OBJECT |
531 | + shared_library_loader.cpp |
532 | +) |
533 | |
534 | set(MIR_PLATFORM_OBJECTS |
535 | + $<TARGET_OBJECTS:mirplatformobjects> |
536 | $<TARGET_OBJECTS:mirplatformgraphicscommon> |
537 | $<TARGET_OBJECTS:miroptions> |
538 | $<TARGET_OBJECTS:mirfatal> |
539 | @@ -29,19 +31,17 @@ |
540 | ) |
541 | |
542 | target_link_libraries(mirplatform |
543 | - |
544 | mircommon |
545 | ${MIR_PLATFORM_REFERENCES} |
546 | ) |
547 | |
548 | -set_target_properties( |
549 | - mirplatform |
550 | - |
551 | +set_target_properties(mirplatform |
552 | PROPERTIES |
553 | SOVERSION ${MIRPLATFORM_ABI} |
554 | LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}" |
555 | ) |
556 | |
557 | + |
558 | install(TARGETS mirplatform LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
559 | |
560 | add_subdirectory(graphics/) |
561 | |
562 | === modified file 'src/platform/graphics/CMakeLists.txt' |
563 | --- src/platform/graphics/CMakeLists.txt 2015-01-19 06:55:41 +0000 |
564 | +++ src/platform/graphics/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
565 | @@ -12,7 +12,6 @@ |
566 | gl_program.cpp |
567 | gl_texture.cpp |
568 | tessellation_helpers.cpp |
569 | - platform_probe.cpp |
570 | ) |
571 | |
572 | add_library(mirplatformgraphicscommon OBJECT |
573 | |
574 | === removed file 'src/platform/graphics/platform_probe.cpp' |
575 | --- src/platform/graphics/platform_probe.cpp 2014-12-17 13:48:10 +0000 |
576 | +++ src/platform/graphics/platform_probe.cpp 1970-01-01 00:00:00 +0000 |
577 | @@ -1,59 +0,0 @@ |
578 | -/* |
579 | - * Copyright © 2014 Canonical Ltd. |
580 | - * |
581 | - * This program is free software: you can redistribute it and/or modify it |
582 | - * under the terms of the GNU Lesser General Public License version 3, |
583 | - * as published by the Free Software Foundation. |
584 | - * |
585 | - * This program is distributed in the hope that it will be useful, |
586 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
587 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
588 | - * GNU Lesser General Public License for more details. |
589 | - * |
590 | - * You should have received a copy of the GNU Lesser General Public License |
591 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
592 | - * |
593 | - * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
594 | - */ |
595 | - |
596 | -#include "mir/logging/logger.h" |
597 | -#include "mir/graphics/platform.h" |
598 | -#include "mir/graphics/platform_probe.h" |
599 | - |
600 | -#include <string> |
601 | -#include <boost/throw_exception.hpp> |
602 | - |
603 | -namespace ml = mir::logging; |
604 | - |
605 | -std::shared_ptr<mir::SharedLibrary> |
606 | -mir::graphics::module_for_device(std::vector<std::shared_ptr<SharedLibrary>> const& modules) |
607 | -{ |
608 | - mir::graphics::PlatformPriority best_priority_so_far = mir::graphics::unsupported; |
609 | - std::shared_ptr<mir::SharedLibrary> best_module_so_far; |
610 | - for (auto& module : modules) |
611 | - { |
612 | - try |
613 | - { |
614 | - auto probe = module->load_function<mir::graphics::PlatformProbe>("probe_graphics_platform", |
615 | - MIR_SERVER_GRAPHICS_PLATFORM_VERSION); |
616 | - auto module_priority = probe(); |
617 | - if (module_priority > best_priority_so_far) |
618 | - { |
619 | - best_priority_so_far = module_priority; |
620 | - best_module_so_far = module; |
621 | - } |
622 | - } |
623 | - catch (std::runtime_error const& err) |
624 | - { |
625 | - // Tried to probe a SharedLibrary that isn't a platform module? |
626 | - ml::log(ml::Severity::warning, |
627 | - std::string{"Failed to probe module. Not a platform library? Error: "} + err.what(), |
628 | - "Platform Probing"); |
629 | - } |
630 | - } |
631 | - if (best_priority_so_far > mir::graphics::unsupported) |
632 | - { |
633 | - return best_module_so_far; |
634 | - } |
635 | - BOOST_THROW_EXCEPTION((std::runtime_error{"Failed to find platform for current system"})); |
636 | -} |
637 | |
638 | === modified file 'src/platform/options/default_configuration.cpp' |
639 | --- src/platform/options/default_configuration.cpp 2015-01-19 06:55:41 +0000 |
640 | +++ src/platform/options/default_configuration.cpp 2015-01-26 13:27:35 +0000 |
641 | @@ -17,13 +17,11 @@ |
642 | */ |
643 | |
644 | #include "mir/shared_library.h" |
645 | +#include "mir/shared_library_loader.h" |
646 | #include "mir/options/default_configuration.h" |
647 | #include "mir/graphics/platform.h" |
648 | #include "mir/default_configuration.h" |
649 | #include "mir/abnormal_exit.h" |
650 | -#include "mir/shared_library_prober.h" |
651 | -#include "mir/logging/null_shared_library_prober_report.h" |
652 | -#include "mir/graphics/platform_probe.h" |
653 | |
654 | #include <dlfcn.h> |
655 | |
656 | @@ -41,7 +39,6 @@ |
657 | char const* const mo::connector_report_opt = "connector-report"; |
658 | char const* const mo::scene_report_opt = "scene-report"; |
659 | char const* const mo::input_report_opt = "input-report"; |
660 | -char const* const mo::shared_library_prober_report_opt = "shared-library-prober-report"; |
661 | char const* const mo::host_socket_opt = "host-socket"; |
662 | char const* const mo::frontend_threads_opt = "ipc-thread-pool"; |
663 | char const* const mo::name_opt = "name"; |
664 | @@ -55,12 +52,12 @@ |
665 | char const* const mo::lttng_opt_value = "lttng"; |
666 | |
667 | char const* const mo::platform_graphics_lib = "platform-graphics-lib"; |
668 | -char const* const mo::platform_path = "platform-path"; |
669 | |
670 | namespace |
671 | { |
672 | int const default_ipc_threads = 1; |
673 | bool const enable_input_default = true; |
674 | +char const* const default_platform_graphics_lib = MIR_PLATFORM_DRIVER_BINARY; |
675 | |
676 | // Hack around the way Qt loads mir: |
677 | // platform_api and therefore Mir are loaded via dlopen(..., RTLD_LOCAL). |
678 | @@ -117,10 +114,8 @@ |
679 | "Socket filename [string:default=$XDG_RUNTIME_DIR/mir_socket or /tmp/mir_socket]") |
680 | (no_server_socket_opt, "Do not provide a socket filename for client connections") |
681 | (prompt_socket_opt, "Provide a \"..._trusted\" filename for prompt helper connections") |
682 | - (platform_graphics_lib, po::value<std::string>(), |
683 | - "Library to use for platform graphics support (default: autodetect)") |
684 | - (platform_path, po::value<std::string>()->default_value(MIR_SERVER_PLATFORM_PATH), |
685 | - "Directory to look for platform libraries (default: " MIR_SERVER_PLATFORM_PATH ")") |
686 | + (platform_graphics_lib, po::value<std::string>()->default_value(default_platform_graphics_lib), |
687 | + "Library to use for platform graphics support") |
688 | (enable_input_opt, po::value<bool>()->default_value(enable_input_default), |
689 | "Enable input.") |
690 | (compositor_report_opt, po::value<std::string>()->default_value(off_opt_value), |
691 | @@ -139,8 +134,6 @@ |
692 | "How to handle the MessageProcessor report. [{log,lttng,off}]") |
693 | (scene_report_opt, po::value<std::string>()->default_value(off_opt_value), |
694 | "How to handle the scene report. [{log,lttng,off}]") |
695 | - (shared_library_prober_report_opt, po::value<std::string>()->default_value(log_opt_value), |
696 | - "How to handle the SharedLibraryProber report. [{log,lttng,off}]") |
697 | (frontend_threads_opt, po::value<int>()->default_value(default_ipc_threads), |
698 | "threads in frontend thread pool.") |
699 | (name_opt, po::value<std::string>(), |
700 | @@ -163,48 +156,26 @@ |
701 | po::options_description program_options; |
702 | program_options.add_options() |
703 | (platform_graphics_lib, |
704 | - po::value<std::string>(), ""); |
705 | - program_options.add_options() |
706 | - (platform_path, |
707 | - po::value<std::string>()->default_value(MIR_SERVER_PLATFORM_PATH), |
708 | - ""); |
709 | + po::value<std::string>()->default_value(default_platform_graphics_lib), ""); |
710 | mo::ProgramOption options; |
711 | options.parse_arguments(program_options, argc, argv); |
712 | |
713 | + std::string graphics_libname; |
714 | + auto env_libname = ::getenv("MIR_SERVER_PLATFORM_GRAPHICS_LIB"); |
715 | + if (!options.is_set(platform_graphics_lib) && env_libname) |
716 | + { |
717 | + graphics_libname = std::string{env_libname}; |
718 | + } |
719 | + else |
720 | + { |
721 | + graphics_libname = options.get<std::string>(platform_graphics_lib); |
722 | + } |
723 | + |
724 | ensure_loaded_with_rtld_global(); |
725 | |
726 | - // TODO: We should just load all the platform plugins we can and present their options. |
727 | - auto env_libname = ::getenv("MIR_SERVER_PLATFORM_GRAPHICS_LIB"); |
728 | - auto env_libpath = ::getenv("MIR_SERVER_PLATFORM_PATH"); |
729 | - try |
730 | - { |
731 | - if (options.is_set(platform_graphics_lib)) |
732 | - { |
733 | - platform_graphics_library = std::make_shared<mir::SharedLibrary>(options.get<std::string>(platform_graphics_lib)); |
734 | - } |
735 | - else if (env_libname) |
736 | - { |
737 | - platform_graphics_library = std::make_shared<mir::SharedLibrary>(std::string{env_libname}); |
738 | - } |
739 | - else |
740 | - { |
741 | - mir::logging::NullSharedLibraryProberReport null_report; |
742 | - auto const plugin_path = env_libpath ? env_libpath : options.get<std::string>(platform_path); |
743 | - auto plugins = mir::libraries_for_path(plugin_path, null_report); |
744 | - platform_graphics_library = mir::graphics::module_for_device(plugins); |
745 | - } |
746 | - |
747 | - auto add_platform_options = platform_graphics_library->load_function<mir::graphics::AddPlatformOptions>("add_graphics_platform_options"); |
748 | - add_platform_options(*this->program_options); |
749 | - } |
750 | - catch(...) |
751 | - { |
752 | - // We don't actually care at this point if this failed. |
753 | - // Maybe we've been pointed at the wrong place. Maybe this platform doesn't actually |
754 | - // *have* platform-specific options. |
755 | - // Regardless, if we need a platform and can't find one then we'll bail later |
756 | - // in startup with a useful error. |
757 | - } |
758 | + auto graphics_lib = load_library(graphics_libname); |
759 | + auto add_platform_options = graphics_lib->load_function<mir::graphics::AddPlatformOptions>(std::string("add_platform_options")); |
760 | + add_platform_options(*this->program_options); |
761 | } |
762 | |
763 | boost::program_options::options_description_easy_init mo::DefaultConfiguration::add_options() |
764 | |
765 | === modified file 'src/platform/symbols.map' |
766 | --- src/platform/symbols.map 2015-01-21 10:31:21 +0000 |
767 | +++ src/platform/symbols.map 2015-01-26 13:27:35 +0000 |
768 | @@ -6,6 +6,7 @@ |
769 | mir::fatal_error*; |
770 | mir::fatal_error_abort*; |
771 | mir::fatal_error_except*; |
772 | + mir::graphics::add_platform_options*; |
773 | mir::graphics::BufferBasic::BufferBasic*; |
774 | mir::graphics::Buffer::Buffer*; |
775 | mir::graphics::Buffer::can_bypass*; |
776 | @@ -16,6 +17,8 @@ |
777 | mir::graphics::Buffer::size*; |
778 | mir::graphics::Buffer::stride*; |
779 | mir::graphics::Buffer::write*; |
780 | + mir::graphics::create_guest_platform*; |
781 | + mir::graphics::create_host_platform*; |
782 | mir::graphics::Cursor::?Cursor*; |
783 | mir::graphics::Cursor::Cursor*; |
784 | mir::graphics::Cursor::hide*; |
785 | @@ -78,7 +81,6 @@ |
786 | mir::graphics::GraphicBufferAllocator::GraphicBufferAllocator*; |
787 | mir::graphics::GraphicBufferAllocator::operator*; |
788 | mir::graphics::GraphicBufferAllocator::supported_pixel_formats*; |
789 | - mir::graphics::module_for_device*; |
790 | mir::graphics::operator*; |
791 | mir::graphics::Platform::create_buffer_allocator*; |
792 | mir::graphics::Platform::create_display*; |
793 | @@ -125,7 +127,6 @@ |
794 | mir::options::glog_log_dir*; |
795 | mir::options::glog_minloglevel*; |
796 | mir::options::glog_stderrthreshold*; |
797 | - mir::options::platform_path*; |
798 | mir::options::host_socket_opt*; |
799 | mir::options::input_report_opt*; |
800 | mir::options::legacy_input_report_opt*; |
801 | @@ -153,7 +154,6 @@ |
802 | mir::options::scene_report_opt*; |
803 | mir::options::server_socket_opt*; |
804 | mir::options::session_mediator_report_opt*; |
805 | - mir::options::shared_library_prober_report_opt*; |
806 | mir::options::touchspots_opt*; |
807 | non-virtual?thunk?to?mir::graphics::Cursor::?Cursor*; |
808 | non-virtual?thunk?to?mir::graphics::CursorImage::?CursorImage*; |
809 | |
810 | === modified file 'src/platforms/CMakeLists.txt' |
811 | --- src/platforms/CMakeLists.txt 2015-01-22 15:39:35 +0000 |
812 | +++ src/platforms/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
813 | @@ -1,19 +1,3 @@ |
814 | -# This needs to change whenever the ABI between the platform |
815 | -# modules and the server changes in an incompatible way. |
816 | -# This ABI is much smaller than the full libmirplatform ABI. |
817 | -# |
818 | -# TODO: Add an extra driver-ABI check target. |
819 | -set(MIR_SERVER_GRAPHICS_PLATFORM_VERSION "MIR_GRAPHICS_PLATFORM_1") |
820 | -set(MIR_SERVER_GRAPHICS_PLATFORM_VERSION ${MIR_SERVER_GRAPHICS_PLATFORM_VERSION} PARENT_SCOPE) |
821 | - |
822 | -set(MIR_SERVER_PLATFORM_PATH |
823 | - ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/mir/server-platform |
824 | -) |
825 | -set(MIR_SERVER_PLATFORM_PATH |
826 | - ${MIR_SERVER_PLATFORM_PATH} |
827 | - PARENT_SCOPE |
828 | -) |
829 | - |
830 | set(server_common_include_dirs |
831 | ${PROJECT_SOURCE_DIR}/include/platform |
832 | ) |
833 | |
834 | === modified file 'src/platforms/android/server/CMakeLists.txt' |
835 | --- src/platforms/android/server/CMakeLists.txt 2015-01-22 15:39:35 +0000 |
836 | +++ src/platforms/android/server/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
837 | @@ -38,17 +38,20 @@ |
838 | ipc_operations.cpp |
839 | hwc_blanking_control.cpp |
840 | ) |
841 | - |
842 | add_library(mirplatformgraphicsandroid SHARED |
843 | - |
844 | $<TARGET_OBJECTS:mirplatformgraphicsandroidobjects> |
845 | ) |
846 | |
847 | -target_link_libraries( |
848 | - mirplatformgraphicsandroid |
849 | +set_target_properties( |
850 | + mirplatformgraphicsandroid PROPERTIES |
851 | + OUTPUT_NAME ${MIR_PLATFORM_DRIVER} |
852 | + LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/android |
853 | + LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${server_symbol_map}" |
854 | +) |
855 | |
856 | +target_link_libraries(mirplatformgraphicsandroid |
857 | + mirplatform |
858 | mirsharedandroid |
859 | - mirplatform |
860 | ${Boost_PROGRAM_OPTIONS_LIBRARY} |
861 | ${LIBHARDWARE_LIBRARIES} |
862 | ${EGL_LDFLAGS} ${EGL_LIBRARIES} |
863 | @@ -56,14 +59,20 @@ |
864 | ${ANDROID_PROPERTIES_LDFLAGS} |
865 | ) |
866 | |
867 | -set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map) |
868 | - |
869 | -set_target_properties( |
870 | - mirplatformgraphicsandroid PROPERTIES |
871 | - OUTPUT_NAME graphics-android |
872 | - LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/server-modules |
873 | - PREFIX "" |
874 | - LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}" |
875 | -) |
876 | - |
877 | -install(TARGETS mirplatformgraphicsandroid LIBRARY DESTINATION ${MIR_SERVER_PLATFORM_PATH}) |
878 | +install(TARGETS mirplatformgraphicsandroid LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/${PLATFORM_DRIVER}/android) |
879 | + |
880 | +if (MIR_TEST_PLATFORM STREQUAL "android") |
881 | + add_custom_command(TARGET mirplatformgraphicsandroid |
882 | + POST_BUILD |
883 | + COMMAND ${CMAKE_COMMAND} -E remove ${MIR_PLATFORM_DRIVER_BINARY} |
884 | + COMMAND ${CMAKE_COMMAND} -E create_symlink android/$<TARGET_FILE_NAME:mirplatformgraphicsandroid> ${MIR_PLATFORM_DRIVER_BINARY} |
885 | + WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH} |
886 | + ) |
887 | + |
888 | + install(CODE |
889 | + "execute_process( |
890 | + COMMAND ln -sf mir/${PLATFORM_DRIVER}/android/${MIR_PLATFORM_DRIVER_BINARY} |
891 | + WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} |
892 | + )" |
893 | + ) |
894 | +endif() |
895 | |
896 | === modified file 'src/platforms/android/server/platform.cpp' |
897 | --- src/platforms/android/server/platform.cpp 2015-01-22 15:39:35 +0000 |
898 | +++ src/platforms/android/server/platform.cpp 2015-01-26 13:27:35 +0000 |
899 | @@ -155,7 +155,7 @@ |
900 | return std::make_shared<mga::Platform>(nullptr, display_report, mga::OverlayOptimization::disabled); |
901 | } |
902 | |
903 | -extern "C" void add_graphics_platform_options( |
904 | +extern "C" void add_platform_options( |
905 | boost::program_options::options_description& config) |
906 | { |
907 | config.add_options() |
908 | @@ -166,25 +166,3 @@ |
909 | boost::program_options::value<bool>()->default_value(false), |
910 | "[platform-specific] Whether to disable overlay optimizations [{on,off}]"); |
911 | } |
912 | - |
913 | -extern "C" mg::PlatformPriority probe_graphics_platform() |
914 | -{ |
915 | - int err; |
916 | - hw_module_t const* hw_module; |
917 | - |
918 | - err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &hw_module); |
919 | - |
920 | - return err < 0 ? mg::PlatformPriority::unsupported : mg::PlatformPriority::best; |
921 | -} |
922 | - |
923 | -mir::ModuleProperties const description = { |
924 | - "android", |
925 | - MIR_VERSION_MAJOR, |
926 | - MIR_VERSION_MINOR, |
927 | - MIR_VERSION_MICRO |
928 | -}; |
929 | - |
930 | -extern "C" mir::ModuleProperties const* describe_graphics_module() |
931 | -{ |
932 | - return &description; |
933 | -} |
934 | |
935 | === removed file 'src/platforms/android/server/symbols.map' |
936 | --- src/platforms/android/server/symbols.map 2015-01-22 15:39:35 +0000 |
937 | +++ src/platforms/android/server/symbols.map 1970-01-01 00:00:00 +0000 |
938 | @@ -1,10 +0,0 @@ |
939 | -MIR_GRAPHICS_PLATFORM_1 { |
940 | - global: |
941 | - add_graphics_platform_options; |
942 | - create_host_platform; |
943 | - create_guest_platform; |
944 | - probe_graphics_platform; |
945 | - describe_graphics_module; |
946 | - local: |
947 | - *; |
948 | -}; |
949 | |
950 | === modified file 'src/platforms/common/server/symbols.map' |
951 | --- src/platforms/common/server/symbols.map 2015-01-23 16:25:00 +0000 |
952 | +++ src/platforms/common/server/symbols.map 2015-01-26 13:27:35 +0000 |
953 | @@ -1,9 +1,7 @@ |
954 | -MIR_GRAPHICS_PLATFORM_1 { |
955 | +MIR_PLATFORM_1 { |
956 | global: |
957 | - add_graphics_platform_options; |
958 | - probe_graphics_platform; |
959 | + add_platform_options; |
960 | create_host_platform; |
961 | create_guest_platform; |
962 | - describe_graphics_module; |
963 | local: *; |
964 | }; |
965 | |
966 | === modified file 'src/platforms/mesa/server/CMakeLists.txt' |
967 | --- src/platforms/mesa/server/CMakeLists.txt 2015-01-22 15:39:35 +0000 |
968 | +++ src/platforms/mesa/server/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
969 | @@ -15,9 +15,7 @@ |
970 | string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) |
971 | add_definitions(-D__GBM__) |
972 | |
973 | -add_library( |
974 | - mirplatformgraphicsmesaobjects OBJECT |
975 | - |
976 | +add_library(mirplatformgraphicsmesaobjects OBJECT |
977 | platform.cpp |
978 | buffer_allocator.cpp |
979 | gbm_buffer.cpp |
980 | @@ -40,15 +38,18 @@ |
981 | nested_authentication.cpp |
982 | ) |
983 | |
984 | -add_library( |
985 | - mirplatformgraphicsmesa MODULE |
986 | - |
987 | +add_library(mirplatformgraphicsmesa SHARED |
988 | $<TARGET_OBJECTS:mirplatformgraphicsmesaobjects> |
989 | ) |
990 | |
991 | -target_link_libraries( |
992 | - mirplatformgraphicsmesa |
993 | +set_target_properties( |
994 | + mirplatformgraphicsmesa PROPERTIES |
995 | + OUTPUT_NAME ${MIR_PLATFORM_DRIVER} |
996 | + LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/mesa |
997 | + LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${server_symbol_map}" |
998 | +) |
999 | |
1000 | +target_link_libraries(mirplatformgraphicsmesa |
1001 | mirplatform |
1002 | ${Boost_PROGRAM_OPTIONS_LIBRARY} |
1003 | ${DRM_LDFLAGS} ${DRM_LIBRARIES} |
1004 | @@ -57,14 +58,20 @@ |
1005 | ${GLESv2_LDFLAGS} ${GLESv2_LIBRARIES} |
1006 | ) |
1007 | |
1008 | -set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map) |
1009 | - |
1010 | -set_target_properties( |
1011 | - mirplatformgraphicsmesa PROPERTIES |
1012 | - OUTPUT_NAME graphics-mesa |
1013 | - LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/server-modules |
1014 | - PREFIX "" |
1015 | - LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}" |
1016 | -) |
1017 | - |
1018 | -install(TARGETS mirplatformgraphicsmesa LIBRARY DESTINATION ${MIR_SERVER_PLATFORM_PATH}) |
1019 | +install(TARGETS mirplatformgraphicsmesa LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/${PLATFORM_DRIVER}/mesa) |
1020 | + |
1021 | +if (MIR_TEST_PLATFORM STREQUAL "mesa") |
1022 | + add_custom_command(TARGET mirplatformgraphicsmesa |
1023 | + POST_BUILD |
1024 | + COMMAND ${CMAKE_COMMAND} -E remove ${MIR_PLATFORM_DRIVER_BINARY} |
1025 | + COMMAND ${CMAKE_COMMAND} -E create_symlink mesa/$<TARGET_FILE_NAME:mirplatformgraphicsmesa> ${MIR_PLATFORM_DRIVER_BINARY} |
1026 | + WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH} |
1027 | + ) |
1028 | + |
1029 | + install(CODE |
1030 | + "execute_process( |
1031 | + COMMAND ln -sf mir/${PLATFORM_DRIVER}/mesa/${MIR_PLATFORM_DRIVER_BINARY} |
1032 | + WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} |
1033 | + )" |
1034 | + ) |
1035 | +endif() |
1036 | |
1037 | === modified file 'src/platforms/mesa/server/platform.cpp' |
1038 | --- src/platforms/mesa/server/platform.cpp 2015-01-23 16:25:00 +0000 |
1039 | +++ src/platforms/mesa/server/platform.cpp 2015-01-26 13:27:35 +0000 |
1040 | @@ -26,7 +26,6 @@ |
1041 | #include "mir/options/option.h" |
1042 | #include "mir/graphics/native_buffer.h" |
1043 | #include "mir/emergency_cleanup_registry.h" |
1044 | -#include "mir/udev/wrapper.h" |
1045 | |
1046 | |
1047 | #include <boost/throw_exception.hpp> |
1048 | @@ -196,33 +195,3 @@ |
1049 | boost::program_options::value<bool>()->default_value(true), |
1050 | "[platform-specific] utilize the bypass optimization for fullscreen surfaces."); |
1051 | } |
1052 | - |
1053 | -extern "C" mg::PlatformPriority probe_graphics_platform() |
1054 | -{ |
1055 | - auto udev = std::make_shared<mir::udev::Context>(); |
1056 | - |
1057 | - mir::udev::Enumerator drm_devices{udev}; |
1058 | - drm_devices.match_subsystem("drm"); |
1059 | - drm_devices.match_sysname("card[0-9]*"); |
1060 | - drm_devices.scan_devices(); |
1061 | - |
1062 | - for (auto& device : drm_devices) |
1063 | - { |
1064 | - static_cast<void>(device); |
1065 | - return mg::PlatformPriority::best; |
1066 | - } |
1067 | - |
1068 | - return mg::PlatformPriority::unsupported; |
1069 | -} |
1070 | - |
1071 | -mir::ModuleProperties const description = { |
1072 | - "mesa", |
1073 | - MIR_VERSION_MAJOR, |
1074 | - MIR_VERSION_MINOR, |
1075 | - MIR_VERSION_MICRO |
1076 | -}; |
1077 | - |
1078 | -extern "C" mir::ModuleProperties const* describe_graphics_module() |
1079 | -{ |
1080 | - return &description; |
1081 | -} |
1082 | |
1083 | === removed file 'src/platforms/mesa/server/symbols.map' |
1084 | --- src/platforms/mesa/server/symbols.map 2015-01-22 15:39:35 +0000 |
1085 | +++ src/platforms/mesa/server/symbols.map 1970-01-01 00:00:00 +0000 |
1086 | @@ -1,16 +0,0 @@ |
1087 | -MIR_GRAPHICS_PLATFORM_1 { |
1088 | - global: |
1089 | - add_graphics_platform_options; |
1090 | - create_host_platform; |
1091 | - create_guest_platform; |
1092 | - probe_graphics_platform; |
1093 | - describe_graphics_module; |
1094 | - local: |
1095 | - *; |
1096 | -}; |
1097 | - |
1098 | -# Mesa EGL platform requires this, because madness. |
1099 | -MIR_MESA_EGL_INTEGRATION { |
1100 | - global: |
1101 | - mir_server_mesa_egl_native_display_is_valid; |
1102 | -}; |
1103 | |
1104 | === modified file 'src/server/CMakeLists.txt' |
1105 | --- src/server/CMakeLists.txt 2015-01-21 10:31:21 +0000 |
1106 | +++ src/server/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
1107 | @@ -11,9 +11,6 @@ |
1108 | ${GLIB_INCLUDE_DIRS} |
1109 | ) |
1110 | |
1111 | -add_definitions(-DMIR_SERVER_PLATFORM_PATH="${MIR_SERVER_PLATFORM_PATH}") |
1112 | -add_definitions(-DMIR_SERVER_GRAPHICS_PLATFORM_VERSION="${MIR_SERVER_GRAPHICS_PLATFORM_VERSION}") |
1113 | - |
1114 | add_subdirectory(compositor/) |
1115 | add_subdirectory(graphics/) |
1116 | add_subdirectory(input/) |
1117 | @@ -81,9 +78,8 @@ |
1118 | ) |
1119 | |
1120 | target_link_libraries(mirserver LINK_PUBLIC |
1121 | - |
1122 | + mirplatform |
1123 | mirclient |
1124 | - mirplatform |
1125 | mircommon |
1126 | mirprotobuf |
1127 | 3rd_party |
1128 | |
1129 | === modified file 'src/server/graphics/CMakeLists.txt' |
1130 | --- src/server/graphics/CMakeLists.txt 2015-01-19 06:55:41 +0000 |
1131 | +++ src/server/graphics/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
1132 | @@ -1,4 +1,4 @@ |
1133 | -include_directories(${GLESv2_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}) |
1134 | +include_directories(${GLESv2_INCLUDE_DIRS}) |
1135 | |
1136 | add_library( |
1137 | mirgraphics OBJECT |
1138 | |
1139 | === modified file 'src/server/graphics/default_configuration.cpp' |
1140 | --- src/server/graphics/default_configuration.cpp 2015-01-19 06:55:41 +0000 |
1141 | +++ src/server/graphics/default_configuration.cpp 2015-01-26 13:27:35 +0000 |
1142 | @@ -30,11 +30,10 @@ |
1143 | #include "mir/graphics/gl_config.h" |
1144 | #include "mir/graphics/platform.h" |
1145 | #include "mir/graphics/cursor.h" |
1146 | -#include "mir/graphics/platform_probe.h" |
1147 | #include "program_factory.h" |
1148 | |
1149 | #include "mir/shared_library.h" |
1150 | -#include "mir/shared_library_prober.h" |
1151 | +#include "mir/shared_library_loader.h" |
1152 | #include "mir/abnormal_exit.h" |
1153 | #include "mir/emergency_cleanup.h" |
1154 | #include "mir/log.h" |
1155 | @@ -46,15 +45,8 @@ |
1156 | #include <map> |
1157 | |
1158 | namespace mg = mir::graphics; |
1159 | -namespace ml = mir::logging; |
1160 | namespace mgn = mir::graphics::nested; |
1161 | |
1162 | -namespace |
1163 | -{ |
1164 | -// TODO: Temporary, until we actually manage module lifetimes |
1165 | -static std::shared_ptr<mir::SharedLibrary> platform_library; |
1166 | -} |
1167 | - |
1168 | std::shared_ptr<mg::DisplayConfigurationPolicy> |
1169 | mir::DefaultServerConfiguration::the_display_configuration_policy() |
1170 | { |
1171 | @@ -73,6 +65,7 @@ |
1172 | return wrapped; |
1173 | } |
1174 | |
1175 | + |
1176 | namespace |
1177 | { |
1178 | //TODO: what is the point of NestedContext if its just the same as mgn:HostConnection? |
1179 | @@ -109,49 +102,24 @@ |
1180 | return graphics_platform( |
1181 | [this]()->std::shared_ptr<mg::Platform> |
1182 | { |
1183 | - // fallback to standalone if host socket is unset |
1184 | - if (the_options()->is_set(options::platform_graphics_lib)) |
1185 | - { |
1186 | - platform_library = std::make_shared<mir::SharedLibrary>(the_options()->get<std::string>(options::platform_graphics_lib)); |
1187 | - } |
1188 | - else |
1189 | - { |
1190 | - auto const& path = the_options()->get<std::string>(options::platform_path); |
1191 | - auto platforms = mir::libraries_for_path(path, *the_shared_library_prober_report()); |
1192 | - if (platforms.empty()) |
1193 | - { |
1194 | - auto msg = "Failed to find any platform plugins in: " + path; |
1195 | - throw std::runtime_error(msg.c_str()); |
1196 | - } |
1197 | - platform_library = mir::graphics::module_for_device(platforms); |
1198 | - } |
1199 | - auto create_host_platform = platform_library->load_function<mg::CreateHostPlatform>( |
1200 | - "create_host_platform", |
1201 | - MIR_SERVER_GRAPHICS_PLATFORM_VERSION); |
1202 | - auto create_guest_platform = platform_library->load_function<mg::CreateGuestPlatform>( |
1203 | - "create_guest_platform", |
1204 | - MIR_SERVER_GRAPHICS_PLATFORM_VERSION); |
1205 | - auto describe_module = platform_library->load_function<mg::DescribeModule>( |
1206 | - "describe_graphics_module", |
1207 | - MIR_SERVER_GRAPHICS_PLATFORM_VERSION); |
1208 | - auto description = describe_module(); |
1209 | - ml::log(ml::Severity::informational, |
1210 | - std::string{"Selected driver: "} + description->name + " (version " + |
1211 | - std::to_string(description->major_version) + "." + |
1212 | - std::to_string(description->minor_version) + "." + |
1213 | - std::to_string(description->micro_version) + ")", |
1214 | - "Platform Loader"); |
1215 | + auto graphics_lib = mir::load_library(the_options()->get<std::string>(options::platform_graphics_lib)); |
1216 | |
1217 | - if (!the_options()->is_set(options::host_socket_opt)) |
1218 | - return create_host_platform(the_options(), the_emergency_cleanup(), the_display_report()); |
1219 | - else |
1220 | + auto create_host_platform = graphics_lib->load_function<mg::CreateHostPlatform>("create_host_platform"); |
1221 | + auto create_guest_platform = graphics_lib->load_function<mg::CreateGuestPlatform>("create_guest_platform"); |
1222 | + if (the_options()->is_set(options::host_socket_opt)) |
1223 | + { |
1224 | return create_guest_platform( |
1225 | the_display_report(), |
1226 | std::make_shared<MirConnectionNestedContext>(the_host_connection())); |
1227 | - |
1228 | + } |
1229 | + else |
1230 | + { |
1231 | + return create_host_platform(the_options(), the_emergency_cleanup(), the_display_report()); |
1232 | + } |
1233 | }); |
1234 | } |
1235 | |
1236 | + |
1237 | std::shared_ptr<mg::GraphicBufferAllocator> |
1238 | mir::DefaultServerConfiguration::the_buffer_allocator() |
1239 | { |
1240 | |
1241 | === modified file 'src/server/report/default_server_configuration.cpp' |
1242 | --- src/server/report/default_server_configuration.cpp 2014-12-17 16:46:57 +0000 |
1243 | +++ src/server/report/default_server_configuration.cpp 2015-01-26 13:27:35 +0000 |
1244 | @@ -117,12 +117,3 @@ |
1245 | return report_factory(options::scene_report_opt)->create_scene_report(); |
1246 | }); |
1247 | } |
1248 | - |
1249 | -auto mir::DefaultServerConfiguration::the_shared_library_prober_report() -> std::shared_ptr<SharedLibraryProberReport> |
1250 | -{ |
1251 | - return shared_library_prober_report( |
1252 | - [this]()->std::shared_ptr<SharedLibraryProberReport> |
1253 | - { |
1254 | - return report_factory(options::shared_library_prober_report_opt)->create_shared_library_prober_report(); |
1255 | - }); |
1256 | -} |
1257 | |
1258 | === modified file 'src/server/report/logging/logging_report_factory.cpp' |
1259 | --- src/server/report/logging/logging_report_factory.cpp 2014-12-17 16:46:57 +0000 |
1260 | +++ src/server/report/logging/logging_report_factory.cpp 2015-01-26 13:27:35 +0000 |
1261 | @@ -25,7 +25,6 @@ |
1262 | #include "scene_report.h" |
1263 | #include "session_mediator_report.h" |
1264 | #include "input_report.h" |
1265 | -#include "mir/logging/shared_library_prober_report.h" |
1266 | |
1267 | #include "mir/default_server_configuration.h" |
1268 | |
1269 | @@ -73,8 +72,4 @@ |
1270 | return std::make_shared<logging::InputReport>(logger); |
1271 | } |
1272 | |
1273 | -std::shared_ptr<mir::SharedLibraryProberReport> mr::LoggingReportFactory::create_shared_library_prober_report() |
1274 | -{ |
1275 | - return std::make_shared<mir::logging::SharedLibraryProberReport>(logger); |
1276 | -} |
1277 | |
1278 | |
1279 | === modified file 'src/server/report/logging_report_factory.h' |
1280 | --- src/server/report/logging_report_factory.h 2014-12-17 16:46:57 +0000 |
1281 | +++ src/server/report/logging_report_factory.h 2015-01-26 13:27:35 +0000 |
1282 | @@ -47,7 +47,6 @@ |
1283 | std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() override; |
1284 | std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() override; |
1285 | std::shared_ptr<input::InputReport> create_input_report() override; |
1286 | - std::shared_ptr<mir::SharedLibraryProberReport> create_shared_library_prober_report() override; |
1287 | |
1288 | private: |
1289 | std::shared_ptr<mir::logging::Logger> const logger; |
1290 | |
1291 | === modified file 'src/server/report/lttng/CMakeLists.txt' |
1292 | --- src/server/report/lttng/CMakeLists.txt 2015-01-19 06:55:41 +0000 |
1293 | +++ src/server/report/lttng/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
1294 | @@ -17,7 +17,6 @@ |
1295 | session_mediator_report.cpp |
1296 | scene_report.cpp |
1297 | server_tracepoint_provider.cpp |
1298 | - shared_library_prober_report.cpp |
1299 | ) |
1300 | |
1301 | add_library( |
1302 | |
1303 | === modified file 'src/server/report/lttng/lttng_report_factory.cpp' |
1304 | --- src/server/report/lttng/lttng_report_factory.cpp 2014-12-17 16:46:57 +0000 |
1305 | +++ src/server/report/lttng/lttng_report_factory.cpp 2015-01-26 13:27:35 +0000 |
1306 | @@ -25,7 +25,6 @@ |
1307 | #include "message_processor_report.h" |
1308 | #include "scene_report.h" |
1309 | #include "session_mediator_report.h" |
1310 | -#include "shared_library_prober_report.h" |
1311 | |
1312 | std::shared_ptr<mir::compositor::CompositorReport> mir::report::LttngReportFactory::create_compositor_report() |
1313 | { |
1314 | @@ -62,9 +61,4 @@ |
1315 | return std::make_shared<lttng::InputReport>(); |
1316 | } |
1317 | |
1318 | -std::shared_ptr<mir::SharedLibraryProberReport> mir::report::LttngReportFactory::create_shared_library_prober_report() |
1319 | -{ |
1320 | - return std::make_shared<lttng::SharedLibraryProberReport>(); |
1321 | -} |
1322 | - |
1323 | |
1324 | |
1325 | === removed file 'src/server/report/lttng/shared_library_prober_report.cpp' |
1326 | --- src/server/report/lttng/shared_library_prober_report.cpp 2014-12-17 16:46:57 +0000 |
1327 | +++ src/server/report/lttng/shared_library_prober_report.cpp 1970-01-01 00:00:00 +0000 |
1328 | @@ -1,52 +0,0 @@ |
1329 | -/* |
1330 | - * Copyright © 2014 Canonical Ltd. |
1331 | - * |
1332 | - * This program is free software: you can redistribute it and/or modify |
1333 | - * it under the terms of the GNU General Public License version 3 as |
1334 | - * published by the Free Software Foundation. |
1335 | - * |
1336 | - * This program is distributed in the hope that it will be useful, |
1337 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1338 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1339 | - * GNU General Public License for more details. |
1340 | - * |
1341 | - * You should have received a copy of the GNU General Public License |
1342 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1343 | - * |
1344 | - * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com> |
1345 | - */ |
1346 | - |
1347 | -#include "shared_library_prober_report.h" |
1348 | - |
1349 | -#include "mir/report/lttng/mir_tracepoint.h" |
1350 | - |
1351 | -#define TRACEPOINT_DEFINE |
1352 | -#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE |
1353 | -#include "shared_library_prober_report_tp.h" |
1354 | - |
1355 | -namespace mrl = mir::report::lttng; |
1356 | -namespace bf = boost::filesystem; |
1357 | - |
1358 | -void mrl::SharedLibraryProberReport::probing_path(bf::path const& path) |
1359 | -{ |
1360 | - mir_tracepoint(mir_server_shared_library_prober, probing_path, |
1361 | - path.string().c_str()); |
1362 | -} |
1363 | - |
1364 | -void mrl::SharedLibraryProberReport::probing_failed(bf::path const& path, std::exception const& error) |
1365 | -{ |
1366 | - mir_tracepoint(mir_server_shared_library_prober, probing_failed, |
1367 | - path.string().c_str(), error.what()); |
1368 | -} |
1369 | - |
1370 | -void mrl::SharedLibraryProberReport::loading_library(bf::path const& filename) |
1371 | -{ |
1372 | - mir_tracepoint(mir_server_shared_library_prober, loading_library, |
1373 | - filename.string().c_str()); |
1374 | -} |
1375 | - |
1376 | -void mrl::SharedLibraryProberReport::loading_failed(bf::path const& filename, std::exception const& error) |
1377 | -{ |
1378 | - mir_tracepoint(mir_server_shared_library_prober, loading_failed, |
1379 | - filename.string().c_str(), error.what()); |
1380 | -} |
1381 | |
1382 | === removed file 'src/server/report/lttng/shared_library_prober_report.h' |
1383 | --- src/server/report/lttng/shared_library_prober_report.h 2014-12-17 16:46:57 +0000 |
1384 | +++ src/server/report/lttng/shared_library_prober_report.h 1970-01-01 00:00:00 +0000 |
1385 | @@ -1,48 +0,0 @@ |
1386 | -/* |
1387 | - * Copyright © 2014 Canonical Ltd. |
1388 | - * |
1389 | - * This program is free software: you can redistribute it and/or modify it |
1390 | - * under the terms of the GNU General Public License version 3, |
1391 | - * as published by the Free Software Foundation. |
1392 | - * |
1393 | - * This program is distributed in the hope that it will be useful, |
1394 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1395 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1396 | - * GNU General Public License for more details. |
1397 | - * |
1398 | - * You should have received a copy of the GNU General Public License |
1399 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1400 | - * |
1401 | - * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com> |
1402 | - */ |
1403 | - |
1404 | -#ifndef MIR_REPORT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_H_ |
1405 | -#define MIR_REPORT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_H_ |
1406 | - |
1407 | -#include "server_tracepoint_provider.h" |
1408 | -#include "mir/shared_library_prober_report.h" |
1409 | - |
1410 | -namespace mir |
1411 | -{ |
1412 | -namespace report |
1413 | -{ |
1414 | -namespace lttng |
1415 | -{ |
1416 | - |
1417 | -class SharedLibraryProberReport : public mir::SharedLibraryProberReport |
1418 | -{ |
1419 | -public: |
1420 | - void probing_path(boost::filesystem::path const& path) override; |
1421 | - void probing_failed(boost::filesystem::path const& path, std::exception const& error) override; |
1422 | - void loading_library(boost::filesystem::path const& filename) override; |
1423 | - void loading_failed(boost::filesystem::path const& filename, std::exception const& error) override; |
1424 | - |
1425 | -private: |
1426 | - ServerTracepointProvider tp_provider; |
1427 | -}; |
1428 | - |
1429 | -} |
1430 | -} |
1431 | -} |
1432 | - |
1433 | -#endif /* MIR_REPORT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_H_ */ |
1434 | |
1435 | === removed file 'src/server/report/lttng/shared_library_prober_report_tp.h' |
1436 | --- src/server/report/lttng/shared_library_prober_report_tp.h 2014-12-17 16:46:57 +0000 |
1437 | +++ src/server/report/lttng/shared_library_prober_report_tp.h 1970-01-01 00:00:00 +0000 |
1438 | @@ -1,70 +0,0 @@ |
1439 | -/* |
1440 | - * Copyright © 2014 Canonical Ltd. |
1441 | - * |
1442 | - * This program is free software: you can redistribute it and/or modify it |
1443 | - * under the terms of the GNU General Public License version 3, |
1444 | - * as published by the Free Software Foundation. |
1445 | - * |
1446 | - * This program is distributed in the hope that it will be useful, |
1447 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1448 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1449 | - * GNU General Public License for more details. |
1450 | - * |
1451 | - * You should have received a copy of the GNU General Public License |
1452 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1453 | - * |
1454 | - * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com> |
1455 | - */ |
1456 | - |
1457 | -#undef TRACEPOINT_PROVIDER |
1458 | -#define TRACEPOINT_PROVIDER mir_server_shared_library_prober |
1459 | - |
1460 | -#undef TRACEPOINT_INCLUDE |
1461 | -#define TRACEPOINT_INCLUDE "./shared_library_prober_report_tp.h" |
1462 | - |
1463 | -#if !defined(MIR_LTTNG_SHARED_LIBRARY_PROBER_REPORT_TP_H_) || defined(TRACEPOINT_HEADER_MULTI_READ) |
1464 | -#define MIR_LTTNG_SHARED_LIBRARY_PROBER_REPORT_TP_H_ |
1465 | - |
1466 | -#include "lttng_utils.h" |
1467 | - |
1468 | -TRACEPOINT_EVENT( |
1469 | - mir_server_shared_library_prober, |
1470 | - probing_path, |
1471 | - TP_ARGS(const char*, path), |
1472 | - TP_FIELDS( |
1473 | - ctf_string(path, path) |
1474 | - ) |
1475 | -) |
1476 | - |
1477 | -TRACEPOINT_EVENT( |
1478 | - mir_server_shared_library_prober, |
1479 | - probing_failed, |
1480 | - TP_ARGS(const char*, path, const char*, message), |
1481 | - TP_FIELDS( |
1482 | - ctf_string(path, path) |
1483 | - ctf_string(message, message) |
1484 | - ) |
1485 | -) |
1486 | - |
1487 | -TRACEPOINT_EVENT( |
1488 | - mir_server_shared_library_prober, |
1489 | - loading_library, |
1490 | - TP_ARGS(const char*, path), |
1491 | - TP_FIELDS( |
1492 | - ctf_string(path, path) |
1493 | - ) |
1494 | -) |
1495 | - |
1496 | -TRACEPOINT_EVENT( |
1497 | - mir_server_shared_library_prober, |
1498 | - loading_failed, |
1499 | - TP_ARGS(const char*, path, const char*, message), |
1500 | - TP_FIELDS( |
1501 | - ctf_string(path, path) |
1502 | - ctf_string(message, message) |
1503 | - ) |
1504 | -) |
1505 | - |
1506 | -#endif /* MIR_LTTNG_SHARED_LIBRARY_PROBER_REPORT_TP_H_ */ |
1507 | - |
1508 | -#include <lttng/tracepoint-event.h> |
1509 | |
1510 | === modified file 'src/server/report/lttng/tracepoints.c' |
1511 | --- src/server/report/lttng/tracepoints.c 2014-12-17 16:46:57 +0000 |
1512 | +++ src/server/report/lttng/tracepoints.c 2015-01-26 13:27:35 +0000 |
1513 | @@ -8,4 +8,3 @@ |
1514 | #include "session_mediator_report_tp.h" |
1515 | #include "scene_report_tp.h" |
1516 | #include "message_processor_report_tp.h" |
1517 | -#include "shared_library_prober_report_tp.h" |
1518 | |
1519 | === modified file 'src/server/report/lttng_report_factory.h' |
1520 | --- src/server/report/lttng_report_factory.h 2014-12-17 16:46:57 +0000 |
1521 | +++ src/server/report/lttng_report_factory.h 2015-01-26 13:27:35 +0000 |
1522 | @@ -35,7 +35,6 @@ |
1523 | std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() override; |
1524 | std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() override; |
1525 | std::shared_ptr<input::InputReport> create_input_report() override; |
1526 | - std::shared_ptr<SharedLibraryProberReport> create_shared_library_prober_report() override; |
1527 | }; |
1528 | } |
1529 | } |
1530 | |
1531 | === modified file 'src/server/report/null/null_report_factory.cpp' |
1532 | --- src/server/report/null/null_report_factory.cpp 2014-12-17 16:46:57 +0000 |
1533 | +++ src/server/report/null/null_report_factory.cpp 2015-01-26 13:27:35 +0000 |
1534 | @@ -25,7 +25,6 @@ |
1535 | #include "display_report.h" |
1536 | #include "input_report.h" |
1537 | #include "scene_report.h" |
1538 | -#include "mir/logging/null_shared_library_prober_report.h" |
1539 | |
1540 | std::shared_ptr<mir::compositor::CompositorReport> mir::report::NullReportFactory::create_compositor_report() |
1541 | { |
1542 | @@ -62,21 +61,11 @@ |
1543 | return std::make_shared<null::InputReport>(); |
1544 | } |
1545 | |
1546 | -std::shared_ptr<mir::SharedLibraryProberReport> mir::report::NullReportFactory::create_shared_library_prober_report() |
1547 | -{ |
1548 | - return std::make_shared<logging::NullSharedLibraryProberReport>(); |
1549 | -} |
1550 | - |
1551 | std::shared_ptr<mir::compositor::CompositorReport> mir::report::null_compositor_report() |
1552 | { |
1553 | return NullReportFactory{}.create_compositor_report(); |
1554 | } |
1555 | |
1556 | -std::shared_ptr<mir::SharedLibraryProberReport> mir::report::null_shared_library_prober_report() |
1557 | -{ |
1558 | - return NullReportFactory{}.create_shared_library_prober_report(); |
1559 | -} |
1560 | - |
1561 | std::shared_ptr<mir::graphics::DisplayReport> mir::report::null_display_report() |
1562 | { |
1563 | return NullReportFactory{}.create_display_report(); |
1564 | |
1565 | === modified file 'src/server/report/null_report_factory.h' |
1566 | --- src/server/report/null_report_factory.h 2014-12-17 16:46:57 +0000 |
1567 | +++ src/server/report/null_report_factory.h 2015-01-26 13:27:35 +0000 |
1568 | @@ -35,7 +35,6 @@ |
1569 | std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() override; |
1570 | std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() override; |
1571 | std::shared_ptr<input::InputReport> create_input_report() override; |
1572 | - std::shared_ptr<mir::SharedLibraryProberReport> create_shared_library_prober_report() override; |
1573 | }; |
1574 | |
1575 | std::shared_ptr<compositor::CompositorReport> null_compositor_report(); |
1576 | @@ -45,7 +44,6 @@ |
1577 | std::shared_ptr<frontend::SessionMediatorReport> null_session_mediator_report(); |
1578 | std::shared_ptr<frontend::MessageProcessorReport> null_message_processor_report(); |
1579 | std::shared_ptr<input::InputReport> null_input_report(); |
1580 | -std::shared_ptr<mir::SharedLibraryProberReport> null_shared_library_prober_report(); |
1581 | |
1582 | } |
1583 | } |
1584 | |
1585 | === modified file 'src/server/report/report_factory.h' |
1586 | --- src/server/report/report_factory.h 2014-12-17 16:46:57 +0000 |
1587 | +++ src/server/report/report_factory.h 2015-01-26 13:27:35 +0000 |
1588 | @@ -23,7 +23,6 @@ |
1589 | |
1590 | namespace mir |
1591 | { |
1592 | -class SharedLibraryProberReport; |
1593 | namespace compositor |
1594 | { |
1595 | class CompositorReport; |
1596 | @@ -60,7 +59,6 @@ |
1597 | virtual std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() = 0; |
1598 | virtual std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() = 0; |
1599 | virtual std::shared_ptr<input::InputReport> create_input_report() = 0; |
1600 | - virtual std::shared_ptr<SharedLibraryProberReport> create_shared_library_prober_report() = 0; |
1601 | |
1602 | protected: |
1603 | ReportFactory() = default; |
1604 | |
1605 | === modified file 'src/server/server.cpp' |
1606 | --- src/server/server.cpp 2015-01-21 08:08:04 +0000 |
1607 | +++ src/server/server.cpp 2015-01-26 13:27:35 +0000 |
1608 | @@ -188,15 +188,12 @@ |
1609 | // TODO this is an ugly frig to avoid exposing the render factory to end users and tests running headless |
1610 | auto the_renderer_factory() -> std::shared_ptr<compositor::RendererFactory> override |
1611 | { |
1612 | - auto const& options = the_options(); |
1613 | - if (options->is_set(options::platform_graphics_lib)) |
1614 | - { |
1615 | - auto const graphics_lib = options->get<std::string>(options::platform_graphics_lib); |
1616 | + auto const graphics_lib = the_options()->get<std::string>(options::platform_graphics_lib); |
1617 | |
1618 | - if (graphics_lib.find("graphics-dummy.so") != std::string::npos) |
1619 | - return std::make_shared<StubRendererFactory>(); |
1620 | - } |
1621 | - return mir::DefaultServerConfiguration::the_renderer_factory(); |
1622 | + if (graphics_lib != "libmirplatformstub.so") |
1623 | + return mir::DefaultServerConfiguration::the_renderer_factory(); |
1624 | + else |
1625 | + return std::make_shared<StubRendererFactory>(); |
1626 | } |
1627 | |
1628 | using mir::DefaultServerConfiguration::the_options; |
1629 | |
1630 | === modified file 'src/server/symbols.map' |
1631 | --- src/server/symbols.map 2015-01-23 16:46:01 +0000 |
1632 | +++ src/server/symbols.map 2015-01-26 13:27:35 +0000 |
1633 | @@ -110,7 +110,6 @@ |
1634 | mir::DefaultServerConfiguration::the_session_event_sink*; |
1635 | mir::DefaultServerConfiguration::the_session_listener*; |
1636 | mir::DefaultServerConfiguration::the_session_mediator_report*; |
1637 | - mir::DefaultServerConfiguration::the_shared_library_prober_report*; |
1638 | mir::DefaultServerConfiguration::the_shell_display_layout*; |
1639 | mir::DefaultServerConfiguration::the_shell_focus_setter*; |
1640 | mir::DefaultServerConfiguration::the_snapshot_strategy*; |
1641 | @@ -597,7 +596,6 @@ |
1642 | non-virtual?thunk?to?mir::DefaultServerConfiguration::the_session_event_sink*; |
1643 | non-virtual?thunk?to?mir::DefaultServerConfiguration::the_session_listener*; |
1644 | non-virtual?thunk?to?mir::DefaultServerConfiguration::the_session_mediator_report*; |
1645 | - non-virtual?thunk?to?mir::DefaultServerConfiguration::the_shared_library_prober_report*; |
1646 | non-virtual?thunk?to?mir::DefaultServerConfiguration::the_shell_display_layout*; |
1647 | non-virtual?thunk?to?mir::DefaultServerConfiguration::the_shell_focus_setter*; |
1648 | non-virtual?thunk?to?mir::DefaultServerConfiguration::the_snapshot_strategy*; |
1649 | |
1650 | === modified file 'src/wrapper.c' |
1651 | --- src/wrapper.c 2015-01-23 16:25:00 +0000 |
1652 | +++ src/wrapper.c 2015-01-26 13:27:35 +0000 |
1653 | @@ -60,9 +60,6 @@ |
1654 | *dest_max = '\0'; |
1655 | setenv("MIR_CLIENT_PLATFORM_PATH", path, 1); |
1656 | printf("MIR_CLIENT_PLATFORM_PATH=%s\n", path); |
1657 | - strncpy(pivot+7, "server-modules/", pivot_max-7); |
1658 | - setenv("MIR_SERVER_PLATFORM_PATH", path, 1); |
1659 | - printf("MIR_SERVER_PLATFORM_PATH=%s\n", path); |
1660 | |
1661 | pivot[6] = '\0'; /* truncate lib/client-modules to just lib */ |
1662 | appendenv("LD_LIBRARY_PATH", path); |
1663 | |
1664 | === modified file 'tests/acceptance-tests/CMakeLists.txt' |
1665 | --- tests/acceptance-tests/CMakeLists.txt 2015-01-19 06:55:41 +0000 |
1666 | +++ tests/acceptance-tests/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
1667 | @@ -4,6 +4,10 @@ |
1668 | ${CMAKE_SOURCE_DIR} |
1669 | ) |
1670 | |
1671 | +add_definitions( |
1672 | + -DMIR_PLATFORM_DRIVER_BINARY="${MIR_PLATFORM_DRIVER_BINARY}" |
1673 | +) |
1674 | + |
1675 | set( |
1676 | SOURCES |
1677 | |
1678 | @@ -63,9 +67,9 @@ |
1679 | mirplatform |
1680 | |
1681 | mir-test |
1682 | - mir-test-framework |
1683 | mir-test-doubles |
1684 | mir-test-doubles-platform |
1685 | + mir-test-framework |
1686 | 3rd_party |
1687 | |
1688 | ${PROTOBUF_LIBRARIES} |
1689 | |
1690 | === modified file 'tests/acceptance-tests/server_configuration_wrapping.cpp' |
1691 | --- tests/acceptance-tests/server_configuration_wrapping.cpp 2015-01-23 16:25:00 +0000 |
1692 | +++ tests/acceptance-tests/server_configuration_wrapping.cpp 2015-01-26 13:27:35 +0000 |
1693 | @@ -21,14 +21,11 @@ |
1694 | |
1695 | #include "mir_test_framework/headless_test.h" |
1696 | |
1697 | -#include "mir_test_framework/executable_path.h" |
1698 | - |
1699 | #include <gtest/gtest.h> |
1700 | #include <gmock/gmock.h> |
1701 | |
1702 | namespace ms = mir::scene; |
1703 | namespace msh = mir::shell; |
1704 | -namespace mtf = mir_test_framework; |
1705 | |
1706 | using namespace testing; |
1707 | |
1708 | |
1709 | === modified file 'tests/acceptance-tests/test_symbols_required_by_mesa.cpp' |
1710 | --- tests/acceptance-tests/test_symbols_required_by_mesa.cpp 2015-01-23 16:25:00 +0000 |
1711 | +++ tests/acceptance-tests/test_symbols_required_by_mesa.cpp 2015-01-26 13:27:35 +0000 |
1712 | @@ -28,7 +28,7 @@ |
1713 | |
1714 | TEST(SymbolsRequiredByMesa, are_exported_by_client_platform_mesa) |
1715 | { |
1716 | - auto const handle = dlopen(mtf::client_platform("mesa.so").c_str(), RTLD_LAZY); |
1717 | + auto const handle = dlopen((mtf::library_path() + "/client-modules/mesa.so").c_str(), RTLD_LAZY); |
1718 | ASSERT_THAT(handle, NotNull()); |
1719 | |
1720 | auto const sym = dlsym(handle, "mir_client_mesa_egl_native_display_is_valid"); |
1721 | |
1722 | === modified file 'tests/include/mir_test_framework/client_platform_factory.h' |
1723 | --- tests/include/mir_test_framework/client_platform_factory.h 2015-01-18 10:29:31 +0000 |
1724 | +++ tests/include/mir_test_framework/client_platform_factory.h 2015-01-26 13:27:35 +0000 |
1725 | @@ -37,7 +37,7 @@ |
1726 | mtd::MockClientContext ctx; |
1727 | ON_CALL(ctx, populate(_)) |
1728 | .WillByDefault(Invoke([](MirPlatformPackage& package) { ::memset(&package, 0, sizeof(package)); })); |
1729 | - platform_library = std::make_shared<mir::SharedLibrary>(client_platform("android.so")); |
1730 | + platform_library = std::make_shared<mir::SharedLibrary>(library_path() + "/client-modules/android.so"); |
1731 | auto platform_factory = platform_library->load_function<mir::client::CreateClientPlatform>("create_client_platform"); |
1732 | return platform_factory(&ctx); |
1733 | } |
1734 | @@ -52,7 +52,7 @@ |
1735 | ::memset(&package, 0, sizeof(package)); |
1736 | package.fd_items = 1; |
1737 | })); |
1738 | - platform_library = std::make_shared<mir::SharedLibrary>(client_platform("mesa.so")); |
1739 | + platform_library = std::make_shared<mir::SharedLibrary>(library_path() + "/client-modules/mesa.so"); |
1740 | auto platform_factory = platform_library->load_function<mir::client::CreateClientPlatform>("create_client_platform"); |
1741 | return platform_factory(&ctx); |
1742 | } |
1743 | |
1744 | === modified file 'tests/include/mir_test_framework/executable_path.h' |
1745 | --- tests/include/mir_test_framework/executable_path.h 2015-01-19 06:55:41 +0000 |
1746 | +++ tests/include/mir_test_framework/executable_path.h 2015-01-26 13:27:35 +0000 |
1747 | @@ -26,7 +26,5 @@ |
1748 | std::string executable_path(); |
1749 | |
1750 | std::string library_path(); |
1751 | -std::string server_platform(std::string const& name); |
1752 | -std::string client_platform(std::string const& name); |
1753 | } |
1754 | #endif /* MIR_TEST_FRAMEWORK_EXECUTABLE_PATH_H_ */ |
1755 | |
1756 | === modified file 'tests/include/mir_test_framework/headless_test.h' |
1757 | --- tests/include/mir_test_framework/headless_test.h 2015-01-19 06:55:41 +0000 |
1758 | +++ tests/include/mir_test_framework/headless_test.h 2015-01-26 13:27:35 +0000 |
1759 | @@ -32,7 +32,7 @@ |
1760 | { |
1761 | /** Basic fixture for tests that don't use graphics hardware. |
1762 | * This provides a mechanism for temporarily setting environment variables. |
1763 | - * It automatically sets "MIR_SERVER_PLATFORM_GRAPHICS_LIB" to "graphics-dummy.so" |
1764 | + * It automatically sets "MIR_SERVER_PLATFORM_GRAPHICS_LIB" to "libmirplatformstub.so" |
1765 | * as the tests do not hit the graphics hardware. |
1766 | */ |
1767 | class HeadlessTest : public ::testing::Test, public AsyncServerRunner |
1768 | |
1769 | === removed file 'tests/include/mir_test_framework/stub_server_platform_factory.h' |
1770 | --- tests/include/mir_test_framework/stub_server_platform_factory.h 2014-12-10 04:13:25 +0000 |
1771 | +++ tests/include/mir_test_framework/stub_server_platform_factory.h 1970-01-01 00:00:00 +0000 |
1772 | @@ -1,49 +0,0 @@ |
1773 | -/* |
1774 | - * Copyright © 2014 Canonical Ltd. |
1775 | - * |
1776 | - * This program is free software: you can redistribute it and/or modify it |
1777 | - * under the terms of the GNU General Public License version 3, |
1778 | - * as published by the Free Software Foundation. |
1779 | - * |
1780 | - * This program is distributed in the hope that it will be useful, |
1781 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1782 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1783 | - * GNU General Public License for more details. |
1784 | - * |
1785 | - * You should have received a copy of the GNU General Public License |
1786 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1787 | - * |
1788 | - * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
1789 | - */ |
1790 | - |
1791 | -#ifndef MIR_TEST_FRAMEWORK_STUB_SERVER_PLATFORM_FACTORY_ |
1792 | -#define MIR_TEST_FRAMEWORK_STUB_SERVER_PLATFORM_FACTORY_ |
1793 | - |
1794 | -#include "mir/geometry/rectangle.h" |
1795 | - |
1796 | -#include "mir/graphics/platform.h" |
1797 | -#include <vector> |
1798 | - |
1799 | -namespace geom = mir::geometry; |
1800 | - |
1801 | -namespace mir |
1802 | -{ |
1803 | -namespace graphics |
1804 | -{ |
1805 | -class Platform; |
1806 | -} |
1807 | -} |
1808 | - |
1809 | -namespace mg = mir::graphics; |
1810 | - |
1811 | -namespace mir_test_framework |
1812 | -{ |
1813 | - |
1814 | -std::shared_ptr<mg::Platform> make_stubbed_server_graphics_platform(std::vector<geom::Rectangle> const& display_rects); |
1815 | - |
1816 | -void set_next_display_rects(std::unique_ptr<std::vector<geom::Rectangle>>&& display_rects); |
1817 | - |
1818 | -void set_next_preset_display(std::shared_ptr<mir::graphics::Display> const& display); |
1819 | - |
1820 | -} |
1821 | -#endif /* MIR_TEST_FRAMEWORK_STUB_SERVER_PLATFORM_FACTORY_ */ |
1822 | |
1823 | === modified file 'tests/integration-tests/CMakeLists.txt' |
1824 | --- tests/integration-tests/CMakeLists.txt 2015-01-23 16:25:00 +0000 |
1825 | +++ tests/integration-tests/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
1826 | @@ -99,15 +99,6 @@ |
1827 | ${GTEST_BOTH_LIBRARIES} |
1828 | ${GMOCK_LIBRARY} |
1829 | ${GMOCK_MAIN_LIBRARY} |
1830 | - # Mesa platform dependencies |
1831 | - ${DRM_LDFLAGS} ${DRM_LIBRARIES} |
1832 | - ${GBM_LDFLAGS} ${GBM_LIBRARIES} |
1833 | - # Android platform dependencies |
1834 | - ${LIBHARDWARE_LIBRARIES} |
1835 | - ${ANDROID_PROPERTIES_LIBRARIES} |
1836 | - # Shared platform dependencies |
1837 | - ${EGL_LDFLAGS} ${EGL_LIBRARIES} |
1838 | - ${GLESv2_LDFLAGS} ${GLESv2_LIBRARIES} |
1839 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
1840 | ${DRM_LDFLAGS} ${DRM_LIBRARIES} |
1841 | ${GBM_LDFLAGS} ${GBM_LIBRARIES} |
1842 | @@ -117,7 +108,7 @@ |
1843 | ${MIR_SERVER_REFERENCES} |
1844 | ) |
1845 | |
1846 | -if (MIR_BUILD_PLATFORM_ANDROID) |
1847 | +if (MIR_TEST_PLATFORM STREQUAL "android") |
1848 | target_link_libraries(mir_integration_tests |
1849 | mirsharedandroid |
1850 | ${ANDROID_PROPERTIES_LDFLAGS} |
1851 | |
1852 | === modified file 'tests/mir_test_doubles/CMakeLists.txt' |
1853 | --- tests/mir_test_doubles/CMakeLists.txt 2015-01-19 06:55:41 +0000 |
1854 | +++ tests/mir_test_doubles/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
1855 | @@ -31,18 +31,16 @@ |
1856 | ) |
1857 | |
1858 | if (MIR_BUILD_PLATFORM_MESA) |
1859 | - include_directories(${DRM_INCLUDE_DIRS} ${GBM_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}) |
1860 | - list(APPEND MIR_TEST_DOUBLES_PLATFORM_SRCS |
1861 | - ${CMAKE_CURRENT_SOURCE_DIR}/mock_drm.cpp |
1862 | - ${CMAKE_CURRENT_SOURCE_DIR}/mock_gbm.cpp |
1863 | - ) |
1864 | +include_directories(${DRM_INCLUDE_DIRS} ${GBM_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}) |
1865 | +list(APPEND MIR_TEST_DOUBLES_PLATFORM_SRCS |
1866 | + ${CMAKE_CURRENT_SOURCE_DIR}/mock_drm.cpp |
1867 | + ${CMAKE_CURRENT_SOURCE_DIR}/mock_gbm.cpp |
1868 | +) |
1869 | endif() |
1870 | - |
1871 | if (MIR_BUILD_PLATFORM_ANDROID) |
1872 | - include_directories(SYSTEM ${ANDROID_HEADERS_INCLUDE_DIRS}) |
1873 | - list(APPEND MIR_TEST_DOUBLES_PLATFORM_SRCS |
1874 | - ${CMAKE_CURRENT_SOURCE_DIR}/mock_android_hw.cpp |
1875 | - ) |
1876 | +list(APPEND MIR_TEST_DOUBLES_PLATFORM_SRCS |
1877 | + ${CMAKE_CURRENT_SOURCE_DIR}/mock_android_hw.cpp |
1878 | +) |
1879 | endif() |
1880 | |
1881 | add_library( |
1882 | |
1883 | === modified file 'tests/mir_test_framework/CMakeLists.txt' |
1884 | --- tests/mir_test_framework/CMakeLists.txt 2015-01-19 06:55:41 +0000 |
1885 | +++ tests/mir_test_framework/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
1886 | @@ -11,11 +11,6 @@ |
1887 | ${ANDROID_HEADERS_INCLUDE_DIRS} |
1888 | ) |
1889 | |
1890 | -add_definitions( |
1891 | - -DMIR_CLIENT_PLATFORM_PATH="${MIR_CLIENT_PLATFORM_PATH}" |
1892 | - -DMIR_SERVER_PLATFORM_PATH="${MIR_SERVER_PLATFORM_PATH}" |
1893 | - ) |
1894 | - |
1895 | set( |
1896 | TEST_FRAMEWORK_SRCS |
1897 | |
1898 | @@ -39,7 +34,6 @@ |
1899 | process.cpp |
1900 | using_stub_client_platform.cpp |
1901 | stub_client_platform_factory.cpp |
1902 | - stub_server_platform_factory.cpp |
1903 | udev_environment.cpp |
1904 | declarative_placement_strategy.cpp |
1905 | fake_event_hub_server_configuration.cpp |
1906 | @@ -65,8 +59,8 @@ |
1907 | target_link_libraries( |
1908 | mir-test-framework |
1909 | |
1910 | + mirplatformstub |
1911 | 3rd_party |
1912 | - mir-test-doubles |
1913 | |
1914 | ${PROTOBUF_LIBRARIES} |
1915 | ${Boost_LIBRARIES} |
1916 | @@ -100,31 +94,6 @@ |
1917 | LINK_FLAGS "-Wl,--version-script,${symbol_map}" |
1918 | ) |
1919 | |
1920 | -set(server_symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols-server.map) |
1921 | -add_library( |
1922 | - mirplatformgraphicsstub MODULE |
1923 | - |
1924 | - platform_graphics_dummy.cpp |
1925 | - stubbed_graphics_platform.cpp |
1926 | -) |
1927 | - |
1928 | -target_link_libraries( |
1929 | - mirplatformgraphicsstub |
1930 | - |
1931 | - mir-test |
1932 | - mir-test-framework |
1933 | - mir-test-doubles |
1934 | - ${UMOCKDEV_LDFLAGS} ${UMOCKDEV_LIBRARIES} |
1935 | -) |
1936 | - |
1937 | -set_target_properties( |
1938 | - mirplatformgraphicsstub PROPERTIES; |
1939 | - LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/server-modules |
1940 | - OUTPUT_NAME graphics-dummy |
1941 | - PREFIX "" |
1942 | - LINK_FLAGS "-Wl,--version-script,${server_symbol_map}" |
1943 | -) |
1944 | - |
1945 | add_custom_command(TARGET mir-test-framework POST_BUILD |
1946 | COMMAND ${CMAKE_COMMAND} -E copy_directory |
1947 | ${CMAKE_CURRENT_SOURCE_DIR}/udev_recordings ${CMAKE_BINARY_DIR}/bin/udev_recordings |
1948 | @@ -136,8 +105,21 @@ |
1949 | COMMENT "Copying testing cursor themes to build dir..." |
1950 | ) |
1951 | |
1952 | -string (REPLACE " -Wl,--no-undefined" " " CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS}) |
1953 | - |
1954 | -install(TARGETS mirplatformgraphicsstub LIBRARY DESTINATION ${MIR_SERVER_PLATFORM_PATH}) |
1955 | - |
1956 | +add_library( |
1957 | + mirplatformstub SHARED |
1958 | + stubbed_graphics_platform.cpp |
1959 | +) |
1960 | + |
1961 | +target_link_libraries(mirplatformstub |
1962 | + mirplatform |
1963 | + mir-test-doubles |
1964 | + mir-test |
1965 | +) |
1966 | + |
1967 | +set_target_properties(mirplatformstub |
1968 | + PROPERTIES |
1969 | + LINK_FLAGS "-Wl,--exclude-libs=ALL" |
1970 | +) |
1971 | + |
1972 | +install(TARGETS mirplatformstub LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
1973 | install(TARGETS mirclientplatformstub LIBRARY DESTINATION ${MIR_CLIENT_PLATFORM_PATH}) |
1974 | |
1975 | === modified file 'tests/mir_test_framework/executable_path.cpp' |
1976 | --- tests/mir_test_framework/executable_path.cpp 2015-01-19 06:55:41 +0000 |
1977 | +++ tests/mir_test_framework/executable_path.cpp 2015-01-26 13:27:35 +0000 |
1978 | @@ -24,7 +24,6 @@ |
1979 | #include <stdexcept> |
1980 | #include <boost/throw_exception.hpp> |
1981 | #include <boost/exception/errinfo_errno.hpp> |
1982 | -#include <boost/filesystem.hpp> |
1983 | |
1984 | std::string mir_test_framework::executable_path() |
1985 | { |
1986 | @@ -44,29 +43,3 @@ |
1987 | { |
1988 | return executable_path() + "/../lib"; |
1989 | } |
1990 | - |
1991 | -std::string mir_test_framework::server_platform(std::string const& name) |
1992 | -{ |
1993 | - for (auto const& option : |
1994 | - {library_path() + "/server-modules/", library_path() + "/server-platform/", std::string(MIR_SERVER_PLATFORM_PATH) + '/'}) |
1995 | - { |
1996 | - auto path_to_test = option + name; |
1997 | - if (boost::filesystem::exists(path_to_test)) |
1998 | - return path_to_test; |
1999 | - } |
2000 | - |
2001 | - BOOST_THROW_EXCEPTION(std::runtime_error("Failed to find server platform in standard search locations")); |
2002 | -} |
2003 | - |
2004 | -std::string mir_test_framework::client_platform(std::string const& name) |
2005 | -{ |
2006 | - for (auto const& option : |
2007 | - {library_path() + "/client-modules/", library_path() + "/client-platform/", std::string(MIR_CLIENT_PLATFORM_PATH) + '/'}) |
2008 | - { |
2009 | - auto path_to_test = option + name; |
2010 | - if (boost::filesystem::exists(path_to_test)) |
2011 | - return path_to_test; |
2012 | - } |
2013 | - |
2014 | - BOOST_THROW_EXCEPTION(std::runtime_error("Failed to find server platform in standard search locations")); |
2015 | -} |
2016 | |
2017 | === modified file 'tests/mir_test_framework/headless_test.cpp' |
2018 | --- tests/mir_test_framework/headless_test.cpp 2015-01-19 06:55:41 +0000 |
2019 | +++ tests/mir_test_framework/headless_test.cpp 2015-01-26 13:27:35 +0000 |
2020 | @@ -17,30 +17,52 @@ |
2021 | */ |
2022 | |
2023 | #include "mir_test_framework/headless_test.h" |
2024 | -#include "mir_test_framework/stub_server_platform_factory.h" |
2025 | |
2026 | #include "mir/shared_library.h" |
2027 | #include "mir/geometry/rectangle.h" |
2028 | -#include "mir_test_framework/executable_path.h" |
2029 | |
2030 | #include <boost/throw_exception.hpp> |
2031 | |
2032 | namespace geom = mir::geometry; |
2033 | namespace mtf = mir_test_framework; |
2034 | |
2035 | +namespace |
2036 | +{ |
2037 | +const char* const mir_server_platform_graphics_lib = "MIR_SERVER_PLATFORM_GRAPHICS_LIB"; |
2038 | + |
2039 | +std::chrono::seconds const timeout{10}; |
2040 | +} |
2041 | + |
2042 | mtf::HeadlessTest::HeadlessTest() |
2043 | { |
2044 | - add_to_environment("MIR_SERVER_PLATFORM_GRAPHICS_LIB", mtf::server_platform("graphics-dummy.so").c_str()); |
2045 | + add_to_environment(mir_server_platform_graphics_lib, "libmirplatformstub.so"); |
2046 | } |
2047 | |
2048 | mtf::HeadlessTest::~HeadlessTest() noexcept = default; |
2049 | |
2050 | + |
2051 | void mtf::HeadlessTest::preset_display(std::shared_ptr<mir::graphics::Display> const& display) |
2052 | { |
2053 | - mtf::set_next_preset_display(display); |
2054 | + if (!server_platform_graphics_lib) |
2055 | + server_platform_graphics_lib.reset(new mir::SharedLibrary{getenv(mir_server_platform_graphics_lib)}); |
2056 | + |
2057 | + typedef void (*PresetDisplay)(std::shared_ptr<mir::graphics::Display> const&); |
2058 | + |
2059 | + auto const preset_display = |
2060 | + server_platform_graphics_lib->load_function<PresetDisplay>("preset_display"); |
2061 | + |
2062 | + preset_display(display); |
2063 | } |
2064 | |
2065 | void mtf::HeadlessTest::initial_display_layout(std::vector<geom::Rectangle> const& display_rects) |
2066 | { |
2067 | - mtf::set_next_display_rects(std::unique_ptr<std::vector<geom::Rectangle>>(new std::vector<geom::Rectangle>(display_rects))); |
2068 | + if (!server_platform_graphics_lib) |
2069 | + server_platform_graphics_lib.reset(new mir::SharedLibrary{getenv(mir_server_platform_graphics_lib)}); |
2070 | + |
2071 | + typedef void (*SetDisplayRects)(std::unique_ptr<std::vector<geom::Rectangle>>&&); |
2072 | + |
2073 | + auto const set_display_rects = |
2074 | + server_platform_graphics_lib->load_function<SetDisplayRects>("set_display_rects"); |
2075 | + |
2076 | + set_display_rects(std::unique_ptr<std::vector<geom::Rectangle>>(new std::vector<geom::Rectangle>(display_rects))); |
2077 | } |
2078 | |
2079 | === removed file 'tests/mir_test_framework/platform_graphics_dummy.cpp' |
2080 | --- tests/mir_test_framework/platform_graphics_dummy.cpp 2014-12-17 13:38:05 +0000 |
2081 | +++ tests/mir_test_framework/platform_graphics_dummy.cpp 1970-01-01 00:00:00 +0000 |
2082 | @@ -1,36 +0,0 @@ |
2083 | -/* |
2084 | - * Copyright © 2014 Canonical Ltd. |
2085 | - * |
2086 | - * This program is free software: you can redistribute it and/or modify it |
2087 | - * under the terms of the GNU General Public License version 3, |
2088 | - * as published by the Free Software Foundation. |
2089 | - * |
2090 | - * This program is distributed in the hope that it will be useful, |
2091 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2092 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2093 | - * GNU General Public License for more details. |
2094 | - * |
2095 | - * You should have received a copy of the GNU General Public License |
2096 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2097 | - * |
2098 | - * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>> |
2099 | - */ |
2100 | - |
2101 | -#include "mir/graphics/platform.h" |
2102 | - |
2103 | -extern "C" mir::graphics::PlatformPriority probe_graphics_platform() |
2104 | -{ |
2105 | - return mir::graphics::supported; |
2106 | -} |
2107 | - |
2108 | -mir::ModuleProperties const description { |
2109 | - "dummy", |
2110 | - MIR_VERSION_MAJOR, |
2111 | - MIR_VERSION_MINOR, |
2112 | - MIR_VERSION_MICRO |
2113 | -}; |
2114 | - |
2115 | -extern "C" mir::ModuleProperties const* describe_graphics_module() |
2116 | -{ |
2117 | - return &description; |
2118 | -} |
2119 | |
2120 | === modified file 'tests/mir_test_framework/stub_client_platform_factory.cpp' |
2121 | --- tests/mir_test_framework/stub_client_platform_factory.cpp 2015-01-18 10:29:31 +0000 |
2122 | +++ tests/mir_test_framework/stub_client_platform_factory.cpp 2015-01-26 13:27:35 +0000 |
2123 | @@ -22,7 +22,6 @@ |
2124 | #include "mir/client_buffer.h" |
2125 | #include "mir/client_platform.h" |
2126 | |
2127 | -#include <unistd.h> |
2128 | #include <string.h> |
2129 | |
2130 | namespace mcl = mir::client; |
2131 | |
2132 | === removed file 'tests/mir_test_framework/stub_server_platform_factory.cpp' |
2133 | --- tests/mir_test_framework/stub_server_platform_factory.cpp 2014-12-17 23:11:11 +0000 |
2134 | +++ tests/mir_test_framework/stub_server_platform_factory.cpp 1970-01-01 00:00:00 +0000 |
2135 | @@ -1,72 +0,0 @@ |
2136 | - |
2137 | -/* |
2138 | - * Copyright © 2014 Canonical Ltd. |
2139 | - * |
2140 | - * This program is free software: you can redistribute it and/or modify it |
2141 | - * under the terms of the GNU General Public License version 3, |
2142 | - * as published by the Free Software Foundation. |
2143 | - * |
2144 | - * This program is distributed in the hope that it will be useful, |
2145 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2146 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2147 | - * GNU General Public License for more details. |
2148 | - * |
2149 | - * You should have received a copy of the GNU General Public License |
2150 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2151 | - * |
2152 | - * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
2153 | - */ |
2154 | - |
2155 | -#include "mir/shared_library.h" |
2156 | - |
2157 | -#include "mir/geometry/rectangle.h" |
2158 | - |
2159 | -#include "mir_test_framework/executable_path.h" |
2160 | -#include "mir_test_framework/stub_server_platform_factory.h" |
2161 | - |
2162 | -#include <vector> |
2163 | - |
2164 | -namespace geom = mir::geometry; |
2165 | -namespace mg = mir::graphics; |
2166 | -namespace mtf = mir_test_framework; |
2167 | - |
2168 | -namespace |
2169 | -{ |
2170 | -// NOTE: Raw pointer, deliberately leaked to bypass all the fun |
2171 | -// issues around global destructor ordering. |
2172 | -mir::SharedLibrary* platform_lib{nullptr}; |
2173 | - |
2174 | -void ensure_platform_library() |
2175 | -{ |
2176 | - if (!platform_lib) |
2177 | - { |
2178 | - platform_lib = new mir::SharedLibrary{mtf::server_platform("graphics-dummy.so")}; |
2179 | - } |
2180 | -} |
2181 | -} |
2182 | - |
2183 | -std::shared_ptr<mg::Platform> mtf::make_stubbed_server_graphics_platform(std::vector<geom::Rectangle> const& display_rects) |
2184 | -{ |
2185 | - ensure_platform_library(); |
2186 | - auto factory = platform_lib->load_function<std::shared_ptr<mg::Platform>(*)(std::vector<geom::Rectangle> const&)>("create_stub_platform"); |
2187 | - |
2188 | - return factory(display_rects); |
2189 | -} |
2190 | - |
2191 | -void mtf::set_next_display_rects(std::unique_ptr<std::vector<geom::Rectangle>>&& display_rects) |
2192 | -{ |
2193 | - ensure_platform_library(); |
2194 | - |
2195 | - auto rect_setter = platform_lib->load_function<void(*)(std::unique_ptr<std::vector<geom::Rectangle>>&&)>("set_next_display_rects"); |
2196 | - |
2197 | - rect_setter(std::move(display_rects)); |
2198 | -} |
2199 | - |
2200 | -void mtf::set_next_preset_display(std::shared_ptr<mir::graphics::Display> const& display) |
2201 | -{ |
2202 | - ensure_platform_library(); |
2203 | - |
2204 | - auto display_setter = platform_lib->load_function<void(*)(std::shared_ptr<mir::graphics::Display> const&)>("set_next_preset_display"); |
2205 | - |
2206 | - display_setter(display); |
2207 | -} |
2208 | |
2209 | === modified file 'tests/mir_test_framework/stubbed_graphics_platform.cpp' |
2210 | --- tests/mir_test_framework/stubbed_graphics_platform.cpp 2015-01-19 06:55:41 +0000 |
2211 | +++ tests/mir_test_framework/stubbed_graphics_platform.cpp 2015-01-26 13:27:35 +0000 |
2212 | @@ -243,6 +243,8 @@ |
2213 | |
2214 | namespace |
2215 | { |
2216 | +std::unique_ptr<std::vector<geom::Rectangle>> chosen_display_rects; |
2217 | + |
2218 | struct GuestPlatformAdapter : mg::Platform |
2219 | { |
2220 | GuestPlatformAdapter( |
2221 | @@ -283,12 +285,6 @@ |
2222 | }; |
2223 | |
2224 | std::weak_ptr<mg::Platform> the_graphics_platform{}; |
2225 | -std::unique_ptr<std::vector<geom::Rectangle>> chosen_display_rects; |
2226 | -} |
2227 | - |
2228 | -extern "C" std::shared_ptr<mg::Platform> create_stub_platform(std::vector<geom::Rectangle> const& display_rects) |
2229 | -{ |
2230 | - return std::make_shared<mtf::StubGraphicPlatform>(display_rects); |
2231 | } |
2232 | |
2233 | extern "C" std::shared_ptr<mg::Platform> create_host_platform( |
2234 | @@ -300,12 +296,12 @@ |
2235 | |
2236 | if (auto const display_rects = std::move(chosen_display_rects)) |
2237 | { |
2238 | - result = create_stub_platform(*display_rects); |
2239 | + result = std::make_shared<mtf::StubGraphicPlatform>(*display_rects); |
2240 | } |
2241 | else |
2242 | { |
2243 | static std::vector<geom::Rectangle> const default_display_rects{geom::Rectangle{{0,0},{1600,1600}}}; |
2244 | - result = create_stub_platform(default_display_rects); |
2245 | + result = std::make_shared<mtf::StubGraphicPlatform>(default_display_rects); |
2246 | } |
2247 | the_graphics_platform = result; |
2248 | return result; |
2249 | @@ -319,18 +315,18 @@ |
2250 | return std::make_shared<GuestPlatformAdapter>(context, graphics_platform); |
2251 | } |
2252 | |
2253 | -extern "C" void add_graphis_platform_options( |
2254 | +extern "C" void add_platform_options( |
2255 | boost::program_options::options_description& /*config*/) |
2256 | { |
2257 | } |
2258 | |
2259 | -extern "C" void set_next_display_rects( |
2260 | +extern "C" void set_display_rects( |
2261 | std::unique_ptr<std::vector<geom::Rectangle>>&& display_rects) |
2262 | { |
2263 | chosen_display_rects = std::move(display_rects); |
2264 | } |
2265 | |
2266 | -extern "C" void set_next_preset_display(std::shared_ptr<mir::graphics::Display> const& display) |
2267 | +extern "C" void preset_display(std::shared_ptr<mir::graphics::Display> const& display) |
2268 | { |
2269 | display_preset = display; |
2270 | } |
2271 | |
2272 | === modified file 'tests/mir_test_framework/stubbed_server_configuration.cpp' |
2273 | --- tests/mir_test_framework/stubbed_server_configuration.cpp 2015-01-19 06:55:41 +0000 |
2274 | +++ tests/mir_test_framework/stubbed_server_configuration.cpp 2015-01-26 13:27:35 +0000 |
2275 | @@ -19,7 +19,7 @@ |
2276 | #include "mir_test_framework/stubbed_server_configuration.h" |
2277 | #include "mir_test_framework/command_line_server_configuration.h" |
2278 | |
2279 | -#include "mir_test_framework/stub_server_platform_factory.h" |
2280 | +#include "stubbed_graphics_platform.h" |
2281 | |
2282 | #include "mir/options/default_configuration.h" |
2283 | #include "mir/graphics/cursor.h" |
2284 | @@ -92,7 +92,7 @@ |
2285 | { |
2286 | if (!graphics_platform) |
2287 | { |
2288 | - graphics_platform = mtf::make_stubbed_server_graphics_platform(display_rects); |
2289 | + graphics_platform = std::make_shared<StubGraphicPlatform>(display_rects); |
2290 | } |
2291 | |
2292 | return graphics_platform; |
2293 | |
2294 | === removed file 'tests/mir_test_framework/symbols-server.map' |
2295 | --- tests/mir_test_framework/symbols-server.map 2014-12-17 13:38:05 +0000 |
2296 | +++ tests/mir_test_framework/symbols-server.map 1970-01-01 00:00:00 +0000 |
2297 | @@ -1,8 +0,0 @@ |
2298 | -MIR_GRAPHICS_PLATFORM_1 { |
2299 | - global: |
2300 | - add_graphics_platform_options; |
2301 | - create_host_platform; |
2302 | - create_guest_platform; |
2303 | - probe_graphics_platform; |
2304 | - describe_graphics_module; |
2305 | -}; |
2306 | |
2307 | === modified file 'tests/mir_test_framework/testing_client_options.cpp' |
2308 | --- tests/mir_test_framework/testing_client_options.cpp 2015-01-19 06:55:41 +0000 |
2309 | +++ tests/mir_test_framework/testing_client_options.cpp 2015-01-26 13:27:35 +0000 |
2310 | @@ -16,12 +16,63 @@ |
2311 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
2312 | */ |
2313 | |
2314 | +#include "mir_test_framework/testing_client_configuration.h" |
2315 | #include "mir_test_framework/stub_client_connection_configuration.h" |
2316 | +#include "mir_test_doubles/stub_client_buffer_factory.h" |
2317 | +#include "mir/options/program_option.h" |
2318 | #include "src/client/default_connection_configuration.h" |
2319 | -#include "mir_test_framework/stub_client_platform_factory.h" |
2320 | +#include "mir/client_platform_factory.h" |
2321 | +#include "mir/client_buffer_factory.h" |
2322 | +#include "mir/client_buffer.h" |
2323 | +#include "mir/client_platform.h" |
2324 | +#include "src/client/mir_connection.h" |
2325 | |
2326 | namespace mcl = mir::client; |
2327 | -namespace mtf = mir_test_framework; |
2328 | +namespace mtf=mir_test_framework; |
2329 | +namespace geom = mir::geometry; |
2330 | +namespace mtd = mir::test::doubles; |
2331 | + |
2332 | +namespace |
2333 | +{ |
2334 | +struct StubClientPlatform : public mcl::ClientPlatform |
2335 | +{ |
2336 | + MirPlatformType platform_type() const |
2337 | + { |
2338 | + return mir_platform_type_gbm; |
2339 | + } |
2340 | + |
2341 | + std::shared_ptr<mcl::ClientBufferFactory> create_buffer_factory() |
2342 | + { |
2343 | + return std::make_shared<mtd::StubClientBufferFactory>(); |
2344 | + } |
2345 | + |
2346 | + std::shared_ptr<EGLNativeWindowType> create_egl_native_window(mcl::ClientSurface*) |
2347 | + { |
2348 | + auto fake_window = reinterpret_cast<EGLNativeWindowType>(0x12345678lu); |
2349 | + return std::make_shared<EGLNativeWindowType>(fake_window); |
2350 | + } |
2351 | + |
2352 | + std::shared_ptr<EGLNativeDisplayType> create_egl_native_display() |
2353 | + { |
2354 | + auto fake_display = reinterpret_cast<EGLNativeDisplayType>(0x12345678lu); |
2355 | + return std::make_shared<EGLNativeDisplayType>(fake_display); |
2356 | + } |
2357 | + |
2358 | + MirNativeBuffer* convert_native_buffer(mir::graphics::NativeBuffer*) const |
2359 | + { |
2360 | + return nullptr; |
2361 | + } |
2362 | +}; |
2363 | + |
2364 | +struct StubClientPlatformFactory : public mcl::ClientPlatformFactory |
2365 | +{ |
2366 | + std::shared_ptr<mcl::ClientPlatform> create_client_platform(mcl::ClientContext*) |
2367 | + { |
2368 | + return std::make_shared<StubClientPlatform>(); |
2369 | + } |
2370 | +}; |
2371 | + |
2372 | +} |
2373 | |
2374 | mtf::StubConnectionConfiguration::StubConnectionConfiguration(std::string const& socket_file) |
2375 | : DefaultConnectionConfiguration(socket_file) |
2376 | |
2377 | === modified file 'tests/unit-tests/CMakeLists.txt' |
2378 | --- tests/unit-tests/CMakeLists.txt 2015-01-22 15:39:35 +0000 |
2379 | +++ tests/unit-tests/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
2380 | @@ -1,23 +1,7 @@ |
2381 | include(CMakeDependentOption) |
2382 | |
2383 | -add_definitions(-DTEST_RECORDINGS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/input_recordings/") |
2384 | - |
2385 | -if (MIR_BUILD_PLATFORM_ANDROID) |
2386 | - add_definitions(-DMIR_BUILD_PLATFORM_ANDROID) |
2387 | -endif() |
2388 | - |
2389 | -if (MIR_BUILD_PLATFORM_MESA) |
2390 | - add_definitions(-DMIR_BUILD_PLATFORM_MESA) |
2391 | -endif() |
2392 | - |
2393 | include_directories( |
2394 | ${CMAKE_SOURCE_DIR} |
2395 | - |
2396 | - ${ANDROID_HEADERS_INCLUDE_DIRS} |
2397 | - ${DRM_INCLUDE_DIRS} |
2398 | - ${GBM_INCLUDE_DIRS} |
2399 | - ${UMOCKDEV_INCLUDE_DIRS} |
2400 | - |
2401 | ${PROJECT_SOURCE_DIR}/src/include/platform |
2402 | ${PROJECT_SOURCE_DIR}/src/include/server |
2403 | ${PROJECT_SOURCE_DIR}/src/include/client |
2404 | @@ -26,6 +10,12 @@ |
2405 | ${GLIB_INCLUDE_DIRS} |
2406 | ) |
2407 | |
2408 | +add_definitions( |
2409 | + -DTEST_RECORDINGS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/input_recordings/" |
2410 | + -DMIR_CLIENT_DRIVER_BINARY="${MIR_CLIENT_DRIVER_BINARY}" |
2411 | +) |
2412 | + |
2413 | +include_directories(${DRM_INCLUDE_DIRS} ${GBM_INCLUDE_DIRS} ${UMOCKDEV_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}) |
2414 | # TODO: Aim to remove |
2415 | include_directories(${MIR_XCURSOR_INCLUDE_DIRECTORIES}) |
2416 | |
2417 | @@ -89,9 +79,9 @@ |
2418 | demo-shell |
2419 | |
2420 | mir-test |
2421 | - mir-test-framework |
2422 | mir-test-doubles |
2423 | mir-test-doubles-platform |
2424 | + mir-test-framework |
2425 | |
2426 | 3rd_party |
2427 | |
2428 | @@ -101,15 +91,6 @@ |
2429 | ${GMOCK_MAIN_LIBRARY} |
2430 | ${Boost_LIBRARIES} |
2431 | ${UMOCKDEV_LIBRARIES} |
2432 | - # Mesa platform dependencies |
2433 | - ${DRM_LDFLAGS} ${DRM_LIBRARIES} |
2434 | - ${GBM_LDFLAGS} ${GBM_LIBRARIES} |
2435 | - # Android platform dependencies |
2436 | - ${LIBHARDWARE_LIBRARIES} |
2437 | - ${ANDROID_PROPERTIES_LIBRARIES} |
2438 | - # Shared platform dependencies |
2439 | - ${EGL_LDFLAGS} ${EGL_LIBRARIES} |
2440 | - ${GLESv2_LDFLAGS} ${GLESv2_LIBRARIES} |
2441 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
2442 | ${LIBHARDWARE_LDFLAGS} ${LIBHARDWARE_LIBRARIES} |
2443 | ${DRM_LDFLAGS} ${DRM_LIBRARIES} |
2444 | @@ -118,7 +99,7 @@ |
2445 | ${MIR_SERVER_REFERENCES} |
2446 | ) |
2447 | |
2448 | -if (MIR_BUILD_PLATFORM_ANDROID) |
2449 | +if (MIR_TEST_PLATFORM STREQUAL "android") |
2450 | target_link_libraries(mir_unit_tests |
2451 | mirsharedandroid |
2452 | ${ANDROID_PROPERTIES_LDFLAGS} |
2453 | |
2454 | === modified file 'tests/unit-tests/client/CMakeLists.txt' |
2455 | --- tests/unit-tests/client/CMakeLists.txt 2015-01-19 06:55:41 +0000 |
2456 | +++ tests/unit-tests/client/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
2457 | @@ -13,7 +13,6 @@ |
2458 | ${CMAKE_CURRENT_SOURCE_DIR}/test_probing_client_platform_factory.cpp |
2459 | ${CMAKE_CURRENT_SOURCE_DIR}/test_mir_prompt_session.cpp |
2460 | ${CMAKE_CURRENT_SOURCE_DIR}/test_event_distributor.cpp |
2461 | - ${CMAKE_CURRENT_SOURCE_DIR}/test_probing_client_platform_factory.cpp |
2462 | ${CMAKE_CURRENT_SOURCE_DIR}/test_periodic_perf_report.cpp |
2463 | ) |
2464 | |
2465 | |
2466 | === modified file 'tests/unit-tests/client/test_client_platform.cpp' |
2467 | --- tests/unit-tests/client/test_client_platform.cpp 2015-01-19 06:55:41 +0000 |
2468 | +++ tests/unit-tests/client/test_client_platform.cpp 2015-01-26 13:27:35 +0000 |
2469 | @@ -59,7 +59,7 @@ |
2470 | struct ClientPlatformTest : public ::testing::TestWithParam<ClientPlatformTraits const*> |
2471 | { |
2472 | ClientPlatformTest() |
2473 | - : platform_library{mtf::client_platform(GetParam()->platform_library_name)}, |
2474 | + : platform_library{mtf::library_path() + "/" + GetParam()->platform_library_name}, |
2475 | create_client_platform{platform_library.load_function<mcl::CreateClientPlatform>("create_client_platform")}, |
2476 | probe{platform_library.load_function<mcl::ClientPlatformProbe>("is_appropriate_module")} |
2477 | { |
2478 | @@ -78,7 +78,7 @@ |
2479 | }; |
2480 | |
2481 | #ifdef MIR_BUILD_PLATFORM_ANDROID |
2482 | -ClientPlatformTraits const android_platform{"android.so", |
2483 | +ClientPlatformTraits const android_platform{"/client-modules/android.so", |
2484 | [](MirPlatformPackage& pkg) |
2485 | { |
2486 | ::memset(&pkg, 0, sizeof(pkg)); |
2487 | @@ -93,7 +93,7 @@ |
2488 | #endif |
2489 | |
2490 | #ifdef MIR_BUILD_PLATFORM_MESA |
2491 | -ClientPlatformTraits const mesa_platform{"mesa.so", |
2492 | +ClientPlatformTraits const mesa_platform{"/client-modules/mesa.so", |
2493 | [](MirPlatformPackage& pkg) |
2494 | { |
2495 | ::memset(&pkg, 0, sizeof(pkg)); |
2496 | @@ -108,7 +108,7 @@ |
2497 | |
2498 | #endif |
2499 | |
2500 | -ClientPlatformTraits const dummy_platform{"dummy.so", |
2501 | +ClientPlatformTraits const dummy_platform{"/client-modules/dummy.so", |
2502 | [](MirPlatformPackage& pkg) |
2503 | { |
2504 | mtf::create_stub_platform_package(pkg); |
2505 | |
2506 | === modified file 'tests/unit-tests/client/test_probing_client_platform_factory.cpp' |
2507 | --- tests/unit-tests/client/test_probing_client_platform_factory.cpp 2015-01-18 10:29:31 +0000 |
2508 | +++ tests/unit-tests/client/test_probing_client_platform_factory.cpp 2015-01-26 13:27:35 +0000 |
2509 | @@ -36,10 +36,10 @@ |
2510 | { |
2511 | std::vector<std::shared_ptr<mir::SharedLibrary>> modules; |
2512 | #ifdef MIR_BUILD_PLATFORM_MESA |
2513 | - modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::client_platform("mesa.so"))); |
2514 | + modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::library_path() + "/client-modules/mesa.so")); |
2515 | #endif |
2516 | #ifdef MIR_BUILD_PLATFORM_ANDROID |
2517 | - modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::client_platform("android.so"))); |
2518 | + modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::library_path() + "/client-modules/android.so")); |
2519 | #endif |
2520 | return modules; |
2521 | } |
2522 | @@ -127,7 +127,7 @@ |
2523 | auto modules = all_available_modules(); |
2524 | // NOTE: For minimum fuss, load something that has minimal side-effects... |
2525 | modules.push_back(std::make_shared<mir::SharedLibrary>("libc.so.6")); |
2526 | - modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::client_platform("dummy.so"))); |
2527 | + modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::library_path() + "/client-modules/dummy.so")); |
2528 | |
2529 | mir::client::ProbingClientPlatformFactory factory{modules}; |
2530 | |
2531 | |
2532 | === modified file 'tests/unit-tests/graphics/CMakeLists.txt' |
2533 | --- tests/unit-tests/graphics/CMakeLists.txt 2015-01-19 06:55:41 +0000 |
2534 | +++ tests/unit-tests/graphics/CMakeLists.txt 2015-01-26 13:27:35 +0000 |
2535 | @@ -10,7 +10,6 @@ |
2536 | ${CMAKE_CURRENT_SOURCE_DIR}/test_surfaceless_egl_context.cpp |
2537 | ${CMAKE_CURRENT_SOURCE_DIR}/test_overlapping_output_grouping.cpp |
2538 | ${CMAKE_CURRENT_SOURCE_DIR}/test_program_factory.cpp |
2539 | - ${CMAKE_CURRENT_SOURCE_DIR}/test_platform_prober.cpp |
2540 | ${CMAKE_CURRENT_SOURCE_DIR}/test_software_cursor.cpp |
2541 | ) |
2542 | |
2543 | |
2544 | === modified file 'tests/unit-tests/graphics/android/test_platform.cpp' |
2545 | --- tests/unit-tests/graphics/android/test_platform.cpp 2015-01-22 15:39:35 +0000 |
2546 | +++ tests/unit-tests/graphics/android/test_platform.cpp 2015-01-26 13:27:35 +0000 |
2547 | @@ -28,8 +28,6 @@ |
2548 | #include "mir_test_doubles/fd_matcher.h" |
2549 | #include "mir_test/fake_shared.h" |
2550 | #include "mir_test_doubles/mock_android_native_buffer.h" |
2551 | -#include "mir_test_framework/executable_path.h" |
2552 | -#include "mir/shared_library.h" |
2553 | #include <system/window.h> |
2554 | #include <gtest/gtest.h> |
2555 | |
2556 | @@ -40,9 +38,6 @@ |
2557 | namespace mr=mir::report; |
2558 | namespace geom=mir::geometry; |
2559 | namespace mo=mir::options; |
2560 | -namespace mtf=mir_test_framework; |
2561 | - |
2562 | -static const char probe_platform[] = "probe_graphics_platform"; |
2563 | |
2564 | class PlatformBufferIPCPackaging : public ::testing::Test |
2565 | { |
2566 | @@ -232,27 +227,6 @@ |
2567 | EXPECT_EQ(EGL_DEFAULT_DISPLAY, platform.egl_native_display()); |
2568 | } |
2569 | |
2570 | -TEST(AndroidGraphicsPlatform, probe_returns_unsupported_when_no_hwaccess) |
2571 | -{ |
2572 | - using namespace testing; |
2573 | - NiceMock<mtd::HardwareAccessMock> hwaccess; |
2574 | - |
2575 | - ON_CALL(hwaccess, hw_get_module(_,_)).WillByDefault(Return(-1)); |
2576 | - |
2577 | - mir::SharedLibrary platform_lib{mtf::server_platform("graphics-android.so")}; |
2578 | - auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform); |
2579 | - EXPECT_EQ(mg::PlatformPriority::unsupported, probe()); |
2580 | -} |
2581 | - |
2582 | -TEST(AndroidGraphicsPlatform, probe_returns_best_when_hwaccess_succeeds) |
2583 | -{ |
2584 | - testing::NiceMock<mtd::HardwareAccessMock> hwaccess; |
2585 | - |
2586 | - mir::SharedLibrary platform_lib{mtf::server_platform("graphics-android.so")}; |
2587 | - auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform); |
2588 | - EXPECT_EQ(mg::PlatformPriority::best, probe()); |
2589 | -} |
2590 | - |
2591 | TEST(NestedPlatformCreation, doesnt_access_display_hardware) |
2592 | { |
2593 | using namespace testing; |
2594 | |
2595 | === modified file 'tests/unit-tests/graphics/mesa/test_platform.cpp' |
2596 | --- tests/unit-tests/graphics/mesa/test_platform.cpp 2015-01-22 15:39:35 +0000 |
2597 | +++ tests/unit-tests/graphics/mesa/test_platform.cpp 2015-01-26 13:27:35 +0000 |
2598 | @@ -23,7 +23,6 @@ |
2599 | #include "src/platforms/mesa/server/platform.h" |
2600 | #include "src/server/report/null_report_factory.h" |
2601 | #include "mir/emergency_cleanup_registry.h" |
2602 | -#include "mir/shared_library.h" |
2603 | |
2604 | #include "mir_test_doubles/mock_buffer.h" |
2605 | #include "mir_test_doubles/mock_buffer_ipc_message.h" |
2606 | @@ -34,7 +33,6 @@ |
2607 | #include <gtest/gtest.h> |
2608 | |
2609 | #include "mir_test_framework/udev_environment.h" |
2610 | -#include "mir_test_framework/executable_path.h" |
2611 | #include "mir_test/pipe.h" |
2612 | |
2613 | #include "mir_test_doubles/mock_drm.h" |
2614 | @@ -57,8 +55,6 @@ |
2615 | namespace |
2616 | { |
2617 | |
2618 | -const char probe_platform[] = "probe_graphics_platform"; |
2619 | - |
2620 | class MesaGraphicsPlatform : public ::testing::Test |
2621 | { |
2622 | public: |
2623 | @@ -342,23 +338,3 @@ |
2624 | |
2625 | Mock::VerifyAndClearExpectations(&mock_drm); |
2626 | } |
2627 | - |
2628 | -TEST_F(MesaGraphicsPlatform, probe_returns_unsupported_when_no_drm_udev_devices) |
2629 | -{ |
2630 | - mtf::UdevEnvironment udev_environment; |
2631 | - |
2632 | - mir::SharedLibrary platform_lib{mtf::server_platform("graphics-mesa.so")}; |
2633 | - auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform); |
2634 | - EXPECT_EQ(mg::PlatformPriority::unsupported, probe()); |
2635 | -} |
2636 | - |
2637 | -TEST_F(MesaGraphicsPlatform, probe_returns_best_when_drm_devices_exist) |
2638 | -{ |
2639 | - mtf::UdevEnvironment udev_environment; |
2640 | - |
2641 | - udev_environment.add_standard_device("standard-drm-devices"); |
2642 | - |
2643 | - mir::SharedLibrary platform_lib{mtf::server_platform("graphics-mesa.so")}; |
2644 | - auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform); |
2645 | - EXPECT_EQ(mg::PlatformPriority::best, probe()); |
2646 | -} |
2647 | |
2648 | === removed file 'tests/unit-tests/graphics/test_platform_prober.cpp' |
2649 | --- tests/unit-tests/graphics/test_platform_prober.cpp 2014-12-17 19:59:21 +0000 |
2650 | +++ tests/unit-tests/graphics/test_platform_prober.cpp 1970-01-01 00:00:00 +0000 |
2651 | @@ -1,215 +0,0 @@ |
2652 | -/* |
2653 | - * Copyright © 2014 Canonical Ltd. |
2654 | - * |
2655 | - * This program is free software: you can redistribute it and/or modify |
2656 | - * it under the terms of the GNU General Public License version 3 as |
2657 | - * published by the Free Software Foundation. |
2658 | - * |
2659 | - * This program is distributed in the hope that it will be useful, |
2660 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2661 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2662 | - * GNU General Public License for more details. |
2663 | - * |
2664 | - * You should have received a copy of the GNU General Public License |
2665 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2666 | - * |
2667 | - * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
2668 | - */ |
2669 | - |
2670 | -#include <gtest/gtest.h> |
2671 | - |
2672 | -#include "mir/graphics/platform.h" |
2673 | -#include "mir/graphics/platform_probe.h" |
2674 | - |
2675 | -#include "mir/raii.h" |
2676 | - |
2677 | -#ifdef MIR_BUILD_PLATFORM_MESA |
2678 | -#include "mir_test_doubles/mock_drm.h" |
2679 | -#include "mir_test_doubles/mock_gbm.h" |
2680 | -#endif |
2681 | - |
2682 | -#ifdef MIR_BUILD_PLATFORM_ANDROID |
2683 | -#include "mir_test_doubles/mock_android_hw.h" |
2684 | -#endif |
2685 | - |
2686 | -#include "mir_test_framework/udev_environment.h" |
2687 | -#include "mir_test_framework/executable_path.h" |
2688 | - |
2689 | -namespace mtf = mir_test_framework; |
2690 | -namespace mtd = mir::test::doubles; |
2691 | - |
2692 | -namespace |
2693 | -{ |
2694 | -const char describe_module[] = "describe_graphics_module"; |
2695 | - |
2696 | -std::vector<std::shared_ptr<mir::SharedLibrary>> available_platforms() |
2697 | -{ |
2698 | - std::vector<std::shared_ptr<mir::SharedLibrary>> modules; |
2699 | - |
2700 | -#ifdef MIR_BUILD_PLATFORM_MESA |
2701 | - modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::server_platform("graphics-mesa.so"))); |
2702 | -#endif |
2703 | -#ifdef MIR_BUILD_PLATFORM_ANDROID |
2704 | - modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::server_platform("graphics-android.so"))); |
2705 | -#endif |
2706 | - return modules; |
2707 | -} |
2708 | - |
2709 | -void add_dummy_platform(std::vector<std::shared_ptr<mir::SharedLibrary>>& modules) |
2710 | -{ |
2711 | - modules.insert(modules.begin(), std::make_shared<mir::SharedLibrary>(mtf::server_platform("graphics-dummy.so"))); |
2712 | -} |
2713 | - |
2714 | -std::shared_ptr<void> ensure_android_probing_fails() |
2715 | -{ |
2716 | -#ifdef MIR_BUILD_PLATFORM_ANDROID |
2717 | - using namespace testing; |
2718 | - auto mock_android = std::make_shared<NiceMock<mtd::HardwareAccessMock>>(); |
2719 | - ON_CALL(*mock_android, hw_get_module(_, _)) |
2720 | - .WillByDefault(Return(-1)); |
2721 | - return mock_android; |
2722 | -#else |
2723 | - return std::shared_ptr<void>{}; |
2724 | -#endif |
2725 | -} |
2726 | - |
2727 | -std::shared_ptr<void> ensure_mesa_probing_fails() |
2728 | -{ |
2729 | - return std::make_shared<mtf::UdevEnvironment>(); |
2730 | -} |
2731 | - |
2732 | -std::shared_ptr<void> ensure_mesa_probing_succeeds() |
2733 | -{ |
2734 | - auto udev = std::make_shared<mtf::UdevEnvironment>(); |
2735 | - |
2736 | - udev->add_standard_device("standard-drm-devices"); |
2737 | - |
2738 | - return udev; |
2739 | -} |
2740 | - |
2741 | -std::shared_ptr<void> ensure_android_probing_succeeds() |
2742 | -{ |
2743 | -#ifdef MIR_BUILD_PLATFORM_ANDROID |
2744 | - using namespace testing; |
2745 | - auto mock_android = std::make_shared<NiceMock<mtd::HardwareAccessMock>>(); |
2746 | - ON_CALL(*mock_android, hw_get_module(_, _)) |
2747 | - .WillByDefault(Return(0)); |
2748 | - return mock_android; |
2749 | -#else |
2750 | - return std::shared_ptr<void>{}; |
2751 | -#endif |
2752 | -} |
2753 | -} |
2754 | - |
2755 | -TEST(ServerPlatformProbe, ConstructingWithNoModulesIsAnError) |
2756 | -{ |
2757 | - std::vector<std::shared_ptr<mir::SharedLibrary>> empty_modules; |
2758 | - EXPECT_THROW(mir::graphics::module_for_device(empty_modules), |
2759 | - std::runtime_error); |
2760 | -} |
2761 | - |
2762 | -#ifdef MIR_BUILD_PLATFORM_MESA |
2763 | -TEST(ServerPlatformProbe, LoadsMesaPlatformWhenDrmDevicePresent) |
2764 | -{ |
2765 | - using namespace testing; |
2766 | - auto block_android = ensure_android_probing_fails(); |
2767 | - auto fake_mesa = ensure_mesa_probing_succeeds(); |
2768 | - |
2769 | - auto modules = available_platforms(); |
2770 | - |
2771 | - auto module = mir::graphics::module_for_device(modules); |
2772 | - ASSERT_NE(nullptr, module); |
2773 | - |
2774 | - auto descriptor = module->load_function<mir::graphics::DescribeModule>(describe_module); |
2775 | - auto description = descriptor(); |
2776 | - |
2777 | - EXPECT_THAT(description->name, HasSubstr("mesa")); |
2778 | -} |
2779 | -#endif |
2780 | - |
2781 | -#ifdef MIR_BUILD_PLATFORM_ANDROID |
2782 | -TEST(ServerPlatformProbe, LoadsAndroidPlatformWhenHwaccessSucceeds) |
2783 | -{ |
2784 | - using namespace testing; |
2785 | - |
2786 | - auto block_mesa = ensure_mesa_probing_fails(); |
2787 | - auto fake_android = ensure_android_probing_succeeds(); |
2788 | - |
2789 | - auto modules = available_platforms(); |
2790 | - |
2791 | - auto module = mir::graphics::module_for_device(modules); |
2792 | - ASSERT_NE(nullptr, module); |
2793 | - |
2794 | - auto descriptor = module->load_function<mir::graphics::DescribeModule>(describe_module); |
2795 | - auto description = descriptor(); |
2796 | - |
2797 | - EXPECT_THAT(description->name, HasSubstr("android")); |
2798 | -} |
2799 | -#endif |
2800 | - |
2801 | -TEST(ServerPlatformProbe, ThrowsExceptionWhenNothingProbesSuccessfully) |
2802 | -{ |
2803 | - using namespace testing; |
2804 | - auto block_android = ensure_android_probing_fails(); |
2805 | - auto block_mesa = ensure_mesa_probing_fails(); |
2806 | - |
2807 | - |
2808 | - EXPECT_THROW(mir::graphics::module_for_device(available_platforms()), |
2809 | - std::runtime_error); |
2810 | -} |
2811 | - |
2812 | -TEST(ServerPlatformProbe, LoadsSupportedModuleWhenNoBestModule) |
2813 | -{ |
2814 | - using namespace testing; |
2815 | - auto block_android = ensure_android_probing_fails(); |
2816 | - auto block_mesa = ensure_mesa_probing_fails(); |
2817 | - |
2818 | - auto modules = available_platforms(); |
2819 | - add_dummy_platform(modules); |
2820 | - |
2821 | - auto module = mir::graphics::module_for_device(modules); |
2822 | - ASSERT_NE(nullptr, module); |
2823 | - |
2824 | - auto descriptor = module->load_function<mir::graphics::DescribeModule>(describe_module); |
2825 | - auto description = descriptor(); |
2826 | - |
2827 | - EXPECT_THAT(description->name, HasSubstr("dummy")); |
2828 | -} |
2829 | - |
2830 | -TEST(ServerPlatformProbe, LoadsMesaOrAndroidInPreferenceToDummy) |
2831 | -{ |
2832 | - using namespace testing; |
2833 | - |
2834 | - auto ensure_mesa = ensure_mesa_probing_succeeds(); |
2835 | - auto ensure_android = ensure_android_probing_succeeds(); |
2836 | - |
2837 | - auto modules = available_platforms(); |
2838 | - add_dummy_platform(modules); |
2839 | - |
2840 | - auto module = mir::graphics::module_for_device(modules); |
2841 | - ASSERT_NE(nullptr, module); |
2842 | - |
2843 | - auto descriptor = module->load_function<mir::graphics::DescribeModule>(describe_module); |
2844 | - auto description = descriptor(); |
2845 | - |
2846 | - EXPECT_THAT(description->name, Not(HasSubstr("dummy"))); |
2847 | -} |
2848 | - |
2849 | -TEST(ServerPlatformProbe, IgnoresNonPlatformModules) |
2850 | -{ |
2851 | - using namespace testing; |
2852 | - |
2853 | - auto ensure_mesa = ensure_mesa_probing_succeeds(); |
2854 | - auto ensure_android = ensure_android_probing_succeeds(); |
2855 | - |
2856 | - auto modules = available_platforms(); |
2857 | - add_dummy_platform(modules); |
2858 | - |
2859 | - // NOTE: We want to load something that doesn't link with libmirplatform, |
2860 | - // due to protobuf throwing a screaming hissy fit if it gets loaded twice. |
2861 | - modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::client_platform("dummy.so"))); |
2862 | - |
2863 | - |
2864 | - auto module = mir::graphics::module_for_device(modules); |
2865 | - EXPECT_NE(nullptr, module); |
2866 | -} |
2867 | |
2868 | === modified file 'tests/unit-tests/shared_library_test.cpp' |
2869 | --- tests/unit-tests/shared_library_test.cpp 2015-01-19 06:55:41 +0000 |
2870 | +++ tests/unit-tests/shared_library_test.cpp 2015-01-26 13:27:35 +0000 |
2871 | @@ -59,7 +59,7 @@ |
2872 | public: |
2873 | SharedLibrary() |
2874 | : nonexistent_library{"imma_totally_not_a_library"}, |
2875 | - existing_library{mtf::client_platform("mesa.so")}, |
2876 | + existing_library{mtf::library_path() + "/client-modules/mesa.so"}, |
2877 | nonexistent_function{"yo_dawg"}, |
2878 | existing_function{"create_client_platform"}, |
2879 | existent_version{"MIR_CLIENT_PLATFORM_2"}, |
2880 | |
2881 | === modified file 'tools/install_on_android.sh' |
2882 | --- tools/install_on_android.sh 2015-01-19 06:55:41 +0000 |
2883 | +++ tools/install_on_android.sh 2015-01-26 13:27:35 +0000 |
2884 | @@ -32,11 +32,11 @@ |
2885 | lib/libmirclient.so.* \ |
2886 | lib/libmircommon.so.* \ |
2887 | lib/libmirplatform.so.* \ |
2888 | - lib/platform-graphics-dummy.so \ |
2889 | - lib/client-modules/* \ |
2890 | - lib/server-modules/* \ |
2891 | + lib/libmirplatform*driver.so \ |
2892 | + lib/libmirclient*driver.so \ |
2893 | lib/libmirprotobuf.so.* \ |
2894 | lib/libmirclient-debug-extension.so.* \ |
2895 | + lib/libmirplatformstub.so \ |
2896 | lib/libmirserver.so.* |
2897 | do |
2898 | adb push $x ${RUN_DIR} |
2899 | |
2900 | === modified file 'tools/valgrind_suppressions_armhf' |
2901 | --- tools/valgrind_suppressions_armhf 2015-01-23 16:25:00 +0000 |
2902 | +++ tools/valgrind_suppressions_armhf 2015-01-26 13:27:35 +0000 |
2903 | @@ -134,15 +134,6 @@ |
2904 | # memory errors. |
2905 | |
2906 | { |
2907 | - spurious_strlen_addr4 |
2908 | - Memcheck:Addr4 |
2909 | - ... |
2910 | - fun:dlsym |
2911 | - ... |
2912 | - fun:_ZN50SharedLibrary_load_nonexistent_function_fails_Test8TestBodyEv |
2913 | -} |
2914 | - |
2915 | -{ |
2916 | mir_sharedlibrary_cond |
2917 | Memcheck:Cond |
2918 | fun:_ZN3mir13SharedLibraryC1EPKc |
Thanks for the quick action on this one.
LGTM.