Mir

Merge lp:~vanvugt/mir/clang into lp:~mir-team/mir/trunk

Proposed by Daniel van Vugt
Status: Merged
Approved by: Robert Carr
Approved revision: no longer in the source branch.
Merged at revision: 517
Proposed branch: lp:~vanvugt/mir/clang
Merge into: lp:~mir-team/mir/trunk
Diff against target: 645 lines (+73/-91)
40 files modified
CMakeLists.txt (+15/-2)
cmake/src/mir/mir_discover_gtest_tests.cpp (+0/-21)
examples/image_renderer.cpp (+4/-0)
include/server/mir/compositor/buffer.h (+1/-1)
include/server/mir/compositor/buffer_allocation_strategy.h (+1/-1)
include/server/mir/compositor/buffer_bundle_manager.h (+1/-1)
include/server/mir/compositor/buffer_bundle_surfaces.h (+1/-1)
include/server/mir/compositor/graphic_buffer_allocator.h (+1/-1)
include/server/mir/compositor/swapper_factory.h (+1/-1)
include/server/mir/frontend/shell.h (+1/-1)
include/server/mir/graphics/platform.h (+1/-1)
include/server/mir/graphics/renderable.h (+5/-0)
include/server/mir/shell/session_manager.h (+1/-1)
include/server/mir/shell/surface_builder.h (+1/-1)
include/server/mir/surfaces/buffer_bundle_factory.h (+1/-1)
include/server/mir/surfaces/surface_stack.h (+1/-1)
include/server/mir/surfaces/surface_stack_model.h (+1/-1)
include/shared/mir/geometry/forward.h (+3/-3)
src/client/client_buffer.h (+1/-1)
src/client/client_buffer_depository.h (+1/-1)
src/client/client_context.h (+2/-2)
src/client/mir_connection.h (+1/-1)
src/client/mir_surface.h (+2/-2)
src/client/mir_wait_handle.h (+1/-1)
src/server/frontend/protobuf_socket_communicator.h (+2/-1)
src/server/graphics/gbm/gbm_buffer_allocator.h (+1/-1)
src/server/graphics/gbm/gbm_display.h (+1/-1)
src/server/graphics/gbm/gbm_display_buffer.cpp (+0/-8)
src/server/graphics/gbm/gbm_display_helpers.h (+1/-1)
src/server/graphics/gbm/kms_display_configuration.cpp (+0/-1)
src/server/graphics/gbm/kms_display_configuration.h (+0/-1)
tests/CMakeLists.txt (+6/-0)
tests/death-tests/test_application_manager_death.cpp (+5/-4)
tests/integration-tests/test_drm_auth_magic.cpp (+1/-1)
tests/integration-tests/test_surfaceloop.cpp (+1/-2)
tests/mir_test_framework/testing_process_manager.cpp (+3/-19)
tests/unit-tests/geometry/test-displacement.cpp (+1/-1)
tests/unit-tests/geometry/test-point.cpp (+1/-1)
tests/unit-tests/geometry/test-rectangle.cpp (+1/-1)
tests/unit-tests/graphics/gbm/mock_gbm.h (+1/-1)
To merge this branch: bzr merge lp:~vanvugt/mir/clang
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Kevin DuBois (community) Approve
Robert Carr (community) Approve
Alan Griffiths Approve
Alexandros Frantzis Pending
Review via email: mp+153984@code.launchpad.net

This proposal supersedes a proposal from 2013-03-15.

Commit message

Add support for compiling Mir with Clang.

Caveats:
  * Clang 3.1 or later is required (raring or later).
  * Input does not compile yet, due to deep problems with the boost/android-
    input headers.
  * Tests fail when built with clang. Fix them later...

How to build with clang:
  cmake .. -DCMAKE_C_COMPILER=clang \
           -DCMAKE_CXX_COMPILER=clang++ \
           -DMIR_DISABLE_INPUT=ON

This also resolves LP: #1152625.

Description of the change

If you see something strange and don't understand "why", try building with clang and undoing the change by hand. Clang will tell you "why".

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote : Posted in a previous version of this proposal

OK

review: Approve
Revision history for this message
Alexandros Frantzis (afrantzis) wrote : Posted in a previous version of this proposal

616 - Displacement const disp;
617 + Displacement disp;
... and Point and Rectangle

The error is "default initialization of an object of const type '...' requires a user-provided default constructor"

I'd rather we didn't drop const and value initialize instead:

Displacement const disp{};

Alternatively we could provide appropriate constructors:

Displacement() {}
Displacement(DeltaX const& dx, DeltaY const& dy) : dx{dx}, dy{dy} {}

Note that in gcc we don't see this because gcc "allows const objects with no initializer or user-provided default constructor if the defaulted constructor initializes all the subobjects.", which IMHO, is what should have been in the standard in the first place... (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42844)

