Mir

Merge lp:~alan-griffiths/mir/fix-1271604 into lp:mir

Proposed by Alan Griffiths
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 1349
Proposed branch: lp:~alan-griffiths/mir/fix-1271604
Merge into: lp:mir
Prerequisite: lp:~alan-griffiths/mir/fix-1271655
Diff against target: 50 lines (+15/-0)
2 files modified
include/test/mir_test_framework/in_process_server.h (+2/-0)
tests/mir_test_framework/in_process_server.cpp (+13/-0)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-1271604
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
Kevin DuBois (community) Approve
Andreas Pokorny (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+202722@code.launchpad.net

Commit message

tests: Override configuration to avoid creating an (unused) filesystem endpoint for connections when using InProcessServer

Description of the change

tests: Override configuration to avoid creating an (unused) filesystem endpoint for connections when using InProcessServer

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
Andreas Pokorny (andreas-pokorny) wrote :

lgtm

review: Approve
Revision history for this message
Kevin DuBois (kdub) :
review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Looks good.

BTW, a simpler way to write:
   char const* const env_no_file =
is:
   char const env_no_file[] =

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/test/mir_test_framework/in_process_server.h'
--- include/test/mir_test_framework/in_process_server.h 2013-12-13 15:11:19 +0000
+++ include/test/mir_test_framework/in_process_server.h 2014-01-22 18:03:28 +0000
@@ -36,6 +36,7 @@
36/// Fixture for running Mir server in test process36/// Fixture for running Mir server in test process
37struct InProcessServer : testing::Test37struct InProcessServer : testing::Test
38{38{
39 InProcessServer();
39 ~InProcessServer();40 ~InProcessServer();
4041
41 /// Starts the server42 /// Starts the server
@@ -53,6 +54,7 @@
53 mir::DisplayServer* start_mir_server();54 mir::DisplayServer* start_mir_server();
54 virtual mir::DefaultServerConfiguration& server_config() = 0;55 virtual mir::DefaultServerConfiguration& server_config() = 0;
5556
57 char const* const old_env;
56 std::thread server_thread;58 std::thread server_thread;
57 mir::DisplayServer* display_server = 0;59 mir::DisplayServer* display_server = 0;
58};60};
5961
=== modified file 'tests/mir_test_framework/in_process_server.cpp'
--- tests/mir_test_framework/in_process_server.cpp 2013-12-17 10:05:06 +0000
+++ tests/mir_test_framework/in_process_server.cpp 2014-01-22 18:03:28 +0000
@@ -30,6 +30,17 @@
3030
31namespace mtf = mir_test_framework;31namespace mtf = mir_test_framework;
3232
33namespace
34{
35char const* const env_no_file = "MIR_SERVER_NO_FILE";
36}
37
38mtf::InProcessServer::InProcessServer() :
39 old_env(getenv(env_no_file))
40{
41 if (!old_env) setenv(env_no_file, "", true);
42}
43
33void mtf::InProcessServer::SetUp()44void mtf::InProcessServer::SetUp()
34{45{
35 display_server = start_mir_server();46 display_server = start_mir_server();
@@ -53,6 +64,8 @@
53mtf::InProcessServer::~InProcessServer()64mtf::InProcessServer::~InProcessServer()
54{65{
55 if (server_thread.joinable()) server_thread.join();66 if (server_thread.joinable()) server_thread.join();
67
68 if (!old_env) unsetenv(env_no_file);
56}69}
5770
58mir::DisplayServer* mtf::InProcessServer::start_mir_server()71mir::DisplayServer* mtf::InProcessServer::start_mir_server()

Subscribers

People subscribed via source and target branches