Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 
67  void kill_client_processes();
69 
70  void run_in_test_process(std::function<void()> const& run_code);
71 
72 protected:
73  virtual void SetUp();
74  virtual void TearDown();
75 
76 private:
77  TestingProcessManager process_manager;
78  std::shared_ptr<mir::options::Option> test_options;
79 };
80 
81 }
82 
87 
88 #endif // MIR_DISPLAY_SERVER_TEST_FIXTURE

Copyright © 2012,2013 Canonical Ltd.
Generated on Wed Oct 30 18:52:19 UTC 2013