Mir

Merge lp:~raof/mir/fix-googletest-zesty-build into lp:mir

Proposed by Chris Halse Rogers
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 3845
Proposed branch: lp:~raof/mir/fix-googletest-zesty-build
Merge into: lp:mir
Diff against target: 110 lines (+38/-10)
3 files modified
cmake/FindGtestGmock.cmake (+29/-10)
tests/CMakeLists.txt (+5/-0)
tests/include/mir/test/gmock_fixes.h (+4/-0)
To merge this branch: bzr merge lp:~raof/mir/fix-googletest-zesty-build
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
Mir CI Bot continuous-integration Approve
Review via email: mp+311678@code.launchpad.net

Commit message

Fix build failures against GoogleTest 1.8 in zesty (LP: #1644062)

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

FAILED: Continuous integration, rev:3842
https://mir-jenkins.ubuntu.com/job/mir-ci/2264/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/2932/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2997
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2989
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2989
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2989
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2961
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2961/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/2961
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2961/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2961/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2961
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2961/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/2961
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2961/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2961
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2961/artifact/output/*zip*/output.zip

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

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

Woot! Builds on !zesty first time!

Failure is:
11: [ FAILED ] NestedServer.named_cursor_image_changes_are_forwarded_to_host

not related to this branch.

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

FAILED: Continuous integration, rev:3842
https://mir-jenkins.ubuntu.com/job/mir-ci/2265/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/2933/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2998
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2990
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2990
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2990
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2962/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2962
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2962/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2962
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2962/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2962
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2962/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/2962
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2962/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2962/console

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

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

PASSED: Continuous integration, rev:3842
https://mir-jenkins.ubuntu.com/job/mir-ci/2266/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/2934
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2999
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2991
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2991
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2991
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2963
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2963/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/2963
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2963/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2963
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2963/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2963
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2963/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/2963
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2963/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2963
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2963/artifact/output/*zip*/output.zip

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

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

It appears we were both working on this simultaneously. But you solved a couple of problems I had not yet...

Please remember to comment/link your work to bug 1644062.

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

Verified all fixed on zesty. Much thanks. Ship it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmake/FindGtestGmock.cmake'
2--- cmake/FindGtestGmock.cmake 2016-07-18 07:38:38 +0000
3+++ cmake/FindGtestGmock.cmake 2016-11-24 03:08:18 +0000
4@@ -1,24 +1,38 @@
5 include(ExternalProject)
6 include(FindPackageHandleStandardArgs)
7
8+if (EXISTS /usr/src/googletest)
9+ set (USING_GOOGLETEST_1_8 TRUE)
10+ set (GTEST_INSTALL_DIR /usr/src/googletest/googletest/include)
11+else()
12+ set (GTEST_INSTALL_DIR /usr/src/gmock/gtest/include)
13+endif()
14+
15 #gtest
16-set(GTEST_INSTALL_DIR /usr/src/gmock/gtest/include)
17-find_path(GTEST_INCLUDE_DIR gtest/gtest.h
18- HINTS ${GTEST_INSTALL_DIR})
19+find_path(
20+ GTEST_INCLUDE_DIR gtest/gtest.h
21+ HINTS ${GTEST_INSTALL_DIR}
22+)
23
24 #gmock
25-find_path(GMOCK_INSTALL_DIR gmock/CMakeLists.txt
26- HINTS /usr/src)
27+find_path(
28+ GMOCK_INSTALL_DIR CMakeLists.txt
29+ HINTS /usr/src/googletest /usr/src/gmock)
30 if(${GMOCK_INSTALL_DIR} STREQUAL "GMOCK_INSTALL_DIR-NOTFOUND")
31 message(FATAL_ERROR "google-mock package not found")
32 endif()
33
34-set(GMOCK_INSTALL_DIR ${GMOCK_INSTALL_DIR}/gmock)
35 find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)
36
37-set(GMOCK_PREFIX gmock)
38-set(GMOCK_BINARY_DIR ${CMAKE_BINARY_DIR}/${GMOCK_PREFIX}/libs)
39-set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
40+if (USING_GOOGLETEST_1_8)
41+ set(GMOCK_BASE_BINARY_DIR ${CMAKE_BINARY_DIR}/gmock/libs)
42+ set(GMOCK_BINARY_DIR ${GMOCK_BASE_BINARY_DIR}/googlemock)
43+ set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
44+else()
45+ set(GMOCK_BASE_BINARY_DIR ${CMAKE_BINARY_DIR}/gmock/libs)
46+ set(GMOCK_BINARY_DIR ${GMOCK_BASE_BINARY_DIR})
47+ set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
48+endif()
49
50 set(GTEST_CXX_FLAGS "-fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64")
51 if (cmake_build_type_lower MATCHES "threadsanitizer")
52@@ -30,6 +44,11 @@
53 set(GTEST_CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${GTEST_CXX_FLAGS}")
54 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
55 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
56+
57+if (USING_GOOGLETEST_1_8)
58+ list(APPEND GTEST_CMAKE_ARGS -DBUILD_GTEST=ON)
59+endif()
60+
61 if (cmake_build_type_lower MATCHES "threadsanitizer")
62 #Skip compiler check, since if GCC is the compiler, we need to link against -ltsan
63 #explicitly; specifying additional linker flags doesn't seem possible for external projects
64@@ -52,7 +71,7 @@
65 SOURCE_DIR ${GMOCK_INSTALL_DIR}
66 #forward the compilers to the subproject so cross-arch builds work
67 CMAKE_ARGS ${GTEST_CMAKE_ARGS}
68- BINARY_DIR ${GMOCK_BINARY_DIR}
69+ BINARY_DIR ${GMOCK_BASE_BINARY_DIR}
70
71 #we don't need to install, so skip
72 INSTALL_COMMAND ""
73
74=== modified file 'tests/CMakeLists.txt'
75--- tests/CMakeLists.txt 2016-11-09 02:30:14 +0000
76+++ tests/CMakeLists.txt 2016-11-24 03:08:18 +0000
77@@ -10,6 +10,7 @@
78 check_cxx_compiler_flag(-Wnull-dereference HAS_W_NULL_DEREFERENCE)
79 check_cxx_compiler_flag(-Woverloaded-virtual HAS_W_OVERLOADED_VIRTUAL)
80 check_cxx_compiler_flag(-Winconsistent-missing-override HAS_W_INCONSISTENT_MISSING_OVERRIDE)
81+check_cxx_compiler_flag(-Wgnu-zero-variadic-macro-arguments HAS_W_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS)
82
83 if (HAS_W_NULL_DEREFERENCE)
84 # Avoid clang complaints about poor quality gmock/gtest headers
85@@ -24,6 +25,10 @@
86 # in the tests.
87 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override")
88 endif()
89+if (HAS_W_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS)
90+ # INSTANTIATE_TEST_CASE_P hits this like a slice of lemon wrapped around a large gold brick.
91+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
92+endif()
93
94 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-lto")
95 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-lto")
96
97=== modified file 'tests/include/mir/test/gmock_fixes.h'
98--- tests/include/mir/test/gmock_fixes.h 2016-01-29 08:18:22 +0000
99+++ tests/include/mir/test/gmock_fixes.h 2016-11-24 03:08:18 +0000
100@@ -53,6 +53,10 @@
101 // The compiler-generated copy constructor and assignment operator
102 // are exactly what we need, so we don't need to define them.
103
104+ std::unique_ptr<T, D> Unwrap() {
105+ return std::move(value_);
106+ }
107+
108 // Returns the held value and deletes this object.
109 std::unique_ptr<T, D> GetValueAndDelete() const {
110 std::unique_ptr<T, D> retval(std::move(value_));

Subscribers

People subscribed via source and target branches