Mir
headless_test.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 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 2 or 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_HEADLESS_TEST_H_
20 #define MIR_TEST_FRAMEWORK_HEADLESS_TEST_H_
21 
23 
24 #include <gtest/gtest.h>
25 
26 
27 namespace mir { class SharedLibrary; }
28 namespace mir { namespace graphics { class Display; }}
29 namespace mir { namespace geometry { struct Rectangle; }}
30 
31 namespace mir_test_framework
32 {
39 class HeadlessTest : public ::testing::Test, public AsyncServerRunner
40 {
41 public:
42  HeadlessTest();
43  ~HeadlessTest() noexcept;
44 
45 
46  void preset_display(std::shared_ptr<mir::graphics::Display> const& display);
47 
49  void initial_display_layout(std::vector<mir::geometry::Rectangle> const& display_rects);
50 
51 private:
52  std::unique_ptr<mir::SharedLibrary> server_platform_graphics_lib;
53 };
54 
55 std::string const& test_socket_file();
56 }
57 
58 #endif /* MIR_TEST_FRAMEWORK_HEADLESS_TEST_H_ */
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: blob.h:26
Definition: async_server_runner.h:35
std::string const & test_socket_file()
void initial_display_layout(std::vector< mir::geometry::Rectangle > const &display_rects)
Override initial display layout.
Definition: any_surface.h:25
void preset_display(std::shared_ptr< mir::graphics::Display > const &display)
Basic fixture for tests that don&#39;t use graphics or input hardware.
Definition: headless_test.h:39

Copyright © 2012-2018 Canonical Ltd.
Generated on Thu Mar 15 13:04:52 UTC 2018