Mir

Merge lp:~afrantzis/mir/versioned-platform-libraries into lp:mir

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 2333
Proposed branch: lp:~afrantzis/mir/versioned-platform-libraries
Merge into: lp:mir
Diff against target: 473 lines (+73/-35)
25 files modified
debian/control (+8/-8)
debian/mir-client-platform-android2.install (+1/-1)
debian/mir-client-platform-mesa2.install (+1/-1)
debian/mir-platform-graphics-android2.install (+1/-1)
debian/mir-platform-graphics-mesa2.install (+1/-1)
src/CMakeLists.txt (+5/-2)
src/client/CMakeLists.txt (+1/-2)
src/common/sharedlibrary/shared_library_prober.cpp (+9/-1)
src/platform/graphics/platform_probe.cpp (+1/-1)
src/platforms/CMakeLists.txt (+8/-1)
src/platforms/android/client/CMakeLists.txt (+1/-0)
src/platforms/android/server/CMakeLists.txt (+1/-0)
src/platforms/mesa/client/CMakeLists.txt (+1/-0)
src/platforms/mesa/server/CMakeLists.txt (+1/-0)
tests/acceptance-tests/test_symbols_required_by_mesa.cpp (+1/-1)
tests/include/mir_test_framework/client_platform_factory.h (+2/-2)
tests/mir_test_framework/CMakeLists.txt (+2/-0)
tests/mir_test_framework/executable_path.cpp (+12/-2)
tests/unit-tests/client/test_client_platform.cpp (+2/-2)
tests/unit-tests/client/test_probing_client_platform_factory.cpp (+2/-2)
tests/unit-tests/graphics/android/test_platform.cpp (+2/-2)
tests/unit-tests/graphics/mesa/test_platform.cpp (+2/-2)
tests/unit-tests/graphics/test_platform_prober.cpp (+2/-2)
tests/unit-tests/shared_library_test.cpp (+1/-1)
tests/unit-tests/test_shared_library_prober.cpp (+5/-0)
To merge this branch: bzr merge lp:~afrantzis/mir/versioned-platform-libraries
Reviewer Review Type Date Requested Status
Andreas Pokorny (community) Approve
Daniel van Vugt Abstain
Chris Halse Rogers Approve
Kevin DuBois (community) Approve
Alan Griffiths Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+250439@code.launchpad.net

Commit message

platforms: Use the ABI version in platform library names and packages

Description of the change

platforms: Use the ABI version in platform library names and packages

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

The test branch at [1] passes CI, which is good sign that this MP is doing what it needs to do.

[1] https://code.launchpad.net/~afrantzis/mir/versioned-platform-libraries-plus-server-abi-bump/+merge/250441

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> The test branch at [1] passes CI, which is good sign that this MP is doing
> what it needs to do.
>
> [1] https://code.launchpad.net/~afrantzis/mir/versioned-platform-libraries-
> plus-server-abi-bump/+merge/250441

It also looks sensible

review: Approve
Revision history for this message
Kevin DuBois (kdub) wrote :

seems sensible

review: Approve
Revision history for this message
Chris Halse Rogers (raof) wrote :

Urgh, ugly.

But yes. Probably easier to do this than to expose both MIR_PLATFORM_GRAPHICS_1 and MIR_PLATFORM_GRAPHICS_2 from the platforms.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I recall pointing this out when raof abolished versioning on these. He had convincing reasons to not want versioning, but I forget...

review: Needs Information
Revision history for this message
Chris Halse Rogers (raof) wrote :

Versioning these was unnecessary at the time, I didn't think the ABI would change rapidly, and we could provide both ABIs with a single library anyway.

The specific change that broke ABI makes it moderately annoying to provide both ABIs, although it'd be interesting to see how difficult that actually is...

Revision history for this message
Daniel van Vugt (vanvugt) :
review: Abstain
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

