Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
display_server_test_fixture.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 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: Thomas Guest <thomas.guest@canonical.com>
17  */
18 
19 #ifndef MIR_DISPLAY_SERVER_TEST_FIXTURE
20 #define MIR_DISPLAY_SERVER_TEST_FIXTURE
21 
23 
25 #include <gtest/gtest.h>
26 
27 #include <memory>
28 #include <functional>
29 
30 namespace mir_test_framework
31 {
32 using namespace ::mir;
33 
34 // The test fixture sets up and tears down a display server for use
35 // in display server test cases.
36 class DefaultDisplayServerTestFixture : public testing::Test
37 {
38 public:
41 
42  static void SetUpTestCase();
43  static void TearDownTestCase();
44 
46 
47 private:
48  static TestingProcessManager process_manager;
49  static TestingServerConfiguration default_parameters;
50 
51  virtual void TearDown();
52 };
53 
54 // The test fixture sets up and tears down a display server for use
55 // in display server tests.
56 class BespokeDisplayServerTestFixture : public testing::Test
57 {
58 public:
61 
63 
65 
68  void kill_client_processes();
70 
71  void run_in_test_process(std::function<void()> const& run_code);
72 
73 protected:
74  virtual void SetUp();
75  virtual void TearDown();
76 
77 private:
78  TestingProcessManager process_manager;
79  std::shared_ptr<mir::options::Option> test_options;
80 };
81 
82 }
83 
88 
89 #endif // MIR_DISPLAY_SERVER_TEST_FIXTURE
Definition: display_server_test_fixture.h:36
Definition: display_server_test_fixture.h:56
Definition: testing_process_manager.h:47
void run_in_test_process(std::function< void()> const &run_code)
void launch_client_process(TestingClientConfiguration &config)
Definition: testing_client_configuration.h:27
Definition: testing_server_configuration.h:30
void launch_client_process(TestingClientConfiguration &config)
void launch_server_process(TestingServerConfiguration &config)
Definition: process.h:47

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