Mir

Merge lp:~raof/mir/fix-1587569 into lp:mir

Proposed by Chris Halse Rogers
Status: Work in progress
Proposed branch: lp:~raof/mir/fix-1587569
Merge into: lp:mir
Diff against target: 177 lines (+44/-19)
7 files modified
debian/mirtest-dev.install (+1/-1)
tests/CMakeLists.txt (+5/-2)
tests/mir_test/CMakeLists.txt (+0/-4)
tests/mir_test_doubles/CMakeLists.txt (+4/-4)
tests/mir_test_doubles/mock_udev.cpp (+32/-3)
tests/mir_test_framework/CMakeLists.txt (+0/-5)
tests/unit-tests/CMakeLists.txt (+2/-0)
To merge this branch: bzr merge lp:~raof/mir/fix-1587569
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Needs Fixing
Mir development team Pending
Review via email: mp+296163@code.launchpad.net

Commit message

Make mir-test-assist into a shared library.

Since we're shipping this for downstream users we might as well make it a shared library. This has a number of advantages:
*) We know that all symbols can be resolved by code we ship (this was not true), and
*) We can build it however we want without breaking downstreams.

Fixes: https://bugs.launchpad.net/mir/+bug/1587569

Description of the change

Ship mir-test-assist as a shared library, decoupling our compile options from downstream's.

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3526
https://mir-jenkins.ubuntu.com/job/mir-ci/1061/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1169/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1217
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1208
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1208
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1179/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1179/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1179
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1179/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1179
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1179/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1179/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1061/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

What the?... Is it just this branch?

05:21:23 11: [ FAILED ] 10 tests, listed below:
05:21:23 11: [ FAILED ] ClientLibraryThread.handles_no_signals
05:21:23 11: [ FAILED ] ClientLibraryThread.does_not_interfere_with_client_signal_handling
05:21:24 11: [ FAILED ] ServerShutdown.normal_exit_removes_endpoint
05:21:24 11: [ FAILED ] ClientCredsTestFixture.session_authorizer_receives_pid_of_connecting_clients
05:21:24 11: [ FAILED ] ClientCredsTestFixture.authorizer_may_prevent_connection_of_clients
05:21:24 11: [ FAILED ] ServerDisconnect.is_detected_by_client
05:21:24 11: [ FAILED ] ServerDisconnect.doesnt_stop_client_calling_API_functions
05:21:24 11: [ FAILED ] ServerStartup.creates_endpoint_on_filesystem
05:21:24 11: [ FAILED ] ServerStartup.after_server_sigkilled_can_start_new_instance
05:21:24 11: [ FAILED ] UnresponsiveClient.does_not_hang_server

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

The ClientCookies test appears to be leaking state, resulting in the
above valgrind errors; I'm investigating.

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

Ah, OK. The problem here appears to be that ~StubInputPlatform() is duplicated; in the stub platform module and also built directly into the acceptance-tests.

Leaving it only in the input module fixes the failures, but breaks the InputPlatformProbing tests which need the typeinfo for StubInputPlatform for $REASONS.

I'll fix this tomorrow.

lp:~raof/mir/fix-1587569 updated
3527. By Chris Halse Rogers

Don't include stub_input_platform.cpp twice.

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3527
https://mir-jenkins.ubuntu.com/job/mir-ci/1068/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1177/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1227
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1218
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1218
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1187/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1187
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1187/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1187/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1187/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1187/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1187
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1187/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1068/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Chris Halse Rogers (raof) wrote :

SET IT ALL ON FIRE

Unmerged revisions

3527. By Chris Halse Rogers

Don't include stub_input_platform.cpp twice.

3526. By Chris Halse Rogers

Don't special-case LTO for test framework.

It would be sensible for us to only enable LTO for our main libraries, but stripping it off
ad-hoc is not the best way to do that ☺

3525. By Chris Halse Rogers

Make mir-test-assist into a shared library.

Since we're shipping this for downstream users we might as well make it a shared library. This
has a number of advantages:
*) We know that all symbols can be resolved by code we ship (this was not true), and
*) We can build it however we want without breaking downstreams.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/mirtest-dev.install'
2--- debian/mirtest-dev.install 2015-06-25 16:47:02 +0000
3+++ debian/mirtest-dev.install 2016-06-02 02:14:18 +0000
4@@ -1,3 +1,3 @@
5 usr/include/mirtest
6 usr/lib/*/pkgconfig/mirtest.pc
7-usr/lib/*/libmir-test-assist.a
8+usr/lib/*/libmir-test-assist.so
9
10=== modified file 'tests/CMakeLists.txt'
11--- tests/CMakeLists.txt 2016-03-30 08:59:35 +0000
12+++ tests/CMakeLists.txt 2016-06-02 02:14:18 +0000
13@@ -96,7 +96,7 @@
14 add_subdirectory(test-clients/)
15 add_subdirectory(loader-tests/)
16
17-add_library(mir-test-assist STATIC
18+add_library(mir-test-assist SHARED
19 $<TARGET_OBJECTS:mir-public-test>
20 $<TARGET_OBJECTS:mir-public-test-doubles>
21 $<TARGET_OBJECTS:mir-public-test-doubles-platform>
22@@ -107,6 +107,9 @@
23 mirclient
24 mirserver
25
26+ mir-test-doubles-static
27+ mir-test-doubles-udev-static
28+
29 ${Boost_LIBRARIES}
30 ${GTEST_BOTH_LIBRARIES}
31 ${GMOCK_LIBRARY}
32@@ -123,7 +126,7 @@
33 )
34
35 install(TARGETS mir-test-assist
36- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
37+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
38 )
39 install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/test/mir
40 DESTINATION "include/mirtest"
41
42=== modified file 'tests/mir_test/CMakeLists.txt'
43--- tests/mir_test/CMakeLists.txt 2016-05-26 02:12:27 +0000
44+++ tests/mir_test/CMakeLists.txt 2016-06-02 02:14:18 +0000
45@@ -1,7 +1,3 @@
46-# We don't want LTO objects in a published archive (libmir-test-assist.a)
47-string (REPLACE " -flto " " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
48-string (REPLACE " -flto " " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
49-
50 add_library(mir-public-test OBJECT
51 cross_process_action.cpp
52 cross_process_sync.cpp
53
54=== modified file 'tests/mir_test_doubles/CMakeLists.txt'
55--- tests/mir_test_doubles/CMakeLists.txt 2016-05-26 02:12:27 +0000
56+++ tests/mir_test_doubles/CMakeLists.txt 2016-06-02 02:14:18 +0000
57@@ -70,10 +70,6 @@
58 )
59 endif()
60
61-# We don't want LTO objects in a published archive (libmir-test-assist.a)
62-string (REPLACE " -flto " " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
63-string (REPLACE " -flto " " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
64-
65 add_library(mir-public-test-doubles OBJECT
66 nested_mock_egl.cpp
67 null_logger.cpp
68@@ -122,3 +118,7 @@
69 add_library(mir-test-doubles-udev OBJECT
70 ${MIR_TEST_DOUBLES_UDEV_SRCS}
71 )
72+
73+add_library(mir-test-doubles-udev-static STATIC
74+ $<TARGET_OBJECTS:mir-test-doubles-udev>
75+)
76
77=== modified file 'tests/mir_test_doubles/mock_udev.cpp'
78--- tests/mir_test_doubles/mock_udev.cpp 2016-02-15 08:46:51 +0000
79+++ tests/mir_test_doubles/mock_udev.cpp 2016-06-02 02:14:18 +0000
80@@ -18,6 +18,8 @@
81
82 #include "mir/test/doubles/mock_udev.h"
83
84+#include <dlfcn.h>
85+
86 namespace mtd = mir::test::doubles;
87
88 namespace
89@@ -39,15 +41,42 @@
90
91 char const* udev_device_get_devnode(udev_device* dev)
92 {
93- return global_udev->udev_device_get_devnode(dev);
94+ static char const* (* const real_get_devnode)(udev_device*) =
95+ reinterpret_cast<char const*(*)(udev_device*)>(dlsym(RTLD_NEXT, "udev_device_get_devnode"));
96+ if (global_udev != nullptr)
97+ {
98+ return global_udev->udev_device_get_devnode(dev);
99+ }
100+ else
101+ {
102+ return real_get_devnode(dev);
103+ }
104 }
105
106 char const* udev_device_get_property_value(udev_device* dev, char const* property)
107 {
108- return global_udev->udev_device_get_property_value(dev, property);
109+ static char const* (* const real_get_property_value)(udev_device*, char const*) =
110+ reinterpret_cast<char const*(*)(udev_device*, char const*)>(dlsym(RTLD_NEXT, "udev_device_get_property_value"));
111+ if (global_udev != nullptr)
112+ {
113+ return global_udev->udev_device_get_property_value(dev, property);
114+ }
115+ else
116+ {
117+ return real_get_property_value(dev, property);
118+ }
119 }
120
121 udev_device* udev_device_unref(udev_device* device)
122 {
123- return global_udev->udev_device_unref(device);
124+ static udev_device* (* const real_device_unref)(udev_device*) =
125+ reinterpret_cast<udev_device*(*)(udev_device*)>(dlsym(RTLD_NEXT, "udev_device_unref"));
126+ if (global_udev != nullptr)
127+ {
128+ return global_udev->udev_device_unref(device);
129+ }
130+ else
131+ {
132+ return real_device_unref(device);
133+ }
134 }
135
136=== modified file 'tests/mir_test_framework/CMakeLists.txt'
137--- tests/mir_test_framework/CMakeLists.txt 2016-05-26 02:12:27 +0000
138+++ tests/mir_test_framework/CMakeLists.txt 2016-06-02 02:14:18 +0000
139@@ -21,10 +21,6 @@
140 -DMIR_BUILD_PREFIX="${CMAKE_BINARY_DIR}"
141 )
142
143-# We don't want LTO objects in a published archive (libmir-test-assist.a)
144-string (REPLACE " -flto " " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
145-string (REPLACE " -flto " " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
146-
147 add_library(mir-public-test-framework OBJECT
148 any_surface.cpp
149 async_server_runner.cpp
150@@ -43,7 +39,6 @@
151 process.cpp
152 server_runner.cpp
153 socket_detect_server.cpp
154- stub_input_platform.cpp
155 stub_client_platform_factory.cpp
156 stub_server_platform_factory.cpp
157 stub_session.cpp
158
159=== modified file 'tests/unit-tests/CMakeLists.txt'
160--- tests/unit-tests/CMakeLists.txt 2016-05-26 02:12:27 +0000
161+++ tests/unit-tests/CMakeLists.txt 2016-06-02 02:14:18 +0000
162@@ -135,6 +135,7 @@
163
164 mir-test-static
165 mir-test-framework-static
166+ mirplatforminputstub
167
168 ${PROTOBUF_LITE_LIBRARIES}
169 ${GTEST_BOTH_LIBRARIES}
170@@ -169,6 +170,7 @@
171
172 mir-test-static
173 mir-test-framework-static
174+ mirplatforminputstub
175
176 ${PROTOBUF_LITE_LIBRARIES}
177 ${GTEST_BOTH_LIBRARIES}

Subscribers

People subscribed via source and target branches