Mir

Merge lp:~kdub/mir/fix-1220443 into lp:mir

Proposed by Kevin DuBois
Status: Merged
Approved by: Kevin DuBois
Approved revision: no longer in the source branch.
Merged at revision: 1093
Proposed branch: lp:~kdub/mir/fix-1220443
Merge into: lp:mir
Diff against target: 988 lines (+361/-119)
18 files modified
include/test/mir_test_framework/display_server_test_fixture.h (+2/-0)
include/test/mir_test_framework/stub_client_connection_configuration.h (+35/-0)
include/test/mir_test_framework/testing_client_configuration.h (+43/-0)
include/test/mir_test_framework/testing_process_manager.h (+7/-8)
src/client/mir_client_library.cpp (+39/-17)
tests/acceptance-tests/test_client_authorization.cpp (+7/-0)
tests/acceptance-tests/test_client_focus_notification.cpp (+2/-9)
tests/acceptance-tests/test_client_input.cpp (+8/-15)
tests/acceptance-tests/test_client_library.cpp (+30/-17)
tests/acceptance-tests/test_focus_selection.cpp (+2/-9)
tests/acceptance-tests/test_server_shutdown.cpp (+2/-9)
tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp (+2/-9)
tests/acceptance-tests/test_surfaceloop.cpp (+3/-10)
tests/acceptance-tests/test_surfaces_with_output_id.cpp (+2/-9)
tests/mir_test_framework/CMakeLists.txt (+1/-0)
tests/mir_test_framework/display_server_test_fixture.cpp (+9/-6)
tests/mir_test_framework/testing_client_options.cpp (+126/-0)
tests/mir_test_framework/testing_process_manager.cpp (+41/-1)
To merge this branch: bzr merge lp:~kdub/mir/fix-1220443
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alan Griffiths Approve
Daniel van Vugt Pending
Robert Carr Pending
Review via email: mp+187348@code.launchpad.net

This proposal supersedes a proposal from 2013-09-05.

Commit message

fix: lp:1220443

let the test framework to inject stub graphics platforms on the client side during acceptance and integration tests

Description of the change

fix: lp:1220443

let the test framework to inject stub graphics platforms on the client side during acceptance and integration tests

see bug comment for what was happening: https://bugs.launchpad.net/mir/+bug/1220443/comments/3

