Mir

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

Proposed by Daniel van Vugt
Status: Superseded
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
Alan Griffiths Needs Fixing
Kevin DuBois (community) Approve
Alexandros Frantzis (community) Needs Fixing
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+153524@code.launchpad.net

This proposal has been superseded by a proposal from 2013-03-19.

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 :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

OK

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

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 :

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 :

> 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 :

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.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-03-15 22:34:53 +0000
3+++ CMakeLists.txt 2013-03-19 03:25:26 +0000
4@@ -24,8 +24,13 @@
5 )
6 cmake_policy(SET CMP0015 NEW)
7
8-set(CMAKE_C_COMPILER gcc-${MIR_GCC_VERSION})
9-set(CMAKE_CXX_COMPILER g++-${MIR_GCC_VERSION})
10+if (NOT DEFINED CMAKE_C_COMPILER)
11+ set (CMAKE_C_COMPILER gcc-${MIR_GCC_VERSION})
12+endif ()
13+if (NOT DEFINED CMAKE_CXX_COMPILER)
14+ set (CMAKE_CXX_COMPILER g++-${MIR_GCC_VERSION})
15+endif ()
16+
17 set(CMAKE_GCOV gcov-${MIR_GCC_VERSION})
18
19 project(Mir)
20@@ -169,6 +174,10 @@
21 add_subdirectory(src/)
22 include_directories(${MIR_GENERATED_INCLUDE_DIRECTORIES})
23
24+set (OLD_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
25+# Don't treat warnings as errors in 3rd_party/{gmock,cucumber-cpp}
26+string (REPLACE " -Werror " " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
27+
28 # Pulling in local gmock version
29 # While this seems evil, we are doing
30 # it to ensure/allow for:
31@@ -195,6 +204,10 @@
32 )
33 # We need to build cucumber after gtest
34 add_subdirectory(3rd_party/cucumber-cpp)
35+
36+# Restore -Werror for non-3rd-party code
37+set (CMAKE_CXX_FLAGS ${OLD_CMAKE_CXX_FLAGS})
38+
39 add_subdirectory(benchmarks/)
40 add_subdirectory(tests/)
41 add_subdirectory(tools/)
42
43=== modified file 'cmake/src/mir/mir_discover_gtest_tests.cpp'
44--- cmake/src/mir/mir_discover_gtest_tests.cpp 2013-03-08 07:20:43 +0000
45+++ cmake/src/mir/mir_discover_gtest_tests.cpp 2013-03-19 03:25:26 +0000
46@@ -52,11 +52,6 @@
47 return width;
48 }
49
50-std::string& ltrim(std::string &s) {
51- s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
52- return s;
53-}
54-
55 string ordinary_cmd_line_pattern()
56 {
57 static const char* pattern = "ADD_TEST(\"%s.%s\" \"%s\" \"--gtest_filter=%s\")\n";
58@@ -89,22 +84,6 @@
59 return ss.str();
60 }
61
62-std::string elide_string_right(const std::string& in, std::size_t max_size)
63-{
64- assert(max_size >= 3);
65-
66- std::string result(in.begin(), in.begin() + max_size);
67-
68- if (in.size() >= max_size)
69- {
70- *(result.end()-1) = '.';
71- *(result.end()-2) = '.';
72- *(result.end()-3) = '.';
73- }
74-
75- return result;
76-}
77-
78 std::string elide_string_left(const std::string& in, std::size_t max_size)
79 {
80 assert(max_size >= 3);
81
82=== modified file 'examples/image_renderer.cpp'
83--- examples/image_renderer.cpp 2013-01-02 12:16:08 +0000
84+++ examples/image_renderer.cpp 2013-03-19 03:25:26 +0000
85@@ -18,7 +18,11 @@
86
87 #include "image_renderer.h"
88
89+// Unfortunately we have to ignore warnings/errors in 3rd party code.
90+#pragma GCC diagnostic push
91+#pragma GCC diagnostic warning "-Wall"
92 #include <glm/glm.hpp>
93+#pragma GCC diagnostic pop
94 #include <glm/gtc/type_ptr.hpp>
95
96 #include <memory>
97
98=== modified file 'include/server/mir/compositor/buffer.h'
99--- include/server/mir/compositor/buffer.h 2013-03-07 08:04:05 +0000
100+++ include/server/mir/compositor/buffer.h 2013-03-19 03:25:26 +0000
101@@ -27,7 +27,7 @@
102 {
103 namespace compositor
104 {
105-class BufferIPCPackage;
106+struct BufferIPCPackage;
107 class BufferID;
108
109 class Buffer : public surfaces::GraphicRegion
110
111=== modified file 'include/server/mir/compositor/buffer_allocation_strategy.h'
112--- include/server/mir/compositor/buffer_allocation_strategy.h 2013-03-07 08:04:05 +0000
113+++ include/server/mir/compositor/buffer_allocation_strategy.h 2013-03-19 03:25:26 +0000
114@@ -31,7 +31,7 @@
115 {
116 class GraphicBufferAllocator;
117 class BufferSwapper;
118-class BufferProperties;
119+struct BufferProperties;
120
121 class BufferAllocationStrategy
122 {
123
124=== modified file 'include/server/mir/compositor/buffer_bundle_manager.h'
125--- include/server/mir/compositor/buffer_bundle_manager.h 2013-03-07 08:04:05 +0000
126+++ include/server/mir/compositor/buffer_bundle_manager.h 2013-03-19 03:25:26 +0000
127@@ -33,7 +33,7 @@
128
129 class BufferAllocationStrategy;
130 class GraphicBufferAllocator;
131-class BufferProperties;
132+struct BufferProperties;
133
134 class BufferBundleManager : public surfaces::BufferBundleFactory
135 {
136
137=== modified file 'include/server/mir/compositor/buffer_bundle_surfaces.h'
138--- include/server/mir/compositor/buffer_bundle_surfaces.h 2013-03-07 08:04:05 +0000
139+++ include/server/mir/compositor/buffer_bundle_surfaces.h 2013-03-19 03:25:26 +0000
140@@ -30,7 +30,7 @@
141 {
142
143 class BufferIDUniqueGenerator;
144-class BufferProperties;
145+struct BufferProperties;
146 class BufferSwapper;
147
148 class BufferBundleSurfaces : public surfaces::BufferBundle
149
150=== modified file 'include/server/mir/compositor/graphic_buffer_allocator.h'
151--- include/server/mir/compositor/graphic_buffer_allocator.h 2013-03-07 08:04:05 +0000
152+++ include/server/mir/compositor/graphic_buffer_allocator.h 2013-03-19 03:25:26 +0000
153@@ -29,7 +29,7 @@
154 namespace compositor
155 {
156
157-class BufferProperties;
158+struct BufferProperties;
159
160 class GraphicBufferAllocator
161 {
162
163=== modified file 'include/server/mir/compositor/swapper_factory.h'
164--- include/server/mir/compositor/swapper_factory.h 2013-03-07 08:04:05 +0000
165+++ include/server/mir/compositor/swapper_factory.h 2013-03-19 03:25:26 +0000
166@@ -27,7 +27,7 @@
167 {
168
169 class GraphicBufferAllocator;
170-class BufferProperties;
171+struct BufferProperties;
172
173 class SwapperFactory : public BufferAllocationStrategy
174 {
175
176=== modified file 'include/server/mir/frontend/shell.h'
177--- include/server/mir/frontend/shell.h 2013-03-15 23:15:45 +0000
178+++ include/server/mir/frontend/shell.h 2013-03-19 03:25:26 +0000
179@@ -28,7 +28,7 @@
180 namespace frontend
181 {
182 class Session;
183-class SurfaceCreationParameters;
184+struct SurfaceCreationParameters;
185
186 class Shell
187 {
188
189=== modified file 'include/server/mir/graphics/platform.h'
190--- include/server/mir/graphics/platform.h 2013-03-07 08:04:05 +0000
191+++ include/server/mir/graphics/platform.h 2013-03-19 03:25:26 +0000
192@@ -36,7 +36,7 @@
193 {
194
195 class Display;
196-class PlatformIPCPackage;
197+struct PlatformIPCPackage;
198 class BufferInitializer;
199
200 class DisplayReport;
201
202=== modified file 'include/server/mir/graphics/renderable.h'
203--- include/server/mir/graphics/renderable.h 2013-03-07 08:04:05 +0000
204+++ include/server/mir/graphics/renderable.h 2013-03-19 03:25:26 +0000
205@@ -22,7 +22,12 @@
206 #include "mir/geometry/point.h"
207 #include "mir/geometry/size.h"
208 #include <memory>
209+
210+// Unfortunately we have to ignore warnings/errors in 3rd party code.
211+#pragma GCC diagnostic push
212+#pragma GCC diagnostic warning "-Wall"
213 #include <glm/glm.hpp>
214+#pragma GCC diagnostic pop
215
216 namespace mir
217 {
218
219=== modified file 'include/server/mir/shell/session_manager.h'
220--- include/server/mir/shell/session_manager.h 2013-03-15 23:15:45 +0000
221+++ include/server/mir/shell/session_manager.h 2013-03-19 03:25:26 +0000
222@@ -30,7 +30,7 @@
223 {
224 namespace frontend
225 {
226-class SurfaceCreationParameters;
227+struct SurfaceCreationParameters;
228 }
229
230 /// Management of sessions and surfaces
231
232=== modified file 'include/server/mir/shell/surface_builder.h'
233--- include/server/mir/shell/surface_builder.h 2013-03-18 15:13:28 +0000
234+++ include/server/mir/shell/surface_builder.h 2013-03-19 03:25:26 +0000
235@@ -24,7 +24,7 @@
236
237 namespace mir
238 {
239-namespace frontend { class SurfaceCreationParameters; }
240+namespace frontend { struct SurfaceCreationParameters; }
241 namespace surfaces { class Surface; }
242
243 namespace shell
244
245=== modified file 'include/server/mir/surfaces/buffer_bundle_factory.h'
246--- include/server/mir/surfaces/buffer_bundle_factory.h 2013-03-07 08:04:05 +0000
247+++ include/server/mir/surfaces/buffer_bundle_factory.h 2013-03-19 03:25:26 +0000
248@@ -27,7 +27,7 @@
249 {
250 namespace compositor
251 {
252-class BufferProperties;
253+struct BufferProperties;
254 }
255
256 namespace surfaces
257
258=== modified file 'include/server/mir/surfaces/surface_stack.h'
259--- include/server/mir/surfaces/surface_stack.h 2013-03-18 15:13:28 +0000
260+++ include/server/mir/surfaces/surface_stack.h 2013-03-19 03:25:26 +0000
261@@ -37,7 +37,7 @@
262
263 namespace frontend
264 {
265-class SurfaceCreationParameters;
266+struct SurfaceCreationParameters;
267 }
268
269 /// Management of Surface objects. Includes the model (SurfaceStack and Surface
270
271=== modified file 'include/server/mir/surfaces/surface_stack_model.h'
272--- include/server/mir/surfaces/surface_stack_model.h 2013-03-15 22:34:53 +0000
273+++ include/server/mir/surfaces/surface_stack_model.h 2013-03-19 03:25:26 +0000
274@@ -25,7 +25,7 @@
275 {
276 namespace frontend
277 {
278-class SurfaceCreationParameters;
279+struct SurfaceCreationParameters;
280 }
281
282 namespace surfaces
283
284=== modified file 'include/shared/mir/geometry/forward.h'
285--- include/shared/mir/geometry/forward.h 2013-03-07 08:04:05 +0000
286+++ include/shared/mir/geometry/forward.h 2013-03-19 03:25:26 +0000
287@@ -24,10 +24,10 @@
288 namespace geometry
289 {
290 // Declarations of geometric concepts I think we'll need
291-class Point;
292-class Size;
293+struct Point;
294+struct Size;
295 class Displacement;
296-class Rectangle;
297+struct Rectangle;
298 class Region;
299 }
300 }
301
302=== modified file 'src/client/client_buffer.h'
303--- src/client/client_buffer.h 2013-03-07 08:04:05 +0000
304+++ src/client/client_buffer.h 2013-03-19 03:25:26 +0000
305@@ -28,7 +28,7 @@
306
307 namespace mir_toolkit
308 {
309-class MirBufferPackage;
310+struct MirBufferPackage;
311 }
312
313 namespace mir
314
315=== modified file 'src/client/client_buffer_depository.h'
316--- src/client/client_buffer_depository.h 2013-03-07 08:04:05 +0000
317+++ src/client/client_buffer_depository.h 2013-03-19 03:25:26 +0000
318@@ -26,7 +26,7 @@
319
320 namespace mir_toolkit
321 {
322-class MirBufferPackage;
323+struct MirBufferPackage;
324 }
325 namespace mir
326 {
327
328=== modified file 'src/client/client_context.h'
329--- src/client/client_context.h 2013-03-07 08:04:05 +0000
330+++ src/client/client_context.h 2013-03-19 03:25:26 +0000
331@@ -21,8 +21,8 @@
332
333 namespace mir_toolkit
334 {
335-class MirPlatformPackage;
336-class MirConnection;
337+struct MirPlatformPackage;
338+struct MirConnection;
339 }
340
341 namespace mir
342
343=== modified file 'src/client/mir_connection.h'
344--- src/client/mir_connection.h 2013-03-07 08:04:05 +0000
345+++ src/client/mir_connection.h 2013-03-19 03:25:26 +0000
346@@ -44,7 +44,7 @@
347 }
348 }
349
350-class mir_toolkit::MirConnection : public mir::client::ClientContext
351+struct mir_toolkit::MirConnection : public mir::client::ClientContext
352 {
353 public:
354 MirConnection();
355
356=== modified file 'src/client/mir_surface.h'
357--- src/client/mir_surface.h 2013-03-07 08:04:05 +0000
358+++ src/client/mir_surface.h 2013-03-19 03:25:26 +0000
359@@ -35,11 +35,11 @@
360 namespace client
361 {
362 class ClientBuffer;
363-class MemoryRegion;
364+struct MemoryRegion;
365 }
366 }
367
368-class mir_toolkit::MirSurface : public mir::client::ClientSurface
369+struct mir_toolkit::MirSurface : public mir::client::ClientSurface
370 {
371 public:
372 MirSurface(MirSurface const &) = delete;
373
374=== modified file 'src/client/mir_wait_handle.h'
375--- src/client/mir_wait_handle.h 2013-03-08 07:20:43 +0000
376+++ src/client/mir_wait_handle.h 2013-03-19 03:25:26 +0000
377@@ -25,7 +25,7 @@
378
379 namespace mir_toolkit
380 {
381-class MirWaitHandle
382+struct MirWaitHandle
383 {
384 public:
385 MirWaitHandle();
386
387=== modified file 'src/server/frontend/protobuf_socket_communicator.h'
388--- src/server/frontend/protobuf_socket_communicator.h 2013-03-07 08:04:05 +0000
389+++ src/server/frontend/protobuf_socket_communicator.h 2013-03-19 03:25:26 +0000
390@@ -25,6 +25,7 @@
391
392 #include <boost/asio.hpp>
393
394+#include <atomic>
395 #include <thread>
396 #include <string>
397 #include <vector>
398@@ -47,7 +48,7 @@
399
400 namespace detail
401 {
402-class SocketSession;
403+struct SocketSession;
404 }
405
406 class ProtobufSocketCommunicator : public Communicator
407
408=== modified file 'src/server/graphics/gbm/gbm_buffer_allocator.h'
409--- src/server/graphics/gbm/gbm_buffer_allocator.h 2013-03-07 08:04:05 +0000
410+++ src/server/graphics/gbm/gbm_buffer_allocator.h 2013-03-19 03:25:26 +0000
411@@ -34,7 +34,7 @@
412 {
413
414 class GBMPlatform;
415-class EGLExtensions;
416+struct EGLExtensions;
417
418 class GBMBufferAllocator: public compositor::GraphicBufferAllocator
419 {
420
421=== modified file 'src/server/graphics/gbm/gbm_display.h'
422--- src/server/graphics/gbm/gbm_display.h 2013-03-07 08:04:05 +0000
423+++ src/server/graphics/gbm/gbm_display.h 2013-03-19 03:25:26 +0000
424@@ -30,7 +30,7 @@
425 {
426 namespace geometry
427 {
428-class Rectangle;
429+struct Rectangle;
430 }
431 namespace graphics
432 {
433
434=== modified file 'src/server/graphics/gbm/gbm_display_buffer.cpp'
435--- src/server/graphics/gbm/gbm_display_buffer.cpp 2013-03-07 08:04:05 +0000
436+++ src/server/graphics/gbm/gbm_display_buffer.cpp 2013-03-19 03:25:26 +0000
437@@ -71,14 +71,6 @@
438 delete bufobj;
439 }
440
441-void page_flip_handler(int /*fd*/, unsigned int /*frame*/,
442- unsigned int /*sec*/, unsigned int /*usec*/,
443- void* data)
444-{
445- auto page_flip_pending = static_cast<int*>(data);
446- --(*page_flip_pending);
447-}
448-
449 void ensure_egl_image_extensions()
450 {
451 std::string ext_string;
452
453=== modified file 'src/server/graphics/gbm/gbm_display_helpers.h'
454--- src/server/graphics/gbm/gbm_display_helpers.h 2013-03-07 08:04:05 +0000
455+++ src/server/graphics/gbm/gbm_display_helpers.h 2013-03-19 03:25:26 +0000
456@@ -25,7 +25,7 @@
457 #include <memory>
458
459 #pragma GCC diagnostic push
460-#pragma GCC diagnostic ignored "-pedantic" // Ignore bad syntax in gbm.h
461+#pragma GCC diagnostic warning "-Wall"
462 #include <gbm.h>
463 #pragma GCC diagnostic pop
464
465
466=== modified file 'src/server/graphics/gbm/kms_display_configuration.cpp'
467--- src/server/graphics/gbm/kms_display_configuration.cpp 2013-03-07 08:04:05 +0000
468+++ src/server/graphics/gbm/kms_display_configuration.cpp 2013-03-19 03:25:26 +0000
469@@ -60,7 +60,6 @@
470 }
471
472 mgg::KMSDisplayConfiguration::KMSDisplayConfiguration(int drm_fd)
473- : drm_fd{drm_fd}
474 {
475 DRMModeResources resources{drm_fd};
476
477
478=== modified file 'src/server/graphics/gbm/kms_display_configuration.h'
479--- src/server/graphics/gbm/kms_display_configuration.h 2013-03-07 08:04:05 +0000
480+++ src/server/graphics/gbm/kms_display_configuration.h 2013-03-19 03:25:26 +0000
481@@ -47,7 +47,6 @@
482 private:
483 void add_output(DRMModeResources const& resources, drmModeConnector const& connector);
484
485- int const drm_fd;
486 std::vector<DisplayConfigurationOutput> outputs;
487 };
488
489
490=== modified file 'tests/CMakeLists.txt'
491--- tests/CMakeLists.txt 2013-03-14 21:29:14 +0000
492+++ tests/CMakeLists.txt 2013-03-19 03:25:26 +0000
493@@ -16,6 +16,12 @@
494 ON
495 )
496
497+if ("${CMAKE_CXX_COMPILER}" MATCHES "clang")
498+ # Avoid clang complaints about poor quality gmock/gtest/cucumber headers
499+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=null-dereference")
500+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=overloaded-virtual")
501+endif ()
502+
503 if(MIR_ENABLE_DEATH_TESTS)
504 add_definitions(-DMIR_DEATH_TESTS_ENABLED)
505 endif(MIR_ENABLE_DEATH_TESTS)
506
507=== modified file 'tests/death-tests/test_application_manager_death.cpp'
508--- tests/death-tests/test_application_manager_death.cpp 2013-03-07 08:04:05 +0000
509+++ tests/death-tests/test_application_manager_death.cpp 2013-03-19 03:25:26 +0000
510@@ -30,10 +30,11 @@
511 // ::testing::FLAGS_gtest_death_test_style = "threadsafe";
512 // leads to the test failing under valgrind
513 EXPECT_EXIT(
514- mir::shell::SessionManager app(std::shared_ptr<msh::SurfaceFactory>(),
515- std::shared_ptr<msh::SessionContainer>(),
516- std::shared_ptr<msh::FocusSequence>(),
517- std::shared_ptr<msh::FocusSetter>()),
518+ std::shared_ptr<msh::SurfaceFactory> factory;
519+ mir::shell::SessionManager app(factory,
520+ std::shared_ptr<msh::SessionContainer>(),
521+ std::shared_ptr<msh::FocusSequence>(),
522+ std::shared_ptr<msh::FocusSetter>()),
523 ::testing::KilledBySignal(SIGABRT),
524 ".*");
525 }
526
527=== modified file 'tests/integration-tests/test_drm_auth_magic.cpp'
528--- tests/integration-tests/test_drm_auth_magic.cpp 2013-03-07 08:04:05 +0000
529+++ tests/integration-tests/test_drm_auth_magic.cpp 2013-03-19 03:25:26 +0000
530@@ -147,7 +147,7 @@
531 TEST_F(BespokeDisplayServerTestFixture, drm_auth_magic_platform_error_reaches_client)
532 {
533 unsigned int const magic{0x10111213};
534- int const auth_magic_error{667};
535+ static int const auth_magic_error{667};
536
537 struct ServerConfig : TestingServerConfiguration
538 {
539
540=== modified file 'tests/integration-tests/test_surfaceloop.cpp'
541--- tests/integration-tests/test_surfaceloop.cpp 2013-03-07 08:04:05 +0000
542+++ tests/integration-tests/test_surfaceloop.cpp 2013-03-19 03:25:26 +0000
543@@ -248,8 +248,7 @@
544
545 struct ServerConfig : TestingServerConfiguration
546 {
547- std::shared_ptr<mc::BufferAllocationStrategy> the_buffer_allocation_strategy(
548- std::shared_ptr<mc::GraphicBufferAllocator> const& /*buffer_allocator*/)
549+ std::shared_ptr<mc::BufferAllocationStrategy> the_buffer_allocation_strategy()
550 {
551 using namespace testing;
552
553
554=== modified file 'tests/mir_test_framework/testing_process_manager.cpp'
555--- tests/mir_test_framework/testing_process_manager.cpp 2013-03-12 03:50:42 +0000
556+++ tests/mir_test_framework/testing_process_manager.cpp 2013-03-19 03:25:26 +0000
557@@ -31,18 +31,6 @@
558 namespace mc = mir::compositor;
559 namespace mtf = mir_test_framework;
560
561-namespace
562-{
563-::testing::AssertionResult WasStarted(
564- std::shared_ptr<mtf::Process> const& server_process)
565-{
566- if (server_process)
567- return ::testing::AssertionSuccess() << "server started";
568- else
569- return ::testing::AssertionFailure() << "server NOT started";
570-}
571-}
572-
573 namespace mir_test_framework
574 {
575 void startup_pause()
576@@ -96,15 +84,11 @@
577 signal_display_server = &server;
578
579 {
580- struct ScopedFuture
581- {
582- std::future<void> future;
583- ~ScopedFuture() { future.wait(); }
584- } scoped;
585-
586- scoped.future = std::async(std::launch::async, std::bind(&mir::DisplayServer::run, &server));
587+ std::future<void> future = std::async(std::launch::async, std::bind(&mir::DisplayServer::run, &server));
588
589 config.exec(&server);
590+
591+ future.wait();
592 }
593
594 config.on_exit(&server);
595
596=== modified file 'tests/unit-tests/geometry/test-displacement.cpp'
597--- tests/unit-tests/geometry/test-displacement.cpp 2012-09-18 12:09:56 +0000
598+++ tests/unit-tests/geometry/test-displacement.cpp 2013-03-19 03:25:26 +0000
599@@ -26,7 +26,7 @@
600 TEST(geometry, displacement)
601 {
602 using namespace geom;
603- Displacement const disp;
604+ Displacement disp;
605 Displacement const dx2dy4{DeltaX{2}, DeltaY{4}};
606
607 EXPECT_EQ(DeltaX{0}, disp.dx);
608
609=== modified file 'tests/unit-tests/geometry/test-point.cpp'
610--- tests/unit-tests/geometry/test-point.cpp 2012-09-18 10:35:52 +0000
611+++ tests/unit-tests/geometry/test-point.cpp 2013-03-19 03:25:26 +0000
612@@ -36,7 +36,7 @@
613 EXPECT_EQ(Y(4), copy.y);
614 EXPECT_EQ(pointx2y4, copy);
615
616- Point const defaultValue;
617+ Point defaultValue;
618 EXPECT_EQ(X(0), defaultValue.x);
619 EXPECT_EQ(Y(0), defaultValue.y);
620 EXPECT_NE(pointx2y4, defaultValue);
621
622=== modified file 'tests/unit-tests/geometry/test-rectangle.cpp'
623--- tests/unit-tests/geometry/test-rectangle.cpp 2012-09-18 12:26:17 +0000
624+++ tests/unit-tests/geometry/test-rectangle.cpp 2013-03-19 03:25:26 +0000
625@@ -38,7 +38,7 @@
626 EXPECT_EQ(w2h4, copy.size);
627 EXPECT_EQ(rect, copy);
628
629- Rectangle const default_rect;
630+ Rectangle default_rect;
631 EXPECT_EQ(Point(), default_rect.top_left);
632 EXPECT_EQ(Size(), default_rect.size);
633 EXPECT_NE(rect, default_rect);
634
635=== modified file 'tests/unit-tests/graphics/gbm/mock_gbm.h'
636--- tests/unit-tests/graphics/gbm/mock_gbm.h 2013-01-31 09:56:11 +0000
637+++ tests/unit-tests/graphics/gbm/mock_gbm.h 2013-03-19 03:25:26 +0000
638@@ -22,7 +22,7 @@
639 #include <gmock/gmock.h>
640
641 #pragma GCC diagnostic push
642-#pragma GCC diagnostic ignored "-pedantic" // Ignore bad syntax in gbm.h
643+#pragma GCC diagnostic warning "-Wall"
644 #include <gbm.h>
645 #pragma GCC diagnostic pop
646

Subscribers

People subscribed via source and target branches