review: Needs Fixing
Revision history for this message
Kevin DuBois (kdub) wrote : Posted in a previous version of this proposal

seems ok. doesn't break android gcc cross build. I wouldn't expect clang to work to build for armhf for android with this branch alone. That being said, i'll +1, pending alexandros's comments

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote : Posted in a previous version of this proposal

> 616 - Displacement const disp;
> 617 + Displacement disp;
> ... and Point and Rectangle
>
> The error is "default initialization of an object of const type '...' requires
> a user-provided default constructor"
>
> I'd rather we didn't drop const and value initialize instead:
>
> Displacement const disp{};
>
> Alternatively we could provide appropriate constructors:
>
> Displacement() {}
> Displacement(DeltaX const& dx, DeltaY const& dy) : dx{dx}, dy{dy} {}
>
> Note that in gcc we don't see this because gcc "allows const objects with no
> initializer or user-provided default constructor if the defaulted constructor
> initializes all the subobjects.", which IMHO, is what should have been in the
> standard in the first place... (see
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42844)

I'm convinced

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Tried Alexandros' suggestion of "Foo const bar{}". Clang likes it, but gcc does not:
test-point.cpp:39:30: error: missing initializer for member ‘mir::geometry::Point::x’ [-Werror=missing-field-initializers]

"Foo bar;" is still the most elegant way to support both compilers. I don't think const-ness in test cases justifies polluting otherwise simple struct definitions with explicit constructors. So keeping it as it was.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> Clang likes it, but gcc does not:
> test-point.cpp:39:30: error: missing initializer for member ‘mir::geometry::Point::x’ [-Werror=missing-field-initializers]

Sigh... http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55805

How about:

Displacement const disp = Displacement();

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

I don't think:
    Displacement const disp = Displacement();
is a good alternative. Doesn't that create a non-const temporary anyway?

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> I don't think:
> Displacement const disp = Displacement();
> is a good alternative. Doesn't that create a non-const temporary anyway?

Depends on the compiler. I expect that the compiler is able to elide the copy and use of a temporary object.

But even if there is a non-const temporary involved, I don't see a problem; we don't (or have any way to) access this temporary object.

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

I think we're wasting time here.

At the binary level, both:
  Displacement const disp;
and
  Displacement disp;
are identical.

Only the latter works with both gcc and clang compilers. And although you could possibly make the expression more complex to keep the variable const, that would contradict the intention of the test cases in question -- to represent a completely uninitialized object.

Since the intention of this code is to test what happens to uninitialized objects, I think it would be preferable to avoid assignment. Regardless of assumptions about what might get optimized out.

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

> I think we're wasting time here.
>
> At the binary level, both:
> Displacement const disp;
> and
> Displacement disp;
> are identical.

And, with any sane compiler so is:

Displacement const disp = Displacement();
auto const disp = Displacement();
auto const& disp = Displacement();

etc.

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

I'd mildly prefer "auto const& disp = Displacement();" but not worth blocking on.

review: Approve
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> intention of the test cases in question -- to represent a completely uninitialized object.

The intention is to verify that default-initialization, which has the same effect as value-initialization for the structs under discussion, is producing sane values.

Revision history for this message
Robert Carr (robertcarr) wrote :

Clang!

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

still a +1 from before the resubmittal

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-03-15 22:34:53 +0000
+++ CMakeLists.txt 2013-03-19 03:30:28 +0000
@@ -24,8 +24,13 @@
24)24)
25cmake_policy(SET CMP0015 NEW)25cmake_policy(SET CMP0015 NEW)
2626
27set(CMAKE_C_COMPILER gcc-${MIR_GCC_VERSION})27if (NOT DEFINED CMAKE_C_COMPILER)
28set(CMAKE_CXX_COMPILER g++-${MIR_GCC_VERSION})28 set (CMAKE_C_COMPILER gcc-${MIR_GCC_VERSION})
29endif ()
30if (NOT DEFINED CMAKE_CXX_COMPILER)
31 set (CMAKE_CXX_COMPILER g++-${MIR_GCC_VERSION})
32endif ()
33
29set(CMAKE_GCOV gcov-${MIR_GCC_VERSION})34set(CMAKE_GCOV gcov-${MIR_GCC_VERSION})
3035
31project(Mir)36project(Mir)
@@ -169,6 +174,10 @@
169add_subdirectory(src/)174add_subdirectory(src/)
170include_directories(${MIR_GENERATED_INCLUDE_DIRECTORIES})175include_directories(${MIR_GENERATED_INCLUDE_DIRECTORIES})
171176
177set (OLD_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
178# Don't treat warnings as errors in 3rd_party/{gmock,cucumber-cpp}
179string (REPLACE " -Werror " " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
180
172# Pulling in local gmock version181# Pulling in local gmock version
173# While this seems evil, we are doing182# While this seems evil, we are doing
174# it to ensure/allow for:183# it to ensure/allow for:
@@ -195,6 +204,10 @@
195)204)
196# We need to build cucumber after gtest205# We need to build cucumber after gtest
197add_subdirectory(3rd_party/cucumber-cpp)206add_subdirectory(3rd_party/cucumber-cpp)
207
208# Restore -Werror for non-3rd-party code
209set (CMAKE_CXX_FLAGS ${OLD_CMAKE_CXX_FLAGS})
210
198add_subdirectory(benchmarks/)211add_subdirectory(benchmarks/)
199add_subdirectory(tests/)212add_subdirectory(tests/)
200add_subdirectory(tools/)213add_subdirectory(tools/)
201214
=== modified file 'cmake/src/mir/mir_discover_gtest_tests.cpp'
--- cmake/src/mir/mir_discover_gtest_tests.cpp 2013-03-08 07:20:43 +0000
+++ cmake/src/mir/mir_discover_gtest_tests.cpp 2013-03-19 03:30:28 +0000
@@ -52,11 +52,6 @@
52 return width;52 return width;
53}53}
5454
55std::string& ltrim(std::string &s) {
56 s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
57 return s;
58}
59
60string ordinary_cmd_line_pattern()55string ordinary_cmd_line_pattern()
61{56{
62 static const char* pattern = "ADD_TEST(\"%s.%s\" \"%s\" \"--gtest_filter=%s\")\n";57 static const char* pattern = "ADD_TEST(\"%s.%s\" \"%s\" \"--gtest_filter=%s\")\n";
@@ -89,22 +84,6 @@
89 return ss.str();84 return ss.str();
90}85}
9186
92std::string elide_string_right(const std::string& in, std::size_t max_size)
93{
94 assert(max_size >= 3);
95
96 std::string result(in.begin(), in.begin() + max_size);
97
98 if (in.size() >= max_size)
99 {
100 *(result.end()-1) = '.';
101 *(result.end()-2) = '.';
102 *(result.end()-3) = '.';
103 }
104
105 return result;
106}
107
108std::string elide_string_left(const std::string& in, std::size_t max_size)87std::string elide_string_left(const std::string& in, std::size_t max_size)
109{88{
110 assert(max_size >= 3);89 assert(max_size >= 3);
11190
=== modified file 'examples/image_renderer.cpp'
--- examples/image_renderer.cpp 2013-01-02 12:16:08 +0000
+++ examples/image_renderer.cpp 2013-03-19 03:30:28 +0000
@@ -18,7 +18,11 @@
1818
19#include "image_renderer.h"19#include "image_renderer.h"
2020
21// Unfortunately we have to ignore warnings/errors in 3rd party code.
22#pragma GCC diagnostic push
23#pragma GCC diagnostic warning "-Wall"
21#include <glm/glm.hpp>24#include <glm/glm.hpp>
25#pragma GCC diagnostic pop
22#include <glm/gtc/type_ptr.hpp>26#include <glm/gtc/type_ptr.hpp>
2327
24#include <memory>28#include <memory>
2529
=== modified file 'include/server/mir/compositor/buffer.h'
--- include/server/mir/compositor/buffer.h 2013-03-07 08:04:05 +0000
+++ include/server/mir/compositor/buffer.h 2013-03-19 03:30:28 +0000
@@ -27,7 +27,7 @@
27{27{
28namespace compositor28namespace compositor
29{29{
30class BufferIPCPackage;30struct BufferIPCPackage;
31class BufferID;31class BufferID;
3232
33class Buffer : public surfaces::GraphicRegion33class Buffer : public surfaces::GraphicRegion
3434
=== modified file 'include/server/mir/compositor/buffer_allocation_strategy.h'
--- include/server/mir/compositor/buffer_allocation_strategy.h 2013-03-07 08:04:05 +0000
+++ include/server/mir/compositor/buffer_allocation_strategy.h 2013-03-19 03:30:28 +0000
@@ -31,7 +31,7 @@
31{31{
32class GraphicBufferAllocator;32class GraphicBufferAllocator;
33class BufferSwapper;33class BufferSwapper;
34class BufferProperties;34struct BufferProperties;
3535
36class BufferAllocationStrategy36class BufferAllocationStrategy
37{37{
3838
=== modified file 'include/server/mir/compositor/buffer_bundle_manager.h'
--- include/server/mir/compositor/buffer_bundle_manager.h 2013-03-07 08:04:05 +0000
+++ include/server/mir/compositor/buffer_bundle_manager.h 2013-03-19 03:30:28 +0000
@@ -33,7 +33,7 @@
3333
34class BufferAllocationStrategy;34class BufferAllocationStrategy;
35class GraphicBufferAllocator;35class GraphicBufferAllocator;
36class BufferProperties;36struct BufferProperties;
3737
38class BufferBundleManager : public surfaces::BufferBundleFactory38class BufferBundleManager : public surfaces::BufferBundleFactory
39{39{
4040
=== modified file 'include/server/mir/compositor/buffer_bundle_surfaces.h'
--- include/server/mir/compositor/buffer_bundle_surfaces.h 2013-03-07 08:04:05 +0000
+++ include/server/mir/compositor/buffer_bundle_surfaces.h 2013-03-19 03:30:28 +0000
@@ -30,7 +30,7 @@
30{30{
3131
32class BufferIDUniqueGenerator;32class BufferIDUniqueGenerator;
33class BufferProperties;33struct BufferProperties;
34class BufferSwapper;34class BufferSwapper;
3535
36class BufferBundleSurfaces : public surfaces::BufferBundle36class BufferBundleSurfaces : public surfaces::BufferBundle
3737
=== modified file 'include/server/mir/compositor/graphic_buffer_allocator.h'
--- include/server/mir/compositor/graphic_buffer_allocator.h 2013-03-07 08:04:05 +0000
+++ include/server/mir/compositor/graphic_buffer_allocator.h 2013-03-19 03:30:28 +0000
@@ -29,7 +29,7 @@
29namespace compositor29namespace compositor
30{30{
3131
32class BufferProperties;32struct BufferProperties;
3333
34class GraphicBufferAllocator34class GraphicBufferAllocator
35{35{
3636
=== modified file 'include/server/mir/compositor/swapper_factory.h'
--- include/server/mir/compositor/swapper_factory.h 2013-03-07 08:04:05 +0000
+++ include/server/mir/compositor/swapper_factory.h 2013-03-19 03:30:28 +0000
@@ -27,7 +27,7 @@
27{27{
2828
29class GraphicBufferAllocator;29class GraphicBufferAllocator;
30class BufferProperties;30struct BufferProperties;
3131
32class SwapperFactory : public BufferAllocationStrategy32class SwapperFactory : public BufferAllocationStrategy
33{33{
3434
=== modified file 'include/server/mir/frontend/shell.h'
--- include/server/mir/frontend/shell.h 2013-03-15 23:15:45 +0000
+++ include/server/mir/frontend/shell.h 2013-03-19 03:30:28 +0000
@@ -28,7 +28,7 @@
28namespace frontend28namespace frontend
29{29{
30class Session;30class Session;
31class SurfaceCreationParameters;31struct SurfaceCreationParameters;
3232
33class Shell33class Shell
34{34{
3535
=== modified file 'include/server/mir/graphics/platform.h'
--- include/server/mir/graphics/platform.h 2013-03-07 08:04:05 +0000
+++ include/server/mir/graphics/platform.h 2013-03-19 03:30:28 +0000
@@ -36,7 +36,7 @@
36{36{
3737
38class Display;38class Display;
39class PlatformIPCPackage;39struct PlatformIPCPackage;
40class BufferInitializer;40class BufferInitializer;
4141
42class DisplayReport;42class DisplayReport;
4343
=== modified file 'include/server/mir/graphics/renderable.h'
--- include/server/mir/graphics/renderable.h 2013-03-07 08:04:05 +0000
+++ include/server/mir/graphics/renderable.h 2013-03-19 03:30:28 +0000
@@ -22,7 +22,12 @@
22#include "mir/geometry/point.h"22#include "mir/geometry/point.h"
23#include "mir/geometry/size.h"23#include "mir/geometry/size.h"
24#include <memory>24#include <memory>
25
26// Unfortunately we have to ignore warnings/errors in 3rd party code.
27#pragma GCC diagnostic push
28#pragma GCC diagnostic warning "-Wall"
25#include <glm/glm.hpp>29#include <glm/glm.hpp>
30#pragma GCC diagnostic pop
2631
27namespace mir32namespace mir
28{33{
2934
=== modified file 'include/server/mir/shell/session_manager.h'
--- include/server/mir/shell/session_manager.h 2013-03-15 23:15:45 +0000
+++ include/server/mir/shell/session_manager.h 2013-03-19 03:30:28 +0000
@@ -30,7 +30,7 @@
30{30{
31namespace frontend31namespace frontend
32{32{
33class SurfaceCreationParameters;33struct SurfaceCreationParameters;
34}34}
3535
36/// Management of sessions and surfaces36/// Management of sessions and surfaces
3737
=== modified file 'include/server/mir/shell/surface_builder.h'
--- include/server/mir/shell/surface_builder.h 2013-03-18 15:13:28 +0000
+++ include/server/mir/shell/surface_builder.h 2013-03-19 03:30:28 +0000
@@ -24,7 +24,7 @@
2424
25namespace mir25namespace mir
26{26{
27namespace frontend { class SurfaceCreationParameters; }27namespace frontend { struct SurfaceCreationParameters; }
28namespace surfaces { class Surface; }28namespace surfaces { class Surface; }
2929
30namespace shell30namespace shell
3131
=== modified file 'include/server/mir/surfaces/buffer_bundle_factory.h'
--- include/server/mir/surfaces/buffer_bundle_factory.h 2013-03-07 08:04:05 +0000
+++ include/server/mir/surfaces/buffer_bundle_factory.h 2013-03-19 03:30:28 +0000
@@ -27,7 +27,7 @@
27{27{
28namespace compositor28namespace compositor
29{29{
30class BufferProperties;30struct BufferProperties;
31}31}
3232
33namespace surfaces33namespace surfaces
3434
=== modified file 'include/server/mir/surfaces/surface_stack.h'
--- include/server/mir/surfaces/surface_stack.h 2013-03-18 15:13:28 +0000
+++ include/server/mir/surfaces/surface_stack.h 2013-03-19 03:30:28 +0000
@@ -37,7 +37,7 @@
3737
38namespace frontend38namespace frontend
39{39{
40class SurfaceCreationParameters;40struct SurfaceCreationParameters;
41}41}
4242
43/// Management of Surface objects. Includes the model (SurfaceStack and Surface43/// Management of Surface objects. Includes the model (SurfaceStack and Surface
4444
=== modified file 'include/server/mir/surfaces/surface_stack_model.h'
--- include/server/mir/surfaces/surface_stack_model.h 2013-03-15 22:34:53 +0000
+++ include/server/mir/surfaces/surface_stack_model.h 2013-03-19 03:30:28 +0000
@@ -25,7 +25,7 @@
25{25{
26namespace frontend26namespace frontend
27{27{
28class SurfaceCreationParameters;28struct SurfaceCreationParameters;
29}29}
3030
31namespace surfaces31namespace surfaces
3232
=== modified file 'include/shared/mir/geometry/forward.h'
--- include/shared/mir/geometry/forward.h 2013-03-07 08:04:05 +0000
+++ include/shared/mir/geometry/forward.h 2013-03-19 03:30:28 +0000
@@ -24,10 +24,10 @@
24namespace geometry24namespace geometry
25{25{
26// Declarations of geometric concepts I think we'll need26// Declarations of geometric concepts I think we'll need
27class Point;27struct Point;
28class Size;28struct Size;
29class Displacement;29class Displacement;
30class Rectangle;30struct Rectangle;
31class Region;31class Region;
32}32}
33}33}
3434
=== modified file 'src/client/client_buffer.h'
--- src/client/client_buffer.h 2013-03-07 08:04:05 +0000
+++ src/client/client_buffer.h 2013-03-19 03:30:28 +0000
@@ -28,7 +28,7 @@
2828
29namespace mir_toolkit29namespace mir_toolkit
30{30{
31class MirBufferPackage;31struct MirBufferPackage;
32}32}
3333
34namespace mir34namespace mir
3535
=== modified file 'src/client/client_buffer_depository.h'
--- src/client/client_buffer_depository.h 2013-03-07 08:04:05 +0000
+++ src/client/client_buffer_depository.h 2013-03-19 03:30:28 +0000
@@ -26,7 +26,7 @@
2626
27namespace mir_toolkit27namespace mir_toolkit
28{28{
29class MirBufferPackage;29struct MirBufferPackage;
30}30}
31namespace mir31namespace mir
32{32{
3333
=== modified file 'src/client/client_context.h'
--- src/client/client_context.h 2013-03-07 08:04:05 +0000
+++ src/client/client_context.h 2013-03-19 03:30:28 +0000
@@ -21,8 +21,8 @@
2121
22namespace mir_toolkit22namespace mir_toolkit
23{23{
24class MirPlatformPackage;24struct MirPlatformPackage;
25class MirConnection;25struct MirConnection;
26}26}
2727
28namespace mir28namespace mir
2929
=== modified file 'src/client/mir_connection.h'
--- src/client/mir_connection.h 2013-03-07 08:04:05 +0000
+++ src/client/mir_connection.h 2013-03-19 03:30:28 +0000
@@ -44,7 +44,7 @@
44}44}
45}45}
4646
47class mir_toolkit::MirConnection : public mir::client::ClientContext47struct mir_toolkit::MirConnection : public mir::client::ClientContext
48{48{
49public:49public:
50 MirConnection();50 MirConnection();
5151
=== modified file 'src/client/mir_surface.h'
--- src/client/mir_surface.h 2013-03-07 08:04:05 +0000
+++ src/client/mir_surface.h 2013-03-19 03:30:28 +0000
@@ -35,11 +35,11 @@
35namespace client35namespace client
36{36{
37class ClientBuffer;37class ClientBuffer;
38class MemoryRegion;38struct MemoryRegion;
39}39}
40}40}
4141
42class mir_toolkit::MirSurface : public mir::client::ClientSurface42struct mir_toolkit::MirSurface : public mir::client::ClientSurface
43{43{
44public:44public:
45 MirSurface(MirSurface const &) = delete;45 MirSurface(MirSurface const &) = delete;
4646
=== modified file 'src/client/mir_wait_handle.h'
--- src/client/mir_wait_handle.h 2013-03-08 07:20:43 +0000
+++ src/client/mir_wait_handle.h 2013-03-19 03:30:28 +0000
@@ -25,7 +25,7 @@
2525
26namespace mir_toolkit26namespace mir_toolkit
27{27{
28class MirWaitHandle28struct MirWaitHandle
29{29{
30public:30public:
31 MirWaitHandle();31 MirWaitHandle();
3232
=== modified file 'src/server/frontend/protobuf_socket_communicator.h'
--- src/server/frontend/protobuf_socket_communicator.h 2013-03-07 08:04:05 +0000
+++ src/server/frontend/protobuf_socket_communicator.h 2013-03-19 03:30:28 +0000
@@ -25,6 +25,7 @@
2525
26#include <boost/asio.hpp>26#include <boost/asio.hpp>
2727
28#include <atomic>
28#include <thread>29#include <thread>
29#include <string>30#include <string>
30#include <vector>31#include <vector>
@@ -47,7 +48,7 @@
4748
48namespace detail49namespace detail
49{50{
50class SocketSession;51struct SocketSession;
51}52}
5253
53class ProtobufSocketCommunicator : public Communicator54class ProtobufSocketCommunicator : public Communicator
5455
=== modified file 'src/server/graphics/gbm/gbm_buffer_allocator.h'
--- src/server/graphics/gbm/gbm_buffer_allocator.h 2013-03-07 08:04:05 +0000
+++ src/server/graphics/gbm/gbm_buffer_allocator.h 2013-03-19 03:30:28 +0000
@@ -34,7 +34,7 @@
34{34{
3535
36class GBMPlatform;36class GBMPlatform;
37class EGLExtensions;37struct EGLExtensions;
3838
39class GBMBufferAllocator: public compositor::GraphicBufferAllocator39class GBMBufferAllocator: public compositor::GraphicBufferAllocator
40{40{
4141
=== modified file 'src/server/graphics/gbm/gbm_display.h'
--- src/server/graphics/gbm/gbm_display.h 2013-03-07 08:04:05 +0000
+++ src/server/graphics/gbm/gbm_display.h 2013-03-19 03:30:28 +0000
@@ -30,7 +30,7 @@
30{30{
31namespace geometry31namespace geometry
32{32{
33class Rectangle;33struct Rectangle;
34}34}
35namespace graphics35namespace graphics
36{36{
3737
=== modified file 'src/server/graphics/gbm/gbm_display_buffer.cpp'
--- src/server/graphics/gbm/gbm_display_buffer.cpp 2013-03-07 08:04:05 +0000
+++ src/server/graphics/gbm/gbm_display_buffer.cpp 2013-03-19 03:30:28 +0000
@@ -71,14 +71,6 @@
71 delete bufobj;71 delete bufobj;
72}72}
7373
74void page_flip_handler(int /*fd*/, unsigned int /*frame*/,
75 unsigned int /*sec*/, unsigned int /*usec*/,
76 void* data)
77{
78 auto page_flip_pending = static_cast<int*>(data);
79 --(*page_flip_pending);
80}
81
82void ensure_egl_image_extensions()74void ensure_egl_image_extensions()
83{75{
84 std::string ext_string;76 std::string ext_string;
8577
=== modified file 'src/server/graphics/gbm/gbm_display_helpers.h'
--- src/server/graphics/gbm/gbm_display_helpers.h 2013-03-07 08:04:05 +0000
+++ src/server/graphics/gbm/gbm_display_helpers.h 2013-03-19 03:30:28 +0000
@@ -25,7 +25,7 @@
25#include <memory>25#include <memory>
2626
27#pragma GCC diagnostic push27#pragma GCC diagnostic push
28#pragma GCC diagnostic ignored "-pedantic" // Ignore bad syntax in gbm.h28#pragma GCC diagnostic warning "-Wall"
29#include <gbm.h>29#include <gbm.h>
30#pragma GCC diagnostic pop30#pragma GCC diagnostic pop
3131
3232
=== modified file 'src/server/graphics/gbm/kms_display_configuration.cpp'
--- src/server/graphics/gbm/kms_display_configuration.cpp 2013-03-07 08:04:05 +0000
+++ src/server/graphics/gbm/kms_display_configuration.cpp 2013-03-19 03:30:28 +0000
@@ -60,7 +60,6 @@
60}60}
6161
62mgg::KMSDisplayConfiguration::KMSDisplayConfiguration(int drm_fd)62mgg::KMSDisplayConfiguration::KMSDisplayConfiguration(int drm_fd)
63 : drm_fd{drm_fd}
64{63{
65 DRMModeResources resources{drm_fd};64 DRMModeResources resources{drm_fd};
6665
6766
=== modified file 'src/server/graphics/gbm/kms_display_configuration.h'
--- src/server/graphics/gbm/kms_display_configuration.h 2013-03-07 08:04:05 +0000
+++ src/server/graphics/gbm/kms_display_configuration.h 2013-03-19 03:30:28 +0000
@@ -47,7 +47,6 @@
47private:47private:
48 void add_output(DRMModeResources const& resources, drmModeConnector const& connector);48 void add_output(DRMModeResources const& resources, drmModeConnector const& connector);
4949
50 int const drm_fd;
51 std::vector<DisplayConfigurationOutput> outputs;50 std::vector<DisplayConfigurationOutput> outputs;
52};51};
5352
5453
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2013-03-14 21:29:14 +0000
+++ tests/CMakeLists.txt 2013-03-19 03:30:28 +0000
@@ -16,6 +16,12 @@
16 ON16 ON
17)17)
1818
19if ("${CMAKE_CXX_COMPILER}" MATCHES "clang")
20 # Avoid clang complaints about poor quality gmock/gtest/cucumber headers
21 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=null-dereference")
22 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=overloaded-virtual")
23endif ()
24
19if(MIR_ENABLE_DEATH_TESTS)25if(MIR_ENABLE_DEATH_TESTS)
20 add_definitions(-DMIR_DEATH_TESTS_ENABLED)26 add_definitions(-DMIR_DEATH_TESTS_ENABLED)
21endif(MIR_ENABLE_DEATH_TESTS)27endif(MIR_ENABLE_DEATH_TESTS)
2228
=== modified file 'tests/death-tests/test_application_manager_death.cpp'
--- tests/death-tests/test_application_manager_death.cpp 2013-03-07 08:04:05 +0000
+++ tests/death-tests/test_application_manager_death.cpp 2013-03-19 03:30:28 +0000
@@ -30,10 +30,11 @@
30// ::testing::FLAGS_gtest_death_test_style = "threadsafe";30// ::testing::FLAGS_gtest_death_test_style = "threadsafe";
31// leads to the test failing under valgrind31// leads to the test failing under valgrind
32 EXPECT_EXIT(32 EXPECT_EXIT(
33 mir::shell::SessionManager app(std::shared_ptr<msh::SurfaceFactory>(),33 std::shared_ptr<msh::SurfaceFactory> factory;
34 std::shared_ptr<msh::SessionContainer>(),34 mir::shell::SessionManager app(factory,
35 std::shared_ptr<msh::FocusSequence>(),35 std::shared_ptr<msh::SessionContainer>(),
36 std::shared_ptr<msh::FocusSetter>()),36 std::shared_ptr<msh::FocusSequence>(),
37 std::shared_ptr<msh::FocusSetter>()),
37 ::testing::KilledBySignal(SIGABRT),38 ::testing::KilledBySignal(SIGABRT),
38 ".*");39 ".*");
39}40}
4041
=== modified file 'tests/integration-tests/test_drm_auth_magic.cpp'
--- tests/integration-tests/test_drm_auth_magic.cpp 2013-03-07 08:04:05 +0000
+++ tests/integration-tests/test_drm_auth_magic.cpp 2013-03-19 03:30:28 +0000
@@ -147,7 +147,7 @@
147TEST_F(BespokeDisplayServerTestFixture, drm_auth_magic_platform_error_reaches_client)147TEST_F(BespokeDisplayServerTestFixture, drm_auth_magic_platform_error_reaches_client)
148{148{
149 unsigned int const magic{0x10111213};149 unsigned int const magic{0x10111213};
150 int const auth_magic_error{667};150 static int const auth_magic_error{667};
151151
152 struct ServerConfig : TestingServerConfiguration152 struct ServerConfig : TestingServerConfiguration
153 {153 {
154154
=== modified file 'tests/integration-tests/test_surfaceloop.cpp'
--- tests/integration-tests/test_surfaceloop.cpp 2013-03-07 08:04:05 +0000
+++ tests/integration-tests/test_surfaceloop.cpp 2013-03-19 03:30:28 +0000
@@ -248,8 +248,7 @@
248248
249 struct ServerConfig : TestingServerConfiguration249 struct ServerConfig : TestingServerConfiguration
250 {250 {
251 std::shared_ptr<mc::BufferAllocationStrategy> the_buffer_allocation_strategy(251 std::shared_ptr<mc::BufferAllocationStrategy> the_buffer_allocation_strategy()
252 std::shared_ptr<mc::GraphicBufferAllocator> const& /*buffer_allocator*/)
253 {252 {
254 using namespace testing;253 using namespace testing;
255254
256255
=== modified file 'tests/mir_test_framework/testing_process_manager.cpp'
--- tests/mir_test_framework/testing_process_manager.cpp 2013-03-12 03:50:42 +0000
+++ tests/mir_test_framework/testing_process_manager.cpp 2013-03-19 03:30:28 +0000
@@ -31,18 +31,6 @@
31namespace mc = mir::compositor;31namespace mc = mir::compositor;
32namespace mtf = mir_test_framework;32namespace mtf = mir_test_framework;
3333
34namespace
35{
36::testing::AssertionResult WasStarted(
37 std::shared_ptr<mtf::Process> const& server_process)
38{
39 if (server_process)
40 return ::testing::AssertionSuccess() << "server started";
41 else
42 return ::testing::AssertionFailure() << "server NOT started";
43}
44}
45
46namespace mir_test_framework34namespace mir_test_framework
47{35{
48void startup_pause()36void startup_pause()
@@ -96,15 +84,11 @@
96 signal_display_server = &server;84 signal_display_server = &server;
9785
98 {86 {
99 struct ScopedFuture87 std::future<void> future = std::async(std::launch::async, std::bind(&mir::DisplayServer::run, &server));
100 {
101 std::future<void> future;
102 ~ScopedFuture() { future.wait(); }
103 } scoped;
104
105 scoped.future = std::async(std::launch::async, std::bind(&mir::DisplayServer::run, &server));
10688
107 config.exec(&server);89 config.exec(&server);
90
91 future.wait();
108 }92 }
10993
110 config.on_exit(&server);94 config.on_exit(&server);
11195
=== modified file 'tests/unit-tests/geometry/test-displacement.cpp'
--- tests/unit-tests/geometry/test-displacement.cpp 2012-09-18 12:09:56 +0000
+++ tests/unit-tests/geometry/test-displacement.cpp 2013-03-19 03:30:28 +0000
@@ -26,7 +26,7 @@
26TEST(geometry, displacement)26TEST(geometry, displacement)
27{27{
28 using namespace geom;28 using namespace geom;
29 Displacement const disp;29 Displacement disp;
30 Displacement const dx2dy4{DeltaX{2}, DeltaY{4}};30 Displacement const dx2dy4{DeltaX{2}, DeltaY{4}};
3131
32 EXPECT_EQ(DeltaX{0}, disp.dx);32 EXPECT_EQ(DeltaX{0}, disp.dx);
3333
=== modified file 'tests/unit-tests/geometry/test-point.cpp'
--- tests/unit-tests/geometry/test-point.cpp 2012-09-18 10:35:52 +0000
+++ tests/unit-tests/geometry/test-point.cpp 2013-03-19 03:30:28 +0000
@@ -36,7 +36,7 @@
36 EXPECT_EQ(Y(4), copy.y);36 EXPECT_EQ(Y(4), copy.y);
37 EXPECT_EQ(pointx2y4, copy);37 EXPECT_EQ(pointx2y4, copy);
3838
39 Point const defaultValue;39 Point defaultValue;
40 EXPECT_EQ(X(0), defaultValue.x);40 EXPECT_EQ(X(0), defaultValue.x);
41 EXPECT_EQ(Y(0), defaultValue.y);41 EXPECT_EQ(Y(0), defaultValue.y);
42 EXPECT_NE(pointx2y4, defaultValue);42 EXPECT_NE(pointx2y4, defaultValue);
4343
=== modified file 'tests/unit-tests/geometry/test-rectangle.cpp'
--- tests/unit-tests/geometry/test-rectangle.cpp 2012-09-18 12:26:17 +0000
+++ tests/unit-tests/geometry/test-rectangle.cpp 2013-03-19 03:30:28 +0000
@@ -38,7 +38,7 @@
38 EXPECT_EQ(w2h4, copy.size);38 EXPECT_EQ(w2h4, copy.size);
39 EXPECT_EQ(rect, copy);39 EXPECT_EQ(rect, copy);
4040
41 Rectangle const default_rect;41 Rectangle default_rect;
42 EXPECT_EQ(Point(), default_rect.top_left);42 EXPECT_EQ(Point(), default_rect.top_left);
43 EXPECT_EQ(Size(), default_rect.size);43 EXPECT_EQ(Size(), default_rect.size);
44 EXPECT_NE(rect, default_rect);44 EXPECT_NE(rect, default_rect);
4545
=== modified file 'tests/unit-tests/graphics/gbm/mock_gbm.h'
--- tests/unit-tests/graphics/gbm/mock_gbm.h 2013-01-31 09:56:11 +0000
+++ tests/unit-tests/graphics/gbm/mock_gbm.h 2013-03-19 03:30:28 +0000
@@ -22,7 +22,7 @@
22#include <gmock/gmock.h>22#include <gmock/gmock.h>
2323
24#pragma GCC diagnostic push24#pragma GCC diagnostic push
25#pragma GCC diagnostic ignored "-pedantic" // Ignore bad syntax in gbm.h25#pragma GCC diagnostic warning "-Wall"
26#include <gbm.h>26#include <gbm.h>
27#pragma GCC diagnostic pop27#pragma GCC diagnostic pop
2828

Subscribers

People subscribed via source and target branches