nb. fix addresses 1220443, but tests-use-real-graphics is still problematic when turned on (https://bugs.launchpad.net/mir/+bug/1221373)

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: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

mir_client_library_debug.h: Incorrect capitalization and punctuation.

mir_connection_factory.h: Incorrect date.

They're not blockers, but should be fixed. I haven't stopped long enough to consider the overall approach however, so abstain for now.

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

Defining MirConnectionFactory in a private header makes publishing mir_global_connection_factory via the debug API pointless - it is unusable.

Initializing mir_global_connection_factory to point to a default would avoid tests for NULL (should be nullptr).

But a better approach would be to publish a function pointer with the same signature as mir_connect() and have mir_connect() forward to whatever it points at. This pointer should default to a renamed copy of the current implementation.

This would allow clients to intercept the call and optionally call the default implementation (or, in test cases, restore the pointer to use).

review: Needs Fixing
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
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

I'm not sure that exposing the client API as something a client can *modify* is a good idea...

11 +extern MirWaitHandle* (*mir_connect_impl)(
12 + char const *server,
13 + char const *app_name,
14 + mir_connected_callback callback,
15 + void *context);

If nothing else, it's inconsistent to only allow this on one function. Normally you would use LD_PRELOAD (man ld.so) to achieve this.

Also, still... mir_client_library_debug.h: Incorrect capitalization and punctuation.

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

> I'm not sure that exposing the client API as something a client can *modify*
> is a good idea...

The key question is: is this needed as part of the debug API, or is it a facility for test code that should be internal to the implementation?

If the former, then we should probably providing a mechanism for intercepting the whole API atomically, not a single functions.

*Needs discussion*

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

I think its more of a test code facility, so perhaps it should be moved out of the debug header.
Since running with stubbed drivers is the default, I'm not a fan of recommending the use of LD_PRELOAD to anyone who wants to run the android test suite.

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

You should be able to do the equivalent of LD_PRELOAD without using the environment variable, maybe? The linker should allow you to, somehow. But I don't have an answer to hand so won't block on it.

Regarding test vs debug code, yeah... Maybe it would be a good idea to not mention the trampoline pointer (mir_connect_impl) in any header at all. Just extern it manually when you need it. That would be better hidden.

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

Verified bug 1220443 is fixed.

We can argue over the details later.

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

switched to a more hidden extern (was a good idea) so no public-facing headers mention the override. Added a TODO to make a more comprehensive solution to stubbing client functions out

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

I don't like adding implementation to the TestingClientConfiguration interface. The test framework still only uses the exec() function.

Rather than having the tests call functions to change use of connect functions I'd rather see them using an alternative DefaultTestingClientConfiguration/DummyGraphicsTestingClientConfiguration.

I'm not sure that sharing a single TestingServerConfiguration across all tests is a good idea. It shouldn't be a problem (as it is only used in the separate server processes) but it introduces potential for state to leak from one test to another.

review: Needs Fixing
Revision history for this message
Robert Carr (robertcarr) wrote : Posted in a previous version of this proposal

It looks ok. I think overriding mir_connect is pretty counterintuitive to me though. I wonder if this calls for a 'mir_init' type function which can handle command line arguments, environment, etc, in order to set up client configuration.

Revision history for this message
Robert Carr (robertcarr) : Posted in a previous version of this proposal
review: Abstain
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1064
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~kdub/mir/fix-1220443/+merge/187348/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/mir-team-mir-development-branch-ci/6/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-android-saucy-i386-build/2107
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-clang-saucy-amd64-build/1992
    FAILURE: http://jenkins.qa.ubuntu.com/job/mir-team-mir-development-branch-saucy-amd64-ci/6/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/mir-team-mir-development-branch-ci/6/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

apparently resubmitting a mp resets the commit message...

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

58 === added file 'include/test/mir_test_framework/testing_client_configuration.h'
...
97 +struct StubConnectionConfiguration : public mir::client::DefaultConnectionConfiguration
98 +{
99 + StubConnectionConfiguration(std::string const& socket_file);
100 + std::shared_ptr<mir::client::ClientPlatformFactory> the_client_platform_factory() override;
101 +};

An odd file in which to add StubConnectionConfiguration

~~~~

105 + TestingClientConfiguration() {}

Already provided by default

~~~~

106 + virtual ~TestingClientConfiguration() {}

Why allow throwing destructors?

~~~~

335 +DefaultDisplayServerTestFixture::DefaultDisplayServerTestFixture()
336 +{
337 + default_mir_connect_impl = mir_connect_impl;
338 + default_mir_connection_release_impl = mir_connection_release_impl;
339 +
340 + auto options = default_parameters.the_options();
341 + if (!options->get("tests-use-real-graphics", false))
342 + {
343 + mir_connect_impl = mir_connect_test_override;
344 + mir_connection_release_impl = mir_connection_release_override;
345 + }
346 +}

This seems to be happening in the wrong place. The text fixture is created in the test process before forking either the server or the client(s) and therefore this override is applied in all processes.

I'd expect to see this logic invoked* in TestingProcessManager::launch_client_process() - in the path that executes in the client process. (It would then apply equally to the BespokeDisplayServerTestFixture - which, in this MP applies the logic differently for reasons that are not immediately obvious.)

* Adding a virtual bool use_real_graphics() const to TestingClientConfiguration allows the client code to control this by choosing a suitable TestingClientConfiguration implementation instead of the various calls to use_default_connect_functions();

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

@alan, thanks for the review, good ideas. Code looks much cleaner, function pointers are only overwritten in the client's process. Test code can force a certain behavior by overriding use_real_graphics() in the TestingClientConfiguration, but by default, the code will respect the option

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

also removed the macro that disabled the tests (except the nested tests)

[==========] 50 tests from 7 test cases ran. (6167 ms total)
[ PASSED ] 50 tests.

  YOU HAVE 4 DISABLED TESTS

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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 :

778 + process_manager.launch_client_process(config, *server_options);

Probably just the name, but why are we passing *server* options to the client?

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

> 778 + process_manager.launch_client_process(config, *server_options);
>
> Probably just the name, but why are we passing *server* options to the client?

right, they are 'test_case_options', but just most of them happen to apply to the server. Will change

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
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
1=== modified file 'include/test/mir_test_framework/display_server_test_fixture.h'
2--- include/test/mir_test_framework/display_server_test_fixture.h 2013-08-28 03:41:48 +0000
3+++ include/test/mir_test_framework/display_server_test_fixture.h 2013-09-26 15:08:46 +0000
4@@ -46,6 +46,7 @@
5
6 private:
7 static TestingProcessManager process_manager;
8+ static TestingServerConfiguration default_parameters;
9
10 virtual void TearDown();
11 };
12@@ -74,6 +75,7 @@
13
14 private:
15 TestingProcessManager process_manager;
16+ std::shared_ptr<mir::options::Option> test_options;
17 };
18
19 }
20
21=== added file 'include/test/mir_test_framework/stub_client_connection_configuration.h'
22--- include/test/mir_test_framework/stub_client_connection_configuration.h 1970-01-01 00:00:00 +0000
23+++ include/test/mir_test_framework/stub_client_connection_configuration.h 2013-09-26 15:08:46 +0000
24@@ -0,0 +1,35 @@
25+/*
26+ * Copyright © 2013 Canonical Ltd.
27+ *
28+ * This program is free software: you can redistribute it and/or modify it
29+ * under the terms of the GNU General Public License version 3,
30+ * as published by the Free Software Foundation.
31+ *
32+ * This program is distributed in the hope that it will be useful,
33+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
34+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35+ * GNU General Public License for more details.
36+ *
37+ * You should have received a copy of the GNU General Public License
38+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
39+ *
40+ * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
41+ */
42+
43+#ifndef MIR_TESTING_STUB_CLIENT_CONNECTION_CONFIGURATION
44+#define MIR_TESTING_STUB_CLIENT_CONNECTION_CONFIGURATION
45+
46+#include "src/client/default_connection_configuration.h"
47+#include <memory>
48+
49+namespace mir_test_framework
50+{
51+
52+struct StubConnectionConfiguration : public mir::client::DefaultConnectionConfiguration
53+{
54+ StubConnectionConfiguration(std::string const& socket_file);
55+ std::shared_ptr<mir::client::ClientPlatformFactory> the_client_platform_factory() override;
56+};
57+
58+}
59+#endif /* MIR_TESTING_STUB_CLIENT_CONNECTION_CONFIGURATION */
60
61=== added file 'include/test/mir_test_framework/testing_client_configuration.h'
62--- include/test/mir_test_framework/testing_client_configuration.h 1970-01-01 00:00:00 +0000
63+++ include/test/mir_test_framework/testing_client_configuration.h 2013-09-26 15:08:46 +0000
64@@ -0,0 +1,43 @@
65+/*
66+ * Copyright © 2013 Canonical Ltd.
67+ *
68+ * This program is free software: you can redistribute it and/or modify it
69+ * under the terms of the GNU General Public License version 3,
70+ * as published by the Free Software Foundation.
71+ *
72+ * This program is distributed in the hope that it will be useful,
73+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
74+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
75+ * GNU General Public License for more details.
76+ *
77+ * You should have received a copy of the GNU General Public License
78+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
79+ *
80+ * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
81+ */
82+
83+#ifndef MIR_TESTING_CLIENT_CONFIGURATION
84+#define MIR_TESTING_CLIENT_CONFIGURATION
85+
86+#include "mir/options/option.h"
87+
88+namespace mir_test_framework
89+{
90+
91+struct TestingClientConfiguration
92+{
93+ virtual ~TestingClientConfiguration() = default;
94+
95+ // Code to run in client process
96+ virtual void exec() = 0;
97+
98+ //clients respect the tests-use-real-graphics option by default. use
99+ //this function to force the use of the default client configuraiton
100+ virtual bool use_real_graphics(mir::options::Option const& options)
101+ {
102+ return options.get("tests-use-real-graphics", false);
103+ }
104+};
105+
106+}
107+#endif /* MIR_TESTING_CLIENT_CONFIGURATION */
108
109=== modified file 'include/test/mir_test_framework/testing_process_manager.h'
110--- include/test/mir_test_framework/testing_process_manager.h 2013-08-28 03:41:48 +0000
111+++ include/test/mir_test_framework/testing_process_manager.h 2013-09-26 15:08:46 +0000
112@@ -24,6 +24,7 @@
113 #include "mir_test_framework/process.h"
114
115 #include "mir_test_framework/testing_server_configuration.h"
116+#include "mir_test_framework/testing_client_configuration.h"
117
118 #include <memory>
119 #include <list>
120@@ -32,19 +33,16 @@
121 namespace mir
122 {
123 class DisplayServer;
124+namespace options
125+{
126+class Option;
127+}
128 }
129
130 namespace mir_test_framework
131 {
132 using namespace mir;
133
134-struct TestingClientConfiguration
135-{
136- virtual ~TestingClientConfiguration() = default;
137- // Code to run in client process
138- virtual void exec() = 0;
139-};
140-
141
142 class TestingProcessManager
143 {
144@@ -53,7 +51,8 @@
145 ~TestingProcessManager();
146
147 void launch_server_process(TestingServerConfiguration& config);
148- void launch_client_process(TestingClientConfiguration& config);
149+ void launch_client_process(TestingClientConfiguration& config,
150+ mir::options::Option const& test_options);
151
152 void tear_down_clients();
153 void tear_down_server();
154
155=== modified file 'src/client/mir_client_library.cpp'
156--- src/client/mir_client_library.cpp 2013-08-28 03:41:48 +0000
157+++ src/client/mir_client_library.cpp 2013-09-26 15:08:46 +0000
158@@ -77,7 +77,8 @@
159
160 }
161
162-MirWaitHandle* mir_connect(char const* socket_file, char const* name, mir_connected_callback callback, void * context)
163+MirWaitHandle* mir_default_connect(
164+ char const* socket_file, char const* name, mir_connected_callback callback, void * context)
165 {
166
167 try
168@@ -93,7 +94,7 @@
169 else
170 sock = mir::default_server_socket;
171 }
172-
173+
174 mcl::DefaultConnectionConfiguration conf{sock};
175
176 MirConnection* connection = new MirConnection(conf);
177@@ -110,6 +111,42 @@
178 }
179 }
180
181+
182+void mir_default_connection_release(MirConnection * connection)
183+{
184+ if (!error_connections.contains(connection))
185+ {
186+ auto wait_handle = connection->disconnect();
187+ wait_handle->wait_for_all();
188+ }
189+ else
190+ {
191+ error_connections.remove(connection);
192+ }
193+
194+ delete connection;
195+}
196+
197+//mir_connect and mir_connection_release can be overridden by test code that sets these function
198+//pointers to do things like stub out the graphics drivers or change the connection configuration.
199+
200+//TODO: we could have a more comprehensive solution that allows us to substitute any of the functions
201+//for test purposes, not just the connect functions
202+MirWaitHandle* (*mir_connect_impl)(
203+ char const *server, char const *app_name,
204+ mir_connected_callback callback, void *context) = mir_default_connect;
205+void (*mir_connection_release_impl) (MirConnection *connection) = mir_default_connection_release;
206+
207+MirWaitHandle* mir_connect(char const* socket_file, char const* name, mir_connected_callback callback, void * context)
208+{
209+ return mir_connect_impl(socket_file, name, callback, context);
210+}
211+
212+void mir_connection_release(MirConnection *connection)
213+{
214+ return mir_connection_release_impl(connection);
215+}
216+
217 MirConnection *mir_connect_sync(char const *server,
218 char const *app_name)
219 {
220@@ -131,21 +168,6 @@
221 return connection->get_error_message();
222 }
223
224-void mir_connection_release(MirConnection * connection)
225-{
226- if (!error_connections.contains(connection))
227- {
228- auto wait_handle = connection->disconnect();
229- wait_handle->wait_for_all();
230- }
231- else
232- {
233- error_connections.remove(connection);
234- }
235-
236- delete connection;
237-}
238-
239 MirEGLNativeDisplayType mir_connection_get_egl_native_display(MirConnection *connection)
240 {
241 return connection->egl_native_display();
242
243=== modified file 'tests/acceptance-tests/test_client_authorization.cpp'
244--- tests/acceptance-tests/test_client_authorization.cpp 2013-08-28 03:41:48 +0000
245+++ tests/acceptance-tests/test_client_authorization.cpp 2013-09-26 15:08:46 +0000
246@@ -253,6 +253,13 @@
247 mir_connection_release(connection);
248 }
249
250+ //we are testing the connect function itself, without getting to the
251+ // point where drivers are used, so force using production config
252+ bool use_real_graphics(mir::options::Option const&) override
253+ {
254+ return true;
255+ }
256+
257 ClientPidTestFixture::SharedRegion* shared_region;
258 } client_config(shared_region);
259 launch_client_process(client_config);
260
261=== modified file 'tests/acceptance-tests/test_client_focus_notification.cpp'
262--- tests/acceptance-tests/test_client_focus_notification.cpp 2013-09-17 14:31:42 +0000
263+++ tests/acceptance-tests/test_client_focus_notification.cpp 2013-09-26 15:08:46 +0000
264@@ -30,13 +30,6 @@
265 namespace mt = mir::test;
266 namespace mtf = mir_test_framework;
267
268-// TODO resolve problems running tests on android
269-#ifdef ANDROID
270-#define DISABLED_ON_ANDROID(name) DISABLED_##name
271-#else
272-#define DISABLED_ON_ANDROID(name) name
273-#endif
274-
275 namespace
276 {
277 char const* const mir_test_socket = mtf::test_socket_file().c_str();
278@@ -147,7 +140,7 @@
279
280 }
281
282-TEST_F(BespokeDisplayServerTestFixture, DISABLED_ON_ANDROID(a_surface_is_notified_of_receiving_focus))
283+TEST_F(BespokeDisplayServerTestFixture, a_surface_is_notified_of_receiving_focus)
284 {
285 using namespace ::testing;
286
287@@ -176,7 +169,7 @@
288
289 }
290
291-TEST_F(BespokeDisplayServerTestFixture, DISABLED_ON_ANDROID(two_surfaces_are_notified_of_gaining_and_losing_focus))
292+TEST_F(BespokeDisplayServerTestFixture, two_surfaces_are_notified_of_gaining_and_losing_focus)
293 {
294 using namespace ::testing;
295
296
297=== modified file 'tests/acceptance-tests/test_client_input.cpp'
298--- tests/acceptance-tests/test_client_input.cpp 2013-09-20 15:48:40 +0000
299+++ tests/acceptance-tests/test_client_input.cpp 2013-09-26 15:08:46 +0000
300@@ -63,13 +63,6 @@
301 namespace mtd = mt::doubles;
302 namespace mtf = mir_test_framework;
303
304-// TODO resolve problems running tests on android
305-#ifdef ANDROID
306-#define DISABLED_ON_ANDROID(name) DISABLED_##name
307-#else
308-#define DISABLED_ON_ANDROID(name) name
309-#endif
310-
311 namespace
312 {
313 char const* const mir_test_socket = mtf::test_socket_file().c_str();
314@@ -312,7 +305,7 @@
315
316 using TestClientInput = BespokeDisplayServerTestFixture;
317
318-TEST_F(TestClientInput, DISABLED_ON_ANDROID(clients_receive_key_input))
319+TEST_F(TestClientInput, clients_receive_key_input)
320 {
321 using namespace ::testing;
322
323@@ -358,7 +351,7 @@
324 launch_client_process(client_config);
325 }
326
327-TEST_F(TestClientInput, DISABLED_ON_ANDROID(clients_receive_us_english_mapped_keys))
328+TEST_F(TestClientInput, clients_receive_us_english_mapped_keys)
329 {
330 using namespace ::testing;
331 static std::string const test_client_name = "1";
332@@ -404,7 +397,7 @@
333 launch_client_process(client_config);
334 }
335
336-TEST_F(TestClientInput, DISABLED_ON_ANDROID(clients_receive_motion_inside_window))
337+TEST_F(TestClientInput, clients_receive_motion_inside_window)
338 {
339 using namespace ::testing;
340 static std::string const test_client_name = "1";
341@@ -453,7 +446,7 @@
342 launch_client_process(client_config);
343 }
344
345-TEST_F(TestClientInput, DISABLED_ON_ANDROID(clients_receive_button_events_inside_window))
346+TEST_F(TestClientInput, clients_receive_button_events_inside_window)
347 {
348 using namespace ::testing;
349
350@@ -534,7 +527,7 @@
351
352 }
353
354-TEST_F(TestClientInput, DISABLED_ON_ANDROID(multiple_clients_receive_motion_inside_windows))
355+TEST_F(TestClientInput, multiple_clients_receive_motion_inside_windows)
356 {
357 using namespace ::testing;
358
359@@ -646,7 +639,7 @@
360 std::vector<geom::Rectangle> const input_rectangles;
361 };
362 }
363-TEST_F(TestClientInput, DISABLED_ON_ANDROID(clients_do_not_receive_motion_outside_input_region))
364+TEST_F(TestClientInput, clients_do_not_receive_motion_outside_input_region)
365 {
366 using namespace ::testing;
367 static std::string const test_client_name = "1";
368@@ -735,7 +728,7 @@
369 launch_client_process(client_config);
370 }
371
372-TEST_F(TestClientInput, DISABLED_ON_ANDROID(surfaces_obscure_motion_events_by_stacking))
373+TEST_F(TestClientInput, surfaces_obscure_motion_events_by_stacking)
374 {
375 using namespace ::testing;
376
377@@ -853,7 +846,7 @@
378
379 }
380
381-TEST_F(TestClientInput, DISABLED_ON_ANDROID(hidden_clients_do_not_receive_pointer_events))
382+TEST_F(TestClientInput, hidden_clients_do_not_receive_pointer_events)
383 {
384 using namespace ::testing;
385
386
387=== modified file 'tests/acceptance-tests/test_client_library.cpp'
388--- tests/acceptance-tests/test_client_library.cpp 2013-09-24 11:07:53 +0000
389+++ tests/acceptance-tests/test_client_library.cpp 2013-09-26 15:08:46 +0000
390@@ -42,13 +42,6 @@
391 namespace mcl = mir::client;
392 namespace mtf = mir_test_framework;
393
394-// TODO resolve problems running tests on android
395-#ifdef ANDROID
396-#define DISABLED_ON_ANDROID(name) DISABLED_##name
397-#else
398-#define DISABLED_ON_ANDROID(name) name
399-#endif
400-
401 namespace
402 {
403 char const* const mir_test_socket = mtf::test_socket_file().c_str();
404@@ -157,7 +150,7 @@
405 launch_client_process(client_config);
406 }
407
408-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(client_library_creates_surface))
409+TEST_F(DefaultDisplayServerTestFixture, client_library_creates_surface)
410 {
411 struct ClientConfig : ClientConfigCommon
412 {
413@@ -220,7 +213,7 @@
414 launch_client_process(client_config);
415 }
416
417-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(surface_types))
418+TEST_F(DefaultDisplayServerTestFixture, surface_types)
419 {
420 struct ClientConfig : ClientConfigCommon
421 {
422@@ -295,7 +288,7 @@
423 launch_client_process(client_config);
424 }
425
426-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(client_can_set_surface_state))
427+TEST_F(DefaultDisplayServerTestFixture, client_can_set_surface_state)
428 {
429 struct ClientConfig : ClientConfigCommon
430 {
431@@ -363,7 +356,7 @@
432 launch_client_process(client_config);
433 }
434
435-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(client_receives_surface_state_events))
436+TEST_F(DefaultDisplayServerTestFixture, client_receives_surface_state_events)
437 {
438 struct ClientConfig : ClientConfigCommon
439 {
440@@ -528,13 +521,19 @@
441
442 mir_connection_release(connection);
443 }
444+
445+ // this test relies on gbm drivers, use real graphics always
446+ bool use_real_graphics(mir::options::Option const&) override
447+ {
448+ return true;
449+ }
450 } client_config;
451
452 launch_client_process(client_config);
453 }
454 #endif
455
456-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(client_library_creates_multiple_surfaces))
457+TEST_F(DefaultDisplayServerTestFixture, client_library_creates_multiple_surfaces)
458 {
459 int const n_surfaces = 13;
460
461@@ -612,7 +611,7 @@
462 launch_client_process(client_config);
463 }
464
465-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(client_library_accesses_and_advances_buffers))
466+TEST_F(DefaultDisplayServerTestFixture, client_library_accesses_and_advances_buffers)
467 {
468 struct ClientConfig : ClientConfigCommon
469 {
470@@ -652,7 +651,7 @@
471 launch_client_process(client_config);
472 }
473
474-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(fully_synchronous_client))
475+TEST_F(DefaultDisplayServerTestFixture, fully_synchronous_client)
476 {
477 struct ClientConfig : ClientConfigCommon
478 {
479@@ -694,7 +693,7 @@
480 launch_client_process(client_config);
481 }
482
483-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(highly_threaded_client))
484+TEST_F(DefaultDisplayServerTestFixture, highly_threaded_client)
485 {
486 struct ClientConfig : ClientConfigCommon
487 {
488@@ -838,6 +837,13 @@
489 FAIL() << error;
490 }
491 }
492+
493+ //we are testing the connect function itself, without getting to the
494+ // point where drivers are used, so force using production config
495+ bool use_real_graphics(mir::options::Option const&) override
496+ {
497+ return true;
498+ }
499 } client_config;
500
501 launch_client_process(client_config);
502@@ -867,6 +873,13 @@
503
504 mir_connection_release(connection);
505 }
506+
507+ //we are testing the connect function itself, without getting to the
508+ // point where drivers are used, so force using production config
509+ bool use_real_graphics(mir::options::Option const&) override
510+ {
511+ return true;
512+ }
513 } client_config;
514
515 launch_client_process(client_config);
516@@ -878,7 +891,7 @@
517 signalled = true;
518 }
519
520-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(ClientLibraryThreadsHandleNoSignals))
521+TEST_F(DefaultDisplayServerTestFixture, ClientLibraryThreadsHandleNoSignals)
522 {
523 struct ClientConfig : ClientConfigCommon
524 {
525@@ -961,7 +974,7 @@
526 launch_client_process(client_config);
527 }
528
529-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(MultiSurfaceClientTracksBufferFdsCorrectly))
530+TEST_F(DefaultDisplayServerTestFixture, MultiSurfaceClientTracksBufferFdsCorrectly)
531 {
532 struct ClientConfig : ClientConfigCommon
533 {
534
535=== modified file 'tests/acceptance-tests/test_focus_selection.cpp'
536--- tests/acceptance-tests/test_focus_selection.cpp 2013-09-17 14:31:42 +0000
537+++ tests/acceptance-tests/test_focus_selection.cpp 2013-09-26 15:08:46 +0000
538@@ -41,13 +41,6 @@
539 namespace mt = mir::test;
540 namespace mtf = mir_test_framework;
541
542-// TODO resolve problems running tests on android
543-#ifdef ANDROID
544-#define DISABLED_ON_ANDROID(name) DISABLED_##name
545-#else
546-#define DISABLED_ON_ANDROID(name) name
547-#endif
548-
549 namespace
550 {
551 char const* const mir_test_socket = mtf::test_socket_file().c_str();
552@@ -134,7 +127,7 @@
553 }
554 }
555
556-TEST_F(BespokeDisplayServerTestFixture, DISABLED_ON_ANDROID(sessions_creating_surface_receive_focus))
557+TEST_F(BespokeDisplayServerTestFixture, sessions_creating_surface_receive_focus)
558 {
559 struct ServerConfig : TestingServerConfiguration
560 {
561@@ -168,7 +161,7 @@
562 launch_client_process(client);
563 }
564
565-TEST_F(BespokeDisplayServerTestFixture, DISABLED_ON_ANDROID(surfaces_receive_input_focus_when_created))
566+TEST_F(BespokeDisplayServerTestFixture, surfaces_receive_input_focus_when_created)
567 {
568 struct ServerConfig : TestingServerConfiguration
569 {
570
571=== modified file 'tests/acceptance-tests/test_server_shutdown.cpp'
572--- tests/acceptance-tests/test_server_shutdown.cpp 2013-09-24 11:43:27 +0000
573+++ tests/acceptance-tests/test_server_shutdown.cpp 2013-09-26 15:08:46 +0000
574@@ -39,13 +39,6 @@
575 namespace ms = mir::surfaces;
576 namespace geom = mir::geometry;
577
578-// TODO resolve problems running tests on android
579-#ifdef ANDROID
580-#define DISABLED_ON_ANDROID(name) DISABLED_##name
581-#else
582-#define DISABLED_ON_ANDROID(name) name
583-#endif
584-
585 namespace
586 {
587
588@@ -119,7 +112,7 @@
589
590 }
591
592-TEST_F(BespokeDisplayServerTestFixture, DISABLED_ON_ANDROID(server_can_shut_down_when_clients_are_blocked))
593+TEST_F(BespokeDisplayServerTestFixture, server_can_shut_down_when_clients_are_blocked)
594 {
595 Flag next_buffer_done1{"next_buffer_done1_c5d49978.tmp"};
596 Flag next_buffer_done2{"next_buffer_done2_c5d49978.tmp"};
597@@ -206,7 +199,7 @@
598 });
599 }
600
601-TEST_F(BespokeDisplayServerTestFixture, DISABLED_ON_ANDROID(server_releases_resources_on_shutdown_with_connected_clients))
602+TEST_F(BespokeDisplayServerTestFixture, server_releases_resources_on_shutdown_with_connected_clients)
603 {
604 Flag surface_created1{"surface_created1_7e9c69fc.tmp"};
605 Flag surface_created2{"surface_created2_7e9c69fc.tmp"};
606
607=== modified file 'tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp'
608--- tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp 2013-09-17 14:31:42 +0000
609+++ tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp 2013-09-26 15:08:46 +0000
610@@ -34,13 +34,6 @@
611 namespace mtd = mt::doubles;
612 namespace mtf = mir_test_framework;
613
614-// TODO resolve problems running tests on android
615-#ifdef ANDROID
616-#define DISABLED_ON_ANDROID(name) DISABLED_##name
617-#else
618-#define DISABLED_ON_ANDROID(name) name
619-#endif
620-
621 namespace
622 {
623 char const* const mir_test_socket = mtf::test_socket_file().c_str();
624@@ -77,7 +70,7 @@
625
626 }
627
628-TEST_F(BespokeDisplayServerTestFixture, DISABLED_ON_ANDROID(the_shell_surface_configurator_is_notified_of_attribute_changes))
629+TEST_F(BespokeDisplayServerTestFixture, the_shell_surface_configurator_is_notified_of_attribute_changes)
630 {
631 struct ServerConfiguration : TestingServerConfiguration
632 {
633@@ -116,7 +109,7 @@
634 launch_client_process(client_config);
635 }
636
637-TEST_F(BespokeDisplayServerTestFixture, DISABLED_ON_ANDROID(the_shell_surface_configurator_may_interfere_with_attribute_changes))
638+TEST_F(BespokeDisplayServerTestFixture, the_shell_surface_configurator_may_interfere_with_attribute_changes)
639 {
640 struct ServerConfiguration : TestingServerConfiguration
641 {
642
643=== modified file 'tests/acceptance-tests/test_surfaceloop.cpp'
644--- tests/acceptance-tests/test_surfaceloop.cpp 2013-09-17 14:31:42 +0000
645+++ tests/acceptance-tests/test_surfaceloop.cpp 2013-09-26 15:08:46 +0000
646@@ -36,13 +36,6 @@
647 namespace mcl = mir::client;
648 namespace mtf = mir_test_framework;
649
650-// TODO resolve problems running tests on android
651-#ifdef ANDROID
652-#define DISABLED_ON_ANDROID(name) DISABLED_##name
653-#else
654-#define DISABLED_ON_ANDROID(name) name
655-#endif
656-
657 namespace
658 {
659 char const* const mir_test_socket = mtf::test_socket_file().c_str();
660@@ -161,7 +154,7 @@
661 }
662 }
663
664-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(creates_surface_of_correct_size))
665+TEST_F(DefaultDisplayServerTestFixture, creates_surface_of_correct_size)
666 {
667 struct Client : ClientConfigCommon
668 {
669@@ -215,7 +208,7 @@
670 launch_client_process(client_creates_surfaces);
671 }
672
673-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(surfaces_have_distinct_ids))
674+TEST_F(DefaultDisplayServerTestFixture, surfaces_have_distinct_ids)
675 {
676 struct Client : ClientConfigCommon
677 {
678@@ -260,7 +253,7 @@
679 launch_client_process(client_creates_surfaces);
680 }
681
682-TEST_F(DefaultDisplayServerTestFixture, DISABLED_ON_ANDROID(creates_multiple_surfaces_async))
683+TEST_F(DefaultDisplayServerTestFixture, creates_multiple_surfaces_async)
684 {
685 struct Client : ClientConfigCommon
686 {
687
688=== modified file 'tests/acceptance-tests/test_surfaces_with_output_id.cpp'
689--- tests/acceptance-tests/test_surfaces_with_output_id.cpp 2013-09-17 14:31:42 +0000
690+++ tests/acceptance-tests/test_surfaces_with_output_id.cpp 2013-09-26 15:08:46 +0000
691@@ -43,13 +43,6 @@
692 namespace mg = mir::graphics;
693 namespace mtd = mir::test::doubles;
694
695-// TODO resolve problems running tests on android
696-#ifdef ANDROID
697-#define DISABLED_ON_ANDROID(name) DISABLED_##name
698-#else
699-#define DISABLED_ON_ANDROID(name) name
700-#endif
701-
702 namespace
703 {
704 char const* const mir_test_socket = mtf::test_socket_file().c_str();
705@@ -128,7 +121,7 @@
706
707 using SurfacesWithOutputId = BespokeDisplayServerTestFixture;
708
709-TEST_F(SurfacesWithOutputId, DISABLED_ON_ANDROID(fullscreen_surfaces_are_placed_at_top_left_of_correct_output))
710+TEST_F(SurfacesWithOutputId, fullscreen_surfaces_are_placed_at_top_left_of_correct_output)
711 {
712 mt::CrossProcessAction client_connect_and_create_surface;
713 mt::CrossProcessAction client_release_surface_and_disconnect;
714@@ -266,7 +259,7 @@
715 });
716 }
717
718-TEST_F(SurfacesWithOutputId, DISABLED_ON_ANDROID(non_fullscreen_surfaces_are_not_accepted))
719+TEST_F(SurfacesWithOutputId, non_fullscreen_surfaces_are_not_accepted)
720 {
721 mt::CrossProcessAction client_connect_and_create_surfaces;
722 mt::CrossProcessAction client_disconnect;
723
724=== modified file 'tests/mir_test_framework/CMakeLists.txt'
725--- tests/mir_test_framework/CMakeLists.txt 2013-08-28 03:41:48 +0000
726+++ tests/mir_test_framework/CMakeLists.txt 2013-09-26 15:08:46 +0000
727@@ -13,6 +13,7 @@
728 testing_server_options.cpp
729 input_testing_server_options.cpp
730 testing_process_manager.cpp
731+ testing_client_options.cpp
732 display_server_test_fixture.cpp
733 process.cpp
734 )
735
736=== modified file 'tests/mir_test_framework/display_server_test_fixture.cpp'
737--- tests/mir_test_framework/display_server_test_fixture.cpp 2013-08-28 03:41:48 +0000
738+++ tests/mir_test_framework/display_server_test_fixture.cpp 2013-09-26 15:08:46 +0000
739@@ -17,20 +17,22 @@
740 */
741
742 #include "mir_test_framework/display_server_test_fixture.h"
743+#include "mir_test_framework/testing_client_configuration.h"
744+#include "src/client/mir_connection.h"
745
746 namespace mc = mir::compositor;
747-
748-mir_test_framework::TestingProcessManager mir_test_framework::DefaultDisplayServerTestFixture::process_manager;
749-
750+namespace mtf = mir_test_framework;
751+
752+mtf::TestingProcessManager mir_test_framework::DefaultDisplayServerTestFixture::process_manager;
753+mtf::TestingServerConfiguration mir_test_framework::DefaultDisplayServerTestFixture::default_parameters;
754
755 void DefaultDisplayServerTestFixture::launch_client_process(TestingClientConfiguration& config)
756 {
757- process_manager.launch_client_process(config);
758+ process_manager.launch_client_process(config, *default_parameters.the_options());
759 }
760
761 void DefaultDisplayServerTestFixture::SetUpTestCase()
762 {
763- TestingServerConfiguration default_parameters;
764 process_manager.launch_server_process(default_parameters);
765 }
766
767@@ -54,12 +56,13 @@
768
769 void BespokeDisplayServerTestFixture::launch_server_process(TestingServerConfiguration& functor)
770 {
771+ test_options = functor.the_options();
772 process_manager.launch_server_process(functor);
773 }
774
775 void BespokeDisplayServerTestFixture::launch_client_process(TestingClientConfiguration& config)
776 {
777- process_manager.launch_client_process(config);
778+ process_manager.launch_client_process(config, *test_options);
779 }
780
781 bool BespokeDisplayServerTestFixture::shutdown_server_process()
782
783=== added file 'tests/mir_test_framework/testing_client_options.cpp'
784--- tests/mir_test_framework/testing_client_options.cpp 1970-01-01 00:00:00 +0000
785+++ tests/mir_test_framework/testing_client_options.cpp 2013-09-26 15:08:46 +0000
786@@ -0,0 +1,126 @@
787+/*
788+ * Copyright © 2013 Canonical Ltd.
789+ *
790+ * This program is free software: you can redistribute it and/or modify it
791+ * under the terms of the GNU General Public License version 3,
792+ * as published by the Free Software Foundation.
793+ *
794+ * This program is distributed in the hope that it will be useful,
795+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
796+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
797+ * GNU General Public License for more details.
798+ *
799+ * You should have received a copy of the GNU General Public License
800+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
801+ *
802+ * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
803+ */
804+
805+#include "mir_test_framework/testing_client_configuration.h"
806+#include "mir_test_framework/stub_client_connection_configuration.h"
807+#include "mir/options/program_option.h"
808+#include "src/client/default_connection_configuration.h"
809+#include "src/client/client_platform_factory.h"
810+#include "src/client/client_buffer_factory.h"
811+#include "src/client/client_buffer.h"
812+#include "src/client/client_platform.h"
813+#include "src/client/mir_connection.h"
814+
815+namespace mcl = mir::client;
816+namespace mtf=mir_test_framework;
817+namespace geom = mir::geometry;
818+
819+
820+namespace
821+{
822+class StubClientBuffer : public mcl::ClientBuffer
823+{
824+ std::shared_ptr<mcl::MemoryRegion> secure_for_cpu_write()
825+ {
826+ return nullptr;
827+ }
828+
829+ geom::Size size() const
830+ {
831+ return geom::Size{};
832+ }
833+
834+ geom::Stride stride() const
835+ {
836+ return geom::Stride{};
837+ }
838+
839+ geom::PixelFormat pixel_format() const
840+ {
841+ return geom::PixelFormat::abgr_8888;
842+ }
843+
844+ uint32_t age() const
845+ {
846+ return 0;
847+ }
848+ void increment_age()
849+ {
850+ }
851+ void mark_as_submitted()
852+ {
853+ }
854+ std::shared_ptr<MirNativeBuffer> native_buffer_handle() const
855+ {
856+ return nullptr;
857+ }
858+};
859+
860+struct StubClientBufferFactory : public mcl::ClientBufferFactory
861+{
862+ std::shared_ptr<mcl::ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const&,
863+ geom::Size, geom::PixelFormat)
864+ {
865+ return std::make_shared<StubClientBuffer>();
866+ }
867+};
868+
869+struct StubClientPlatform : public mcl::ClientPlatform
870+{
871+ MirPlatformType platform_type() const
872+ {
873+ return mir_platform_type_gbm;
874+ }
875+
876+ std::shared_ptr<mcl::ClientBufferFactory> create_buffer_factory()
877+ {
878+ return std::make_shared<StubClientBufferFactory>();
879+ }
880+
881+ std::shared_ptr<EGLNativeWindowType> create_egl_native_window(mcl::ClientSurface*)
882+ {
883+ auto fake_window = reinterpret_cast<EGLNativeWindowType>(0x12345678);
884+ return std::make_shared<EGLNativeWindowType>(fake_window);
885+ }
886+
887+ std::shared_ptr<EGLNativeDisplayType> create_egl_native_display()
888+ {
889+ auto fake_display = reinterpret_cast<EGLNativeDisplayType>(0x12345678);
890+ return std::make_shared<EGLNativeDisplayType>(fake_display);
891+ }
892+};
893+
894+struct StubClientPlatformFactory : public mcl::ClientPlatformFactory
895+{
896+ std::shared_ptr<mcl::ClientPlatform> create_client_platform(mcl::ClientContext*)
897+ {
898+ return std::make_shared<StubClientPlatform>();
899+ }
900+};
901+
902+}
903+
904+mtf::StubConnectionConfiguration::StubConnectionConfiguration(std::string const& socket_file)
905+ : DefaultConnectionConfiguration(socket_file)
906+{
907+}
908+
909+std::shared_ptr<mcl::ClientPlatformFactory> mtf::StubConnectionConfiguration::the_client_platform_factory()
910+{
911+ return std::make_shared<StubClientPlatformFactory>();
912+}
913
914=== modified file 'tests/mir_test_framework/testing_process_manager.cpp'
915--- tests/mir_test_framework/testing_process_manager.cpp 2013-09-19 18:18:35 +0000
916+++ tests/mir_test_framework/testing_process_manager.cpp 2013-09-26 15:08:46 +0000
917@@ -16,8 +16,11 @@
918 * Authored by: Alan Griffiths <alan@octopull.co.uk>
919 */
920
921+#include "mir_toolkit/client_types.h"
922 #include "mir_test_framework/testing_process_manager.h"
923 #include "mir_test_framework/detect_server.h"
924+#include "mir_test_framework/stub_client_connection_configuration.h"
925+#include "src/client/mir_connection.h"
926 #include "mir/run_mir.h"
927
928 #include <gmock/gmock.h>
929@@ -25,6 +28,7 @@
930 #include <thread>
931 #include <stdexcept>
932
933+namespace mo = mir::options;
934 namespace mc = mir::compositor;
935 namespace mtf = mir_test_framework;
936
937@@ -76,7 +80,38 @@
938 }
939 }
940
941-void mtf::TestingProcessManager::launch_client_process(TestingClientConfiguration& config)
942+/* if set before any calls to the api functions, assigning to this pointer will allow user to
943+ * override calls to mir_connect() and mir_connection_release(). This is mostly useful in test scenarios
944+ */
945+extern MirWaitHandle* (*mir_connect_impl)(
946+ char const *server,
947+ char const *app_name,
948+ mir_connected_callback callback,
949+ void *context);
950+extern void (*mir_connection_release_impl) (MirConnection *connection);
951+
952+namespace
953+{
954+MirWaitHandle* mir_connect_test_override(
955+ char const *socket_file,
956+ char const *app_name,
957+ mir_connected_callback callback,
958+ void *context)
959+{
960+ mtf::StubConnectionConfiguration conf(socket_file);
961+ auto connection = new MirConnection(conf);
962+ return connection->connect(app_name, callback, context);
963+}
964+
965+void mir_connection_release_override(MirConnection *connection)
966+{
967+ auto wait_handle = connection->disconnect();
968+ wait_handle->wait_for_all();
969+ delete connection;
970+}
971+}
972+
973+void mtf::TestingProcessManager::launch_client_process(TestingClientConfiguration& config, mo::Option const& test_options)
974 {
975 if (!is_test_process)
976 {
977@@ -108,6 +143,11 @@
978 server_process.reset();
979
980 SCOPED_TRACE("Client");
981+ if (!config.use_real_graphics(test_options))
982+ {
983+ mir_connect_impl = mir_connect_test_override;
984+ mir_connection_release_impl = mir_connection_release_override;
985+ }
986 config.exec();
987 exit(::testing::Test::HasFailure() ? EXIT_FAILURE : EXIT_SUCCESS);
988 }

Subscribers

People subscribed via source and target branches