Mir

Merge lp:~alan-griffiths/mir/fix-gmock-detection into lp:mir

Proposed by Alan Griffiths
Status: Rejected
Rejected by: Alan Griffiths
Proposed branch: lp:~alan-griffiths/mir/fix-gmock-detection
Merge into: lp:mir
Prerequisite: lp:~brandontschaefer/mir/remove-android-support
Diff against target: 292 lines (+25/-116)
11 files modified
CMakeLists.txt (+10/-1)
benchmarks/frame-uniformity/CMakeLists.txt (+2/-3)
cmake/FindGtestGmock.cmake (+0/-96)
debian/control (+1/-0)
tests/CMakeLists.txt (+1/-2)
tests/integration-tests/CMakeLists.txt (+1/-2)
tests/mir_test_doubles/CMakeLists.txt (+2/-2)
tests/mir_test_framework/CMakeLists.txt (+4/-4)
tests/performance-tests/CMakeLists.txt (+1/-1)
tests/unit-tests/CMakeLists.txt (+2/-4)
tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp (+1/-1)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-gmock-detection
Reviewer Review Type Date Requested Status
Daniel van Vugt Disapprove
Mir CI Bot continuous-integration Needs Fixing
Alan Griffiths Needs Fixing
Brandon Schaefer (community) Approve
Review via email: mp+322859@code.launchpad.net

This proposal supersedes a proposal from 2017-04-20.

Commit message

Fix gmock detection in cmake.

At some point in the past 5 years cmake-extras gained a script for finding gmock and gtest. We don't need to maintain our own.

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote : Posted in a previous version of this proposal

lgtm

review: Approve
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

still lgtms

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:4156
https://mir-jenkins.ubuntu.com/job/mir-ci/3372/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4563/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4689
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4678
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4678
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4595
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4595/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4595
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4595/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4595
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4595/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4595/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4595
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4595/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4157
https://mir-jenkins.ubuntu.com/job/mir-ci/3373/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4564/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4690
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4679
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4679
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4596
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4596/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4596
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4596/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4596
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4596/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4596/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4596
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4596/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/1286/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4565/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/1370/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4691
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4680
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4680
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4597
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4597/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4597
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4597/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4597
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4597/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4597/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4597
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4597/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

armhf, zesty:

17:04:53 ../../gmock/gtest/libgtest.a: error adding symbols: File format not recognized
17:04:53 collect2: error: ld returned 1 exit status
17:04:53 tests/performance-tests/CMakeFiles/mir_compositor_performance_test.dir/build.make:100: recipe for target 'bin/mir_compositor_performance_test.bin' failed
17:04:53 make[3]: *** [bin/mir_compositor_performance_test.bin] Error 1

Why would that be?

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

I think this is the right idea, but some better explanation (a description) might be helpful.

Looks like this cleanup only became possible recently with the new gtest packaging...?

Also, don't we need to explicitly require Gtest?

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

FAILED: Continuous integration, rev:4157
https://mir-jenkins.ubuntu.com/job/mir-ci/3376/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4568/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4694
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4683
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4683
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4600
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4600/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4600
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4600/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4600
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4600/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4600/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4600
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4600/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Hmm build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty again. (But different symptoms to last time.)

10:32:13 /usr/lib/gcc-cross/arm-linux-gnueabihf/6/../../../../arm-linux-gnueabihf/bin/ld.gold: error: ../../gmock/gtest/libgtest.a(gtest-all.cc.o): incompatible target
10:32:13 /usr/lib/gcc-cross/arm-linux-gnueabihf/6/../../../../arm-linux-gnueabihf/bin/ld.gold: error: ../../gmock/gtest/libgtest_main.a(gtest_main.cc.o): incompatible target

review: Needs Fixing
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Oh! that's a cross-build. Maybe its picking up the host binaries? Something for next week.

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

OK then, while work is in progress don't forget:

+#mir_add_wrapped_executable(mir_compositor_performance_test

should be uncommented.

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

FAILED: Continuous integration, rev:4160
https://mir-jenkins.ubuntu.com/job/mir-ci/3379/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4572/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4698
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4687
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4687
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4604
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4604/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4604
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4604/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4604
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4604/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4604/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4604
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4604/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

Maybe replacing ${GMOCK_LIBRARIES} with ${GMOCK_LDFLAGS} would help fix the cross-compile failure.

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

Hmm, aren't we aiming to keep support for building on xenial? While lp:mir builds perfectly on xenial, this proposal does not...

-- Installing: /home/dan/bzr/mir/fix-gmock-detection/build/mir_gtest/fail_on_success.sh
CMake Error at CMakeLists.txt:287 (find_package):
  By not providing "FindGMock.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "GMock", but
  CMake did not find one.

  Could not find a package configuration file provided by "GMock" with any of
  the following names:

    GMockConfig.cmake
    gmock-config.cmake

  Add the installation prefix of "GMock" to CMAKE_PREFIX_PATH or set
  "GMock_DIR" to a directory containing one of the above files. If "GMock"
  provides a separate development package or SDK, be sure it has been
  installed.

-- Configuring incomplete, errors occurred!

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

^^^
That's pure xenial with no overlay, no PPAs.

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

Weak disapproval. This breaks our plan to keep xenial support while removing overlays.

The new GMock CMake package is apparently still too new to be backward compatible.

review: Disapprove

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2017-04-21 03:08:25 +0000
+++ CMakeLists.txt 2017-04-24 09:26:55 +0000
@@ -284,7 +284,16 @@
284add_subdirectory(cmake/)284add_subdirectory(cmake/)
285285
286if (MIR_ENABLE_TESTS)286if (MIR_ENABLE_TESTS)
287 find_package(GtestGmock REQUIRED)287 find_package(GMock REQUIRED)
288 if (MIR_CHROOT)
289 string(REPLACE "/usr/" "${MIR_CHROOT}/usr/" GMOCK_INCLUDE_DIRS "${GMOCK_INCLUDE_DIRS}")
290 string(REPLACE "/usr/" "${MIR_CHROOT}/usr/" GTEST_INCLUDE_DIRS "${GTEST_INCLUDE_DIRS}")
291 string(REPLACE "/usr/" "${MIR_CHROOT}/usr/" GTEST_LIBRARIES "${GTEST_LIBRARIES}")
292 string(REPLACE "/usr/" "${MIR_CHROOT}/usr/" GMOCK_INCLUDE_DIRS "${GMOCK_INCLUDE_DIRS}")
293 string(REPLACE "/usr/" "${MIR_CHROOT}/usr/" GTEST_MAIN_LIBRARIES "${GTEST_MAIN_LIBRARIES}")
294 string(REPLACE "/usr/" "${MIR_CHROOT}/usr/" GMOCK_LIBRARIES "${GMOCK_LIBRARIES}")
295 string(REPLACE "/usr/" "${MIR_CHROOT}/usr/" GTEST_BOTH_LIBRARIES "${GTEST_BOTH_LIBRARIES}")
296 endif()
288 pkg_check_modules(LIBEVDEV REQUIRED libevdev)297 pkg_check_modules(LIBEVDEV REQUIRED libevdev)
289 include_directories(${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})298 include_directories(${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})
290 add_subdirectory(tests/)299 add_subdirectory(tests/)
291300
=== modified file 'benchmarks/frame-uniformity/CMakeLists.txt'
--- benchmarks/frame-uniformity/CMakeLists.txt 2017-04-21 03:08:25 +0000
+++ benchmarks/frame-uniformity/CMakeLists.txt 2017-04-24 09:26:55 +0000
@@ -28,7 +28,7 @@
28 mirserver28 mirserver
29 mirclient29 mirclient
30 mirplatform30 mirplatform
31 31
32 mir-test-assist32 mir-test-assist
3333
34 # needed for fake_event_hub_server_configuration.h (which relies on private APIs)34 # needed for fake_event_hub_server_configuration.h (which relies on private APIs)
@@ -39,7 +39,6 @@
3939
40 ${Boost_LIBRARIES}40 ${Boost_LIBRARIES}
41 ${GTEST_BOTH_LIBRARIES}41 ${GTEST_BOTH_LIBRARIES}
42 ${GMOCK_LIBRARY}42 ${GMOCK_LIBRARIES}
43 ${GMOCK_MAIN_LIBRARY}
44 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.43 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
45)44)
4645
=== removed file 'cmake/FindGtestGmock.cmake'
--- cmake/FindGtestGmock.cmake 2017-01-18 02:29:37 +0000
+++ cmake/FindGtestGmock.cmake 1970-01-01 00:00:00 +0000
@@ -1,96 +0,0 @@
1include(ExternalProject)
2include(FindPackageHandleStandardArgs)
3
4#
5# When cross compiling MIR_CHROOT points to our chroot.
6# When not cross compiling, it should be blank to use the host system.
7#
8set(usr ${MIR_CHROOT}/usr)
9
10if (EXISTS ${usr}/src/googletest)
11 set (USING_GOOGLETEST_1_8 TRUE)
12 set (GTEST_INSTALL_DIR ${usr}/src/googletest/googletest/include)
13else()
14 set (GTEST_INSTALL_DIR ${usr}/src/gmock/gtest/include)
15endif()
16
17#gtest
18find_path(
19 GTEST_INCLUDE_DIR gtest/gtest.h
20 HINTS ${GTEST_INSTALL_DIR}
21)
22
23#gmock
24find_path(
25 GMOCK_INSTALL_DIR CMakeLists.txt
26 HINTS ${usr}/src/googletest ${usr}/src/gmock)
27if(${GMOCK_INSTALL_DIR} STREQUAL "GMOCK_INSTALL_DIR-NOTFOUND")
28 message(FATAL_ERROR "google-mock package not found")
29endif()
30
31find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)
32
33if (USING_GOOGLETEST_1_8)
34 set(GMOCK_BASE_BINARY_DIR ${CMAKE_BINARY_DIR}/gmock/libs)
35 set(GMOCK_BINARY_DIR ${GMOCK_BASE_BINARY_DIR}/googlemock)
36 set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
37else()
38 set(GMOCK_BASE_BINARY_DIR ${CMAKE_BINARY_DIR}/gmock/libs)
39 set(GMOCK_BINARY_DIR ${GMOCK_BASE_BINARY_DIR})
40 set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
41endif()
42
43set(GTEST_CXX_FLAGS "-fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64")
44if (cmake_build_type_lower MATCHES "threadsanitizer")
45 set(GTEST_CXX_FLAGS "${GTEST_CXX_FLAGS} -fsanitize=thread")
46elseif (cmake_build_type_lower MATCHES "ubsanitizer")
47 set(GTEST_CXX_FLAGS "${GTEST_CXX_FLAGS} -fsanitize=undefined")
48endif()
49
50set(GTEST_CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${GTEST_CXX_FLAGS}")
51list(APPEND GTEST_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
52list(APPEND GTEST_CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
53
54if (USING_GOOGLETEST_1_8)
55 list(APPEND GTEST_CMAKE_ARGS -DBUILD_GTEST=ON)
56endif()
57
58if (cmake_build_type_lower MATCHES "threadsanitizer")
59 #Skip compiler check, since if GCC is the compiler, we need to link against -ltsan
60 #explicitly; specifying additional linker flags doesn't seem possible for external projects
61 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_CXX_COMPILER_WORKS=1)
62endif()
63if (${CMAKE_CROSSCOMPILING})
64 if(DEFINED MIR_CHROOT)
65 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_MODULE_PATH}/LinuxCrossCompile.cmake)
66 else()
67 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
68 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
69 endif()
70endif()
71
72ExternalProject_Add(
73 GMock
74 #where to build in source tree
75 PREFIX ${GMOCK_PREFIX}
76 #where the source is external to the project
77 SOURCE_DIR ${GMOCK_INSTALL_DIR}
78 #forward the compilers to the subproject so cross-arch builds work
79 CMAKE_ARGS ${GTEST_CMAKE_ARGS}
80 BINARY_DIR ${GMOCK_BASE_BINARY_DIR}
81
82 #we don't need to install, so skip
83 INSTALL_COMMAND ""
84)
85
86set(GMOCK_LIBRARY ${GMOCK_BINARY_DIR}/libgmock.a)
87set(GMOCK_MAIN_LIBRARY ${GMOCK_BINARY_DIR}/libgmock_main.a)
88set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARY} ${GMOCK_MAIN_LIBRARY})
89set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a)
90set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a)
91set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
92set(GTEST_ALL_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
93
94find_package_handle_standard_args(GTest DEFAULT_MSG
95 GMOCK_INCLUDE_DIR
96 GTEST_INCLUDE_DIR)
970
=== modified file 'debian/control'
--- debian/control 2017-04-21 03:08:25 +0000
+++ debian/control 2017-04-24 09:26:55 +0000
@@ -4,6 +4,7 @@
4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Thomas Voß <thomas.voss@canonical.com>5XSBC-Original-Maintainer: Thomas Voß <thomas.voss@canonical.com>
6Build-Depends: cmake,6Build-Depends: cmake,
7 cmake-extras,
7 pkg-config,8 pkg-config,
8 debhelper (>= 9),9 debhelper (>= 9),
9 doxygen,10 doxygen,
1011
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2017-04-21 03:08:25 +0000
+++ tests/CMakeLists.txt 2017-04-24 09:26:55 +0000
@@ -104,8 +104,7 @@
104 mir-test-doubles-platform-static104 mir-test-doubles-platform-static
105 ${Boost_LIBRARIES}105 ${Boost_LIBRARIES}
106 ${GTEST_BOTH_LIBRARIES}106 ${GTEST_BOTH_LIBRARIES}
107 ${GMOCK_LIBRARY}107 ${GMOCK_LIBRARIES}
108 ${GMOCK_MAIN_LIBRARY}
109 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.108 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
110)109)
111110
112111
=== modified file 'tests/integration-tests/CMakeLists.txt'
--- tests/integration-tests/CMakeLists.txt 2017-04-21 03:08:25 +0000
+++ tests/integration-tests/CMakeLists.txt 2017-04-24 09:26:55 +0000
@@ -69,8 +69,7 @@
6969
70 ${Boost_LIBRARIES}70 ${Boost_LIBRARIES}
71 ${GTEST_BOTH_LIBRARIES}71 ${GTEST_BOTH_LIBRARIES}
72 ${GMOCK_LIBRARY}72 ${GMOCK_LIBRARIES}
73 ${GMOCK_MAIN_LIBRARY}
74 # Mesa platform dependencies73 # Mesa platform dependencies
75 ${DRM_LDFLAGS} ${DRM_LIBRARIES}74 ${DRM_LDFLAGS} ${DRM_LIBRARIES}
76 ${GBM_LDFLAGS} ${GBM_LIBRARIES}75 ${GBM_LDFLAGS} ${GBM_LIBRARIES}
7776
=== modified file 'tests/mir_test_doubles/CMakeLists.txt'
--- tests/mir_test_doubles/CMakeLists.txt 2017-04-21 03:08:25 +0000
+++ tests/mir_test_doubles/CMakeLists.txt 2017-04-24 09:26:55 +0000
@@ -87,7 +87,7 @@
87 mirserver87 mirserver
8888
89 ${Boost_LIBRARIES}89 ${Boost_LIBRARIES}
90 ${GMOCK_LIBRARY}90 ${GMOCK_LIBRARIES}
91 ${GMOCK_MAIN_LIBRARY}91 ${GMOCK_MAIN_LIBRARY}
92 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.92 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
93)93)
@@ -105,7 +105,7 @@
105 mir-test-doubles-platform-static105 mir-test-doubles-platform-static
106106
107 -ldl107 -ldl
108 ${GMOCK_LIBRARY}108 ${GMOCK_LIBRARIES}
109 ${GMOCK_MAIN_LIBRARY}109 ${GMOCK_MAIN_LIBRARY}
110 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.110 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
111)111)
112112
=== modified file 'tests/mir_test_framework/CMakeLists.txt'
--- tests/mir_test_framework/CMakeLists.txt 2017-03-14 04:41:33 +0000
+++ tests/mir_test_framework/CMakeLists.txt 2017-04-24 09:26:55 +0000
@@ -83,11 +83,11 @@
8383
84target_link_libraries(mir-test-framework-static84target_link_libraries(mir-test-framework-static
8585
86 mirserver
86 mirclient87 mirclient
87 ${Boost_LIBRARIES}88 ${Boost_LIBRARIES}
88 ${GTEST_BOTH_LIBRARIES}89 ${GTEST_BOTH_LIBRARIES}
89 ${GMOCK_LIBRARY}90 ${GMOCK_LIBRARIES}
90 ${GMOCK_MAIN_LIBRARY}
91 ${UMOCKDEV_LIBRARIES}91 ${UMOCKDEV_LIBRARIES}
92 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.92 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
93)93)
@@ -118,7 +118,7 @@
118118
119add_library(119add_library(
120 mir-test-input-framework OBJECT120 mir-test-input-framework OBJECT
121 121
122 stub_input.cpp122 stub_input.cpp
123 fake_input_device_impl.cpp123 fake_input_device_impl.cpp
124 stub_input_platform.cpp124 stub_input_platform.cpp
@@ -175,7 +175,7 @@
175)175)
176176
177target_link_libraries(177target_link_libraries(
178 mirplatformgraphicsthrow 178 mirplatformgraphicsthrow
179179
180 mirplatform180 mirplatform
181)181)
182182
=== modified file 'tests/performance-tests/CMakeLists.txt'
--- tests/performance-tests/CMakeLists.txt 2017-04-21 03:08:25 +0000
+++ tests/performance-tests/CMakeLists.txt 2017-04-24 09:26:55 +0000
@@ -32,8 +32,8 @@
32 test_compositor.cpp32 test_compositor.cpp
33)33)
34target_link_libraries(mir_compositor_performance_test34target_link_libraries(mir_compositor_performance_test
35 ${GTEST_BOTH_LIBRARIES}
36 mir_system_performance_test35 mir_system_performance_test
36 ${GTEST_BOTH_LIBRARIES}
37)37)
3838
39mir_add_wrapped_executable(mir_client_startup_performance_test39mir_add_wrapped_executable(mir_client_startup_performance_test
4040
=== modified file 'tests/unit-tests/CMakeLists.txt'
--- tests/unit-tests/CMakeLists.txt 2017-04-21 03:08:25 +0000
+++ tests/unit-tests/CMakeLists.txt 2017-04-24 09:26:55 +0000
@@ -137,8 +137,7 @@
137137
138 ${PROTOBUF_LITE_LIBRARIES}138 ${PROTOBUF_LITE_LIBRARIES}
139 ${GTEST_BOTH_LIBRARIES}139 ${GTEST_BOTH_LIBRARIES}
140 ${GMOCK_LIBRARY}140 ${GMOCK_LIBRARIES}
141 ${GMOCK_MAIN_LIBRARY}
142 ${Boost_LIBRARIES}141 ${Boost_LIBRARIES}
143 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.142 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
144)143)
@@ -178,8 +177,7 @@
178177
179 ${PROTOBUF_LITE_LIBRARIES}178 ${PROTOBUF_LITE_LIBRARIES}
180 ${GTEST_BOTH_LIBRARIES}179 ${GTEST_BOTH_LIBRARIES}
181 ${GMOCK_LIBRARY}180 ${GMOCK_LIBRARIES}
182 ${GMOCK_MAIN_LIBRARY}
183 ${Boost_LIBRARIES}181 ${Boost_LIBRARIES}
184 ${UMOCKDEV_LIBRARIES}182 ${UMOCKDEV_LIBRARIES}
185 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.183 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
186184
=== modified file 'tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp'
--- tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2017-02-17 07:35:08 +0000
+++ tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2017-04-24 09:26:55 +0000
@@ -155,7 +155,7 @@
155 auto edid_size = mir_output_get_edid_size(output);155 auto edid_size = mir_output_get_edid_size(output);
156156
157 ASSERT_NE(nullptr, edid_start);157 ASSERT_NE(nullptr, edid_start);
158 ASSERT_NE(0, edid_size);158 ASSERT_NE(0u, edid_size);
159159
160 std::vector<uint8_t> host_edid(edid_start, edid_start+edid_size);160 std::vector<uint8_t> host_edid(edid_start, edid_start+edid_size);
161161

Subscribers

People subscribed via source and target branches