Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
in_process_server.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIR_TEST_FRAMEWORK_IN_PROCESS_SERVER_H_
20 #define MIR_TEST_FRAMEWORK_IN_PROCESS_SERVER_H_
21 
22 #include <gtest/gtest.h>
23 
24 #include <string>
25 #include <thread>
26 
27 namespace mir
28 {
29 class DisplayServer;
30 class DefaultServerConfiguration;
31 }
32 
33 
34 namespace mir_test_framework
35 {
37 struct InProcessServer : testing::Test
38 {
41 
44  void SetUp() override;
45 
48  void TearDown() override;
49 
51  std::string new_connection();
52 
53 private:
54  mir::DisplayServer* start_mir_server();
55  virtual mir::DefaultServerConfiguration& server_config() = 0;
56 
57  char const* const old_env;
58  std::thread server_thread;
59  mir::DisplayServer* display_server = 0;
60 };
61 }
62 
63 #endif /* MIR_TEST_FRAMEWORK_IN_PROCESS_SERVER_H_ */
Fixture for running Mir server in test process.
Definition: in_process_server.h:37
void TearDown() override
Stops the server.
void SetUp() override
Starts the server.
Definition: display_server.h:31
Definition: default_server_configuration.h:129

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014