ok

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2015-02-19 10:37:47 +0000
3+++ debian/control 2015-02-20 12:38:23 +0000
4@@ -266,7 +266,7 @@
5 Contains the shared libraries required for the Mir server and client.
6
7 # Longer-term these drivers should move out-of-tree
8-Package: mir-platform-graphics-mesa
9+Package: mir-platform-graphics-mesa2
10 Section: libs
11 Architecture: i386 amd64 armhf arm64
12 Multi-Arch: same
13@@ -280,7 +280,7 @@
14 Contains the shared libraries required for the Mir server to interact with
15 the hardware platform using the Mesa drivers.
16
17-Package: mir-platform-graphics-android
18+Package: mir-platform-graphics-android2
19 Section: libs
20 Architecture: i386 amd64 armhf
21 Multi-Arch: same
22@@ -294,7 +294,7 @@
23 Contains the shared libraries required for the Mir server to interact with
24 the hardware platform using the Android drivers.
25
26-Package: mir-client-platform-mesa
27+Package: mir-client-platform-mesa2
28 Section: libs
29 Architecture: i386 amd64 armhf arm64
30 Multi-Arch: same
31@@ -323,7 +323,7 @@
32 Contains header files required to use the platform specific capabilities of
33 the Mir Mesa backend.
34
35-Package: mir-client-platform-android
36+Package: mir-client-platform-android2
37 Section: libs
38 Architecture: i386 amd64 armhf
39 Multi-Arch: same
40@@ -343,8 +343,8 @@
41 Multi-Arch: same
42 Pre-Depends: ${misc:Pre-Depends}
43 Depends: ${misc:Depends},
44- mir-platform-graphics-mesa,
45- mir-client-platform-mesa,
46+ mir-platform-graphics-mesa2,
47+ mir-client-platform-mesa2,
48 Description: Display server for Ubuntu - desktop driver metapackage
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@@ -358,8 +358,8 @@
52 Multi-Arch: same
53 Pre-Depends: ${misc:Pre-Depends}
54 Depends: ${misc:Depends},
55- mir-platform-graphics-android,
56- mir-client-platform-android,
57+ mir-platform-graphics-android2,
58+ mir-client-platform-android2,
59 Description: Display server for Ubuntu - android driver metapackage
60 Mir is a display server running on linux systems, with a focus on efficiency,
61 robust operation and a well-defined driver model.
62
63=== renamed file 'debian/mir-client-platform-android.install' => 'debian/mir-client-platform-android2.install'
64--- debian/mir-client-platform-android.install 2015-01-21 07:34:50 +0000
65+++ debian/mir-client-platform-android2.install 2015-02-20 12:38:23 +0000
66@@ -1,1 +1,1 @@
67-usr/lib/*/mir/client-platform/android.so
68+usr/lib/*/mir/client-platform/android.so.2
69
70=== renamed file 'debian/mir-client-platform-mesa.install' => 'debian/mir-client-platform-mesa2.install'
71--- debian/mir-client-platform-mesa.install 2015-01-21 07:34:50 +0000
72+++ debian/mir-client-platform-mesa2.install 2015-02-20 12:38:23 +0000
73@@ -1,1 +1,1 @@
74-usr/lib/*/mir/client-platform/mesa.so
75+usr/lib/*/mir/client-platform/mesa.so.2
76
77=== renamed file 'debian/mir-platform-graphics-android.install' => 'debian/mir-platform-graphics-android2.install'
78--- debian/mir-platform-graphics-android.install 2015-01-14 13:09:48 +0000
79+++ debian/mir-platform-graphics-android2.install 2015-02-20 12:38:23 +0000
80@@ -1,1 +1,1 @@
81-usr/lib/*/mir/server-platform/graphics-android.so
82+usr/lib/*/mir/server-platform/graphics-android.so.2
83
84=== renamed file 'debian/mir-platform-graphics-mesa.install' => 'debian/mir-platform-graphics-mesa2.install'
85--- debian/mir-platform-graphics-mesa.install 2015-01-14 13:09:48 +0000
86+++ debian/mir-platform-graphics-mesa2.install 2015-02-20 12:38:23 +0000
87@@ -1,1 +1,1 @@
88-usr/lib/*/mir/server-platform/graphics-mesa.so
89+usr/lib/*/mir/server-platform/graphics-mesa.so.2
90
91=== modified file 'src/CMakeLists.txt'
92--- src/CMakeLists.txt 2015-02-18 03:04:18 +0000
93+++ src/CMakeLists.txt 2015-02-20 12:38:23 +0000
94@@ -1,5 +1,4 @@
95-# We need MIRPLATFORM_ABI and MIR_PLATFORM_DRIVER_BINARY in both libmirplatform
96-# and the platform implementations.
97+# We need MIRPLATFORM_ABI in both libmirplatform and the platform implementations.
98 set(MIRPLATFORM_ABI 7)
99
100 # We need MIR_CLIENT_PLATFORM_PATH in both libmirclient and the platform
101@@ -42,3 +41,7 @@
102 set(MIR_COMMON_REFERENCES ${MIR_COMMON_REFERENCES} PARENT_SCOPE)
103 set(MIR_CLIENT_PLATFORM_PATH ${MIR_CLIENT_PLATFORM_PATH} PARENT_SCOPE)
104 set(MIR_SERVER_PLATFORM_PATH ${MIR_SERVER_PLATFORM_PATH} PARENT_SCOPE)
105+
106+# We need the ABI versions in the tests
107+set(MIR_SERVER_GRAPHICS_PLATFORM_ABI ${MIR_SERVER_GRAPHICS_PLATFORM_ABI} PARENT_SCOPE)
108+set(MIR_CLIENT_PLATFORM_ABI ${MIR_CLIENT_PLATFORM_ABI} PARENT_SCOPE)
109
110=== modified file 'src/client/CMakeLists.txt'
111--- src/client/CMakeLists.txt 2015-02-13 06:12:34 +0000
112+++ src/client/CMakeLists.txt 2015-02-20 12:38:23 +0000
113@@ -24,11 +24,10 @@
114 )
115
116 set(MIRCLIENT_ABI 8)
117-set(CLIENT_PLATFORM_VERSION "MIR_CLIENT_PLATFORM_2")
118 set(symbol_map ${CMAKE_SOURCE_DIR}/src/client/symbols.map)
119
120 add_definitions(-DMIR_CLIENT_PLATFORM_PATH="${MIR_CLIENT_PLATFORM_PATH}/")
121-add_definitions(-DCLIENT_PLATFORM_VERSION="${CLIENT_PLATFORM_VERSION}")
122+add_definitions(-DCLIENT_PLATFORM_VERSION="${MIR_CLIENT_PLATFORM_VERSION}")
123 add_definitions(-DMIR_LOGGING_COMPONENT_FALLBACK="mirclient")
124
125 add_subdirectory(rpc/)
126
127=== modified file 'src/common/sharedlibrary/shared_library_prober.cpp'
128--- src/common/sharedlibrary/shared_library_prober.cpp 2014-09-02 00:28:47 +0000
129+++ src/common/sharedlibrary/shared_library_prober.cpp 2015-02-20 12:38:23 +0000
130@@ -37,6 +37,14 @@
131 }
132 return std::error_code{};
133 }
134+
135+// Libraries can be of the form libname.so(.X.Y)
136+bool path_has_library_extension(boost::filesystem::path const& path)
137+{
138+ return path.extension().string() == ".so" ||
139+ path.string().find(".so.") != std::string::npos;
140+}
141+
142 }
143
144 std::vector<std::shared_ptr<mir::SharedLibrary>>
145@@ -57,7 +65,7 @@
146 std::vector<std::shared_ptr<mir::SharedLibrary>> libraries;
147 for (; iterator != boost::filesystem::directory_iterator() ; ++iterator)
148 {
149- if (iterator->path().extension().string() == ".so")
150+ if (path_has_library_extension(iterator->path()))
151 {
152 try
153 {
154
155=== modified file 'src/platform/graphics/platform_probe.cpp'
156--- src/platform/graphics/platform_probe.cpp 2014-12-17 13:48:10 +0000
157+++ src/platform/graphics/platform_probe.cpp 2015-02-20 12:38:23 +0000
158@@ -47,7 +47,7 @@
159 {
160 // Tried to probe a SharedLibrary that isn't a platform module?
161 ml::log(ml::Severity::warning,
162- std::string{"Failed to probe module. Not a platform library? Error: "} + err.what(),
163+ std::string{"Failed to probe module. Not a platform library or incorrect ABI version? Error: "} + err.what(),
164 "Platform Probing");
165 }
166 }
167
168=== modified file 'src/platforms/CMakeLists.txt'
169--- src/platforms/CMakeLists.txt 2015-02-18 03:04:18 +0000
170+++ src/platforms/CMakeLists.txt 2015-02-20 12:38:23 +0000
171@@ -3,7 +3,9 @@
172 # This ABI is much smaller than the full libmirplatform ABI.
173 #
174 # TODO: Add an extra driver-ABI check target.
175-set(MIR_SERVER_GRAPHICS_PLATFORM_VERSION "MIR_GRAPHICS_PLATFORM_2")
176+set(MIR_SERVER_GRAPHICS_PLATFORM_ABI 2)
177+set(MIR_SERVER_GRAPHICS_PLATFORM_ABI ${MIR_SERVER_GRAPHICS_PLATFORM_ABI} PARENT_SCOPE)
178+set(MIR_SERVER_GRAPHICS_PLATFORM_VERSION "MIR_GRAPHICS_PLATFORM_${MIR_SERVER_GRAPHICS_PLATFORM_ABI}")
179 set(MIR_SERVER_GRAPHICS_PLATFORM_VERSION ${MIR_SERVER_GRAPHICS_PLATFORM_VERSION} PARENT_SCOPE)
180
181 set(MIR_SERVER_PLATFORM_PATH
182@@ -14,6 +16,11 @@
183 PARENT_SCOPE
184 )
185
186+set(MIR_CLIENT_PLATFORM_ABI 2)
187+set(MIR_CLIENT_PLATFORM_ABI ${MIR_CLIENT_PLATFORM_ABI} PARENT_SCOPE)
188+set(MIR_CLIENT_PLATFORM_VERSION "MIR_CLIENT_PLATFORM_${MIR_CLIENT_PLATFORM_ABI}")
189+set(MIR_CLIENT_PLATFORM_VERSION ${MIR_CLIENT_PLATFORM_VERSION} PARENT_SCOPE)
190+
191 set(server_common_include_dirs
192 ${PROJECT_SOURCE_DIR}/include/platform
193 )
194
195=== modified file 'src/platforms/android/client/CMakeLists.txt'
196--- src/platforms/android/client/CMakeLists.txt 2015-02-13 06:12:34 +0000
197+++ src/platforms/android/client/CMakeLists.txt 2015-02-20 12:38:23 +0000
198@@ -26,6 +26,7 @@
199 OUTPUT_NAME android
200 LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/client-modules
201 PREFIX ""
202+ SUFFIX ".so.${MIR_CLIENT_PLATFORM_ABI}"
203 LINK_FLAGS "-Wl,--version-script,${symbol_map}"
204 )
205
206
207=== modified file 'src/platforms/android/server/CMakeLists.txt'
208--- src/platforms/android/server/CMakeLists.txt 2015-02-13 06:12:34 +0000
209+++ src/platforms/android/server/CMakeLists.txt 2015-02-20 12:38:23 +0000
210@@ -63,6 +63,7 @@
211 OUTPUT_NAME graphics-android
212 LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/server-modules
213 PREFIX ""
214+ SUFFIX ".so.${MIR_SERVER_GRAPHICS_PLATFORM_ABI}"
215 LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}"
216 )
217
218
219=== modified file 'src/platforms/mesa/client/CMakeLists.txt'
220--- src/platforms/mesa/client/CMakeLists.txt 2015-01-22 09:00:14 +0000
221+++ src/platforms/mesa/client/CMakeLists.txt 2015-02-20 12:38:23 +0000
222@@ -28,6 +28,7 @@
223 OUTPUT_NAME mesa
224 LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/client-modules
225 PREFIX ""
226+ SUFFIX ".so.${MIR_CLIENT_PLATFORM_ABI}"
227 LINK_FLAGS "-Wl,--version-script,${symbol_map}"
228 )
229
230
231=== modified file 'src/platforms/mesa/server/CMakeLists.txt'
232--- src/platforms/mesa/server/CMakeLists.txt 2015-02-13 06:12:34 +0000
233+++ src/platforms/mesa/server/CMakeLists.txt 2015-02-20 12:38:23 +0000
234@@ -64,6 +64,7 @@
235 OUTPUT_NAME graphics-mesa
236 LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/server-modules
237 PREFIX ""
238+ SUFFIX ".so.${MIR_SERVER_GRAPHICS_PLATFORM_ABI}"
239 LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}"
240 )
241
242
243=== modified file 'tests/acceptance-tests/test_symbols_required_by_mesa.cpp'
244--- tests/acceptance-tests/test_symbols_required_by_mesa.cpp 2015-02-13 06:12:34 +0000
245+++ tests/acceptance-tests/test_symbols_required_by_mesa.cpp 2015-02-20 12:38:23 +0000
246@@ -28,7 +28,7 @@
247
248 TEST(SymbolsRequiredByMesa, are_exported_by_client_platform_mesa)
249 {
250- auto const handle = dlopen(mtf::client_platform("mesa.so").c_str(), RTLD_LAZY);
251+ auto const handle = dlopen(mtf::client_platform("mesa").c_str(), RTLD_LAZY);
252 ASSERT_THAT(handle, NotNull());
253
254 auto const sym = dlsym(handle, "mir_client_mesa_egl_native_display_is_valid");
255
256=== modified file 'tests/include/mir_test_framework/client_platform_factory.h'
257--- tests/include/mir_test_framework/client_platform_factory.h 2015-02-13 06:12:34 +0000
258+++ tests/include/mir_test_framework/client_platform_factory.h 2015-02-20 12:38:23 +0000
259@@ -37,7 +37,7 @@
260 mtd::MockClientContext ctx;
261 ON_CALL(ctx, populate_server_package(_))
262 .WillByDefault(Invoke([](MirPlatformPackage& package) { ::memset(&package, 0, sizeof(package)); }));
263- platform_library = std::make_shared<mir::SharedLibrary>(client_platform("android.so"));
264+ platform_library = std::make_shared<mir::SharedLibrary>(client_platform("android"));
265 auto platform_factory = platform_library->load_function<mir::client::CreateClientPlatform>("create_client_platform");
266 return platform_factory(&ctx);
267 }
268@@ -46,7 +46,7 @@
269 mir::client::ClientContext* client_context)
270 {
271 using namespace testing;
272- platform_library = std::make_shared<mir::SharedLibrary>(client_platform("mesa.so"));
273+ platform_library = std::make_shared<mir::SharedLibrary>(client_platform("mesa"));
274 auto platform_factory = platform_library->load_function<mir::client::CreateClientPlatform>("create_client_platform");
275 return platform_factory(client_context);
276 }
277
278=== modified file 'tests/mir_test_framework/CMakeLists.txt'
279--- tests/mir_test_framework/CMakeLists.txt 2015-02-13 06:12:34 +0000
280+++ tests/mir_test_framework/CMakeLists.txt 2015-02-20 12:38:23 +0000
281@@ -14,6 +14,8 @@
282 add_definitions(
283 -DMIR_CLIENT_PLATFORM_PATH="${MIR_CLIENT_PLATFORM_PATH}"
284 -DMIR_SERVER_PLATFORM_PATH="${MIR_SERVER_PLATFORM_PATH}"
285+ -DMIR_CLIENT_PLATFORM_ABI_STRING="${MIR_CLIENT_PLATFORM_ABI}"
286+ -DMIR_SERVER_GRAPHICS_PLATFORM_ABI_STRING="${MIR_SERVER_GRAPHICS_PLATFORM_ABI}"
287 )
288
289 set(
290
291=== modified file 'tests/mir_test_framework/executable_path.cpp'
292--- tests/mir_test_framework/executable_path.cpp 2015-02-13 06:12:34 +0000
293+++ tests/mir_test_framework/executable_path.cpp 2015-02-20 12:38:23 +0000
294@@ -47,10 +47,15 @@
295
296 std::string mir_test_framework::server_platform(std::string const& name)
297 {
298+ std::string libname{name};
299+
300+ if (libname.find(".so") == std::string::npos)
301+ libname += ".so." MIR_SERVER_GRAPHICS_PLATFORM_ABI_STRING;
302+
303 for (auto const& option :
304 {library_path() + "/server-modules/", library_path() + "/server-platform/", std::string(MIR_SERVER_PLATFORM_PATH) + '/'})
305 {
306- auto path_to_test = option + name;
307+ auto path_to_test = option + libname;
308 if (boost::filesystem::exists(path_to_test))
309 return path_to_test;
310 }
311@@ -60,10 +65,15 @@
312
313 std::string mir_test_framework::client_platform(std::string const& name)
314 {
315+ std::string libname{name};
316+
317+ if (libname.find(".so") == std::string::npos)
318+ libname += ".so." MIR_CLIENT_PLATFORM_ABI_STRING;
319+
320 for (auto const& option :
321 {library_path() + "/client-modules/", library_path() + "/client-platform/", std::string(MIR_CLIENT_PLATFORM_PATH) + '/'})
322 {
323- auto path_to_test = option + name;
324+ auto path_to_test = option + libname;
325 if (boost::filesystem::exists(path_to_test))
326 return path_to_test;
327 }
328
329=== modified file 'tests/unit-tests/client/test_client_platform.cpp'
330--- tests/unit-tests/client/test_client_platform.cpp 2015-02-13 06:12:34 +0000
331+++ tests/unit-tests/client/test_client_platform.cpp 2015-02-20 12:38:23 +0000
332@@ -79,7 +79,7 @@
333 };
334
335 #ifdef MIR_BUILD_PLATFORM_ANDROID
336-ClientPlatformTraits const android_platform{"android.so",
337+ClientPlatformTraits const android_platform{"android",
338 [](MirPlatformPackage& pkg)
339 {
340 ::memset(&pkg, 0, sizeof(pkg));
341@@ -94,7 +94,7 @@
342 #endif
343
344 #ifdef MIR_BUILD_PLATFORM_MESA
345-ClientPlatformTraits const mesa_platform{"mesa.so",
346+ClientPlatformTraits const mesa_platform{"mesa",
347 [](MirPlatformPackage& pkg)
348 {
349 ::memset(&pkg, 0, sizeof(pkg));
350
351=== modified file 'tests/unit-tests/client/test_probing_client_platform_factory.cpp'
352--- tests/unit-tests/client/test_probing_client_platform_factory.cpp 2015-02-13 06:12:34 +0000
353+++ tests/unit-tests/client/test_probing_client_platform_factory.cpp 2015-02-20 12:38:23 +0000
354@@ -36,10 +36,10 @@
355 {
356 std::vector<std::shared_ptr<mir::SharedLibrary>> modules;
357 #ifdef MIR_BUILD_PLATFORM_MESA
358- modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::client_platform("mesa.so")));
359+ modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::client_platform("mesa")));
360 #endif
361 #ifdef MIR_BUILD_PLATFORM_ANDROID
362- modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::client_platform("android.so")));
363+ modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::client_platform("android")));
364 #endif
365 return modules;
366 }
367
368=== modified file 'tests/unit-tests/graphics/android/test_platform.cpp'
369--- tests/unit-tests/graphics/android/test_platform.cpp 2015-02-13 06:12:34 +0000
370+++ tests/unit-tests/graphics/android/test_platform.cpp 2015-02-20 12:38:23 +0000
371@@ -239,7 +239,7 @@
372
373 ON_CALL(hwaccess, hw_get_module(_,_)).WillByDefault(Return(-1));
374
375- mir::SharedLibrary platform_lib{mtf::server_platform("graphics-android.so")};
376+ mir::SharedLibrary platform_lib{mtf::server_platform("graphics-android")};
377 auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform);
378 EXPECT_EQ(mg::PlatformPriority::unsupported, probe());
379 }
380@@ -248,7 +248,7 @@
381 {
382 testing::NiceMock<mtd::HardwareAccessMock> hwaccess;
383
384- mir::SharedLibrary platform_lib{mtf::server_platform("graphics-android.so")};
385+ mir::SharedLibrary platform_lib{mtf::server_platform("graphics-android")};
386 auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform);
387 EXPECT_EQ(mg::PlatformPriority::best, probe());
388 }
389
390=== modified file 'tests/unit-tests/graphics/mesa/test_platform.cpp'
391--- tests/unit-tests/graphics/mesa/test_platform.cpp 2015-02-13 06:12:34 +0000
392+++ tests/unit-tests/graphics/mesa/test_platform.cpp 2015-02-20 12:38:23 +0000
393@@ -304,7 +304,7 @@
394 {
395 mtf::UdevEnvironment udev_environment;
396
397- mir::SharedLibrary platform_lib{mtf::server_platform("graphics-mesa.so")};
398+ mir::SharedLibrary platform_lib{mtf::server_platform("graphics-mesa")};
399 auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform);
400 EXPECT_EQ(mg::PlatformPriority::unsupported, probe());
401 }
402@@ -315,7 +315,7 @@
403
404 udev_environment.add_standard_device("standard-drm-devices");
405
406- mir::SharedLibrary platform_lib{mtf::server_platform("graphics-mesa.so")};
407+ mir::SharedLibrary platform_lib{mtf::server_platform("graphics-mesa")};
408 auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform);
409 EXPECT_EQ(mg::PlatformPriority::best, probe());
410 }
411
412=== modified file 'tests/unit-tests/graphics/test_platform_prober.cpp'
413--- tests/unit-tests/graphics/test_platform_prober.cpp 2014-12-17 19:59:21 +0000
414+++ tests/unit-tests/graphics/test_platform_prober.cpp 2015-02-20 12:38:23 +0000
415@@ -47,10 +47,10 @@
416 std::vector<std::shared_ptr<mir::SharedLibrary>> modules;
417
418 #ifdef MIR_BUILD_PLATFORM_MESA
419- modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::server_platform("graphics-mesa.so")));
420+ modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::server_platform("graphics-mesa")));
421 #endif
422 #ifdef MIR_BUILD_PLATFORM_ANDROID
423- modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::server_platform("graphics-android.so")));
424+ modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::server_platform("graphics-android")));
425 #endif
426 return modules;
427 }
428
429=== modified file 'tests/unit-tests/shared_library_test.cpp'
430--- tests/unit-tests/shared_library_test.cpp 2015-02-13 06:12:34 +0000
431+++ tests/unit-tests/shared_library_test.cpp 2015-02-20 12:38:23 +0000
432@@ -59,7 +59,7 @@
433 public:
434 SharedLibrary()
435 : nonexistent_library{"imma_totally_not_a_library"},
436- existing_library{mtf::client_platform("mesa.so")},
437+ existing_library{mtf::client_platform("dummy.so")},
438 nonexistent_function{"yo_dawg"},
439 existing_function{"create_client_platform"},
440 existent_version{"MIR_CLIENT_PLATFORM_2"},
441
442=== added file 'tests/unit-tests/test_data/libinvalid.so.3'
443=== modified file 'tests/unit-tests/test_shared_library_prober.cpp'
444--- tests/unit-tests/test_shared_library_prober.cpp 2015-01-21 07:34:50 +0000
445+++ tests/unit-tests/test_shared_library_prober.cpp 2015-02-20 12:38:23 +0000
446@@ -162,6 +162,7 @@
447 EXPECT_CALL(report, loading_library(FilenameMatches("libarmhf.so")));
448 EXPECT_CALL(report, loading_library(FilenameMatches("libi386.so")));
449 EXPECT_CALL(report, loading_library(FilenameMatches("libarm64.so")));
450+ EXPECT_CALL(report, loading_library(FilenameMatches("libinvalid.so.3")));
451
452 mir::libraries_for_path(library_path, report);
453 }
454@@ -175,6 +176,7 @@
455 bool amd64_failed{false};
456 bool i386_failed{false};
457 bool arm64_failed{false};
458+ bool invalid_failed{false};
459
460 ON_CALL(report, loading_failed(FilenameMatches("libamd64.so"), _))
461 .WillByDefault(InvokeWithoutArgs([&amd64_failed]() { amd64_failed = true; }));
462@@ -184,8 +186,11 @@
463 .WillByDefault(InvokeWithoutArgs([&i386_failed]() { i386_failed = true; }));
464 ON_CALL(report, loading_failed(FilenameMatches("libarm64.so"), _))
465 .WillByDefault(InvokeWithoutArgs([&arm64_failed]() { arm64_failed = true; }));
466+ ON_CALL(report, loading_failed(FilenameMatches("libinvalid.so.3"), _))
467+ .WillByDefault(InvokeWithoutArgs([&invalid_failed]() { invalid_failed = true; }));
468
469 mir::libraries_for_path(library_path, report);
470
471+ EXPECT_TRUE(invalid_failed);
472 EXPECT_TRUE(i386_failed || amd64_failed || armhf_failed || arm64_failed);
473 }

Subscribers

People subscribed via source and target branches