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
=== modified file 'debian/mirtest-dev.install'
--- debian/mirtest-dev.install 2015-06-25 16:47:02 +0000
+++ debian/mirtest-dev.install 2016-06-02 02:14:18 +0000
@@ -1,3 +1,3 @@
1usr/include/mirtest1usr/include/mirtest
2usr/lib/*/pkgconfig/mirtest.pc2usr/lib/*/pkgconfig/mirtest.pc
3usr/lib/*/libmir-test-assist.a3usr/lib/*/libmir-test-assist.so
44
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2016-03-30 08:59:35 +0000
+++ tests/CMakeLists.txt 2016-06-02 02:14:18 +0000
@@ -96,7 +96,7 @@
96add_subdirectory(test-clients/)96add_subdirectory(test-clients/)
97add_subdirectory(loader-tests/)97add_subdirectory(loader-tests/)
9898
99add_library(mir-test-assist STATIC99add_library(mir-test-assist SHARED
100 $<TARGET_OBJECTS:mir-public-test>100 $<TARGET_OBJECTS:mir-public-test>
101 $<TARGET_OBJECTS:mir-public-test-doubles>101 $<TARGET_OBJECTS:mir-public-test-doubles>
102 $<TARGET_OBJECTS:mir-public-test-doubles-platform>102 $<TARGET_OBJECTS:mir-public-test-doubles-platform>
@@ -107,6 +107,9 @@
107 mirclient107 mirclient
108 mirserver108 mirserver
109109
110 mir-test-doubles-static
111 mir-test-doubles-udev-static
112
110 ${Boost_LIBRARIES}113 ${Boost_LIBRARIES}
111 ${GTEST_BOTH_LIBRARIES}114 ${GTEST_BOTH_LIBRARIES}
112 ${GMOCK_LIBRARY}115 ${GMOCK_LIBRARY}
@@ -123,7 +126,7 @@
123)126)
124127
125install(TARGETS mir-test-assist128install(TARGETS mir-test-assist
126 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}129 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
127)130)
128install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/test/mir131install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/test/mir
129 DESTINATION "include/mirtest"132 DESTINATION "include/mirtest"
130133
=== modified file 'tests/mir_test/CMakeLists.txt'
--- tests/mir_test/CMakeLists.txt 2016-05-26 02:12:27 +0000
+++ tests/mir_test/CMakeLists.txt 2016-06-02 02:14:18 +0000
@@ -1,7 +1,3 @@
1# We don't want LTO objects in a published archive (libmir-test-assist.a)
2string (REPLACE " -flto " " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
3string (REPLACE " -flto " " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
4
5add_library(mir-public-test OBJECT1add_library(mir-public-test OBJECT
6 cross_process_action.cpp2 cross_process_action.cpp
7 cross_process_sync.cpp3 cross_process_sync.cpp
84
=== modified file 'tests/mir_test_doubles/CMakeLists.txt'
--- tests/mir_test_doubles/CMakeLists.txt 2016-05-26 02:12:27 +0000
+++ tests/mir_test_doubles/CMakeLists.txt 2016-06-02 02:14:18 +0000
@@ -70,10 +70,6 @@
70 )70 )
71endif()71endif()
7272
73# We don't want LTO objects in a published archive (libmir-test-assist.a)
74string (REPLACE " -flto " " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
75string (REPLACE " -flto " " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
76
77add_library(mir-public-test-doubles OBJECT73add_library(mir-public-test-doubles OBJECT
78 nested_mock_egl.cpp74 nested_mock_egl.cpp
79 null_logger.cpp75 null_logger.cpp
@@ -122,3 +118,7 @@
122add_library(mir-test-doubles-udev OBJECT118add_library(mir-test-doubles-udev OBJECT
123 ${MIR_TEST_DOUBLES_UDEV_SRCS}119 ${MIR_TEST_DOUBLES_UDEV_SRCS}
124)120)
121
122add_library(mir-test-doubles-udev-static STATIC
123 $<TARGET_OBJECTS:mir-test-doubles-udev>
124)
125125
=== modified file 'tests/mir_test_doubles/mock_udev.cpp'
--- tests/mir_test_doubles/mock_udev.cpp 2016-02-15 08:46:51 +0000
+++ tests/mir_test_doubles/mock_udev.cpp 2016-06-02 02:14:18 +0000
@@ -18,6 +18,8 @@
1818
19#include "mir/test/doubles/mock_udev.h"19#include "mir/test/doubles/mock_udev.h"
2020
21#include <dlfcn.h>
22
21namespace mtd = mir::test::doubles;23namespace mtd = mir::test::doubles;
2224
23namespace25namespace
@@ -39,15 +41,42 @@
3941
40char const* udev_device_get_devnode(udev_device* dev)42char const* udev_device_get_devnode(udev_device* dev)
41{43{
42 return global_udev->udev_device_get_devnode(dev);44 static char const* (* const real_get_devnode)(udev_device*) =
45 reinterpret_cast<char const*(*)(udev_device*)>(dlsym(RTLD_NEXT, "udev_device_get_devnode"));
46 if (global_udev != nullptr)
47 {
48 return global_udev->udev_device_get_devnode(dev);
49 }
50 else
51 {
52 return real_get_devnode(dev);
53 }
43}54}
4455
45char const* udev_device_get_property_value(udev_device* dev, char const* property)56char const* udev_device_get_property_value(udev_device* dev, char const* property)
46{57{
47 return global_udev->udev_device_get_property_value(dev, property);58 static char const* (* const real_get_property_value)(udev_device*, char const*) =
59 reinterpret_cast<char const*(*)(udev_device*, char const*)>(dlsym(RTLD_NEXT, "udev_device_get_property_value"));
60 if (global_udev != nullptr)
61 {
62 return global_udev->udev_device_get_property_value(dev, property);
63 }
64 else
65 {
66 return real_get_property_value(dev, property);
67 }
48}68}
4969
50udev_device* udev_device_unref(udev_device* device)70udev_device* udev_device_unref(udev_device* device)
51{71{
52 return global_udev->udev_device_unref(device);72 static udev_device* (* const real_device_unref)(udev_device*) =
73 reinterpret_cast<udev_device*(*)(udev_device*)>(dlsym(RTLD_NEXT, "udev_device_unref"));
74 if (global_udev != nullptr)
75 {
76 return global_udev->udev_device_unref(device);
77 }
78 else
79 {
80 return real_device_unref(device);
81 }
53}82}
5483
=== modified file 'tests/mir_test_framework/CMakeLists.txt'
--- tests/mir_test_framework/CMakeLists.txt 2016-05-26 02:12:27 +0000
+++ tests/mir_test_framework/CMakeLists.txt 2016-06-02 02:14:18 +0000
@@ -21,10 +21,6 @@
21 -DMIR_BUILD_PREFIX="${CMAKE_BINARY_DIR}"21 -DMIR_BUILD_PREFIX="${CMAKE_BINARY_DIR}"
22 )22 )
2323
24# We don't want LTO objects in a published archive (libmir-test-assist.a)
25string (REPLACE " -flto " " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
26string (REPLACE " -flto " " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
27
28add_library(mir-public-test-framework OBJECT24add_library(mir-public-test-framework OBJECT
29 any_surface.cpp25 any_surface.cpp
30 async_server_runner.cpp26 async_server_runner.cpp
@@ -43,7 +39,6 @@
43 process.cpp39 process.cpp
44 server_runner.cpp40 server_runner.cpp
45 socket_detect_server.cpp41 socket_detect_server.cpp
46 stub_input_platform.cpp
47 stub_client_platform_factory.cpp42 stub_client_platform_factory.cpp
48 stub_server_platform_factory.cpp43 stub_server_platform_factory.cpp
49 stub_session.cpp44 stub_session.cpp
5045
=== modified file 'tests/unit-tests/CMakeLists.txt'
--- tests/unit-tests/CMakeLists.txt 2016-05-26 02:12:27 +0000
+++ tests/unit-tests/CMakeLists.txt 2016-06-02 02:14:18 +0000
@@ -135,6 +135,7 @@
135135
136 mir-test-static136 mir-test-static
137 mir-test-framework-static137 mir-test-framework-static
138 mirplatforminputstub
138139
139 ${PROTOBUF_LITE_LIBRARIES}140 ${PROTOBUF_LITE_LIBRARIES}
140 ${GTEST_BOTH_LIBRARIES}141 ${GTEST_BOTH_LIBRARIES}
@@ -169,6 +170,7 @@
169170
170 mir-test-static171 mir-test-static
171 mir-test-framework-static172 mir-test-framework-static
173 mirplatforminputstub
172174
173 ${PROTOBUF_LITE_LIBRARIES}175 ${PROTOBUF_LITE_LIBRARIES}
174 ${GTEST_BOTH_LIBRARIES}176 ${GTEST_BOTH_LIBRARIES}

Subscribers

People subscribed via source and target branches