Mir
Classes | Typedefs | Enumerations | Functions | Variables
mir_test_framework Namespace Reference

Classes

class  AsyncServerRunner
 
struct  CanonicalWindowManagerPolicy
 
struct  ConnectedClientHeadlessServer
 
struct  ConnectedClientWithAWindow
 
class  DeclarativePlacementWindowManagerPolicy
 DeclarativePlacementWindowManagerPolicy is a test utility server component for specifying a static list of surface geometries and relative depths. Used, for example, in input tests where it is necessary to set up scenarios depending on multiple surfaces geometry and stacking. More...
 
class  FakeInputDevice
 
struct  HeadlessDisplayBufferCompositorFactory
 
struct  HeadlessInProcessServer
 
class  HeadlessNestedServerRunner
 
class  HeadlessTest
 Basic fixture for tests that don't use graphics or input hardware. More...
 
struct  InProcessServer
 Fixture for running Mir server in test process. More...
 
class  InputDeviceFaker
 
class  InterprocessClientServerTest
 
struct  ObservantShell
 
struct  PassthroughTracker
 
struct  PlacementApplyingShell
 
class  Process
 
struct  Result
 
struct  ServerRunner
 Utility for running Mir server in test process. More...
 
class  TemporaryEnvironmentValue
 
class  VisibleSurface
 

Typedefs

typedef std::map< std::string, mir::geometry::RectangleSurfaceGeometries
 
using ClientInputRegions = std::map< std::string, std::vector< mir::geometry::Rectangle > >
 
using ClientPositions = std::map< std::string, mir::geometry::Rectangle >
 

Enumerations

enum  TerminationReason {
  TerminationReason::unknown, TerminationReason::child_terminated_normally, TerminationReason::child_terminated_by_signal, TerminationReason::child_terminated_with_core_dump,
  TerminationReason::child_stopped_by_signal, TerminationReason::child_resumed_by_signal
}
 
enum  FailurePoint { create_client_platform, create_egl_native_window, create_buffer_factory }
 
enum  StubGraphicsPlatformOperation : unsigned int { StubGraphicsPlatformOperation::add = 13, StubGraphicsPlatformOperation::echo_fd = 15 }
 

Functions

MirWindowmake_any_surface (MirConnection *connection)
 
MirWindowmake_any_surface (MirConnection *connection, MirWindowEventCallback callback, void *context)
 
MirWindowmake_surface (MirConnection *connection, mir::geometry::Size size, MirPixelFormat format)
 
bool detect_server (std::string const &name, std::chrono::milliseconds const &timeout)
 
std::string executable_path ()
 
std::string library_path ()
 
std::string server_platform_path ()
 
std::string test_data_path ()
 
std::string server_platform (std::string const &name)
 
std::string server_input_platform (std::string const &name)
 
std::string client_platform (std::string const &name)
 
std::string const & test_socket_file ()
 
int main (int argc, char *argv[])
 Initialize and run the mir test framework as follows: More...
 
void set_commandline (int argc, char *argv[])
 Note the commandline for use in the mir test framework. More...
 
std::ostream & operator<< (std::ostream &out, const Result &result)
 
template<typename Callable >
std::shared_ptr< Processfork_and_run_in_a_different_process (Callable &&main_fn, std::function< int()> exit_fn)
 
void add_client_platform_error (FailurePoint where, std::exception_ptr what)
 Add an exception to the client platform created by the next call to create_client_platform. More...
 
 MATCHER (IsStubPlatformPackage, "")
 
std::shared_ptr< mir::graphics::Platform > make_stubbed_server_graphics_platform (std::vector< mir::geometry::Rectangle > const &display_rects)
 
void set_next_display_rects (std::unique_ptr< std::vector< mir::geometry::Rectangle >> &&display_rects)
 
void set_next_preset_display (std::shared_ptr< mir::graphics::Display > const &display)
 
mir::UniqueModulePtr< FakeInputDeviceadd_fake_input_device (mir::input::InputDeviceInfo const &info)
 
void disable_flavors ()
 
std::ostream & operator<< (std::ostream &os, VisibleSurface const &s)
 

Variables

constexpr int stub_data_size {21}
 
constexpr int stub_data_guard {0x0eadbeef}
 

Typedef Documentation

◆ ClientInputRegions

using mir_test_framework::ClientInputRegions = typedef std::map<std::string, std::vector<mir::geometry::Rectangle> >

◆ ClientPositions

using mir_test_framework::ClientPositions = typedef std::map<std::string, mir::geometry::Rectangle>

◆ SurfaceGeometries

Enumeration Type Documentation

◆ FailurePoint

Enumerator
create_client_platform 
create_egl_native_window 
create_buffer_factory 

◆ StubGraphicsPlatformOperation

Enumerator
add 
echo_fd 

◆ TerminationReason

Enumerator
unknown 
child_terminated_normally 
child_terminated_by_signal 
child_terminated_with_core_dump 
child_stopped_by_signal 
child_resumed_by_signal 

Function Documentation

◆ add_client_platform_error()

void mir_test_framework::add_client_platform_error ( FailurePoint  where,
std::exception_ptr  what 
)

Add an exception to the client platform created by the next call to create_client_platform.

Parameters
[in]whereThe platform call that will throw an exception
[in,out]whatThe exception to throw

◆ add_fake_input_device()

mir::UniqueModulePtr<FakeInputDevice> mir_test_framework::add_fake_input_device ( mir::input::InputDeviceInfo const &  info)

◆ client_platform()

std::string mir_test_framework::client_platform ( std::string const &  name)

◆ detect_server()

bool mir_test_framework::detect_server ( std::string const &  name,
std::chrono::milliseconds const &  timeout 
)

◆ disable_flavors()

void mir_test_framework::disable_flavors ( )

◆ executable_path()

std::string mir_test_framework::executable_path ( )

◆ fork_and_run_in_a_different_process()

template<typename Callable >
std::shared_ptr<Process> mir_test_framework::fork_and_run_in_a_different_process ( Callable &&  main_fn,
std::function< int()>  exit_fn 
)

◆ library_path()

std::string mir_test_framework::library_path ( )

◆ main()

int mir_test_framework::main ( int  argc,
char *  argv[] 
)

Initialize and run the mir test framework as follows:

::testing::InitGoogleTest(&argc, argv);
set_commandline(argc, argv);
return RUN_ALL_TESTS();
Attention
If you override main() for your own purposes call this or do something equivalent to run the tests.

◆ make_any_surface() [1/2]

MirWindow* mir_test_framework::make_any_surface ( MirConnection connection)

◆ make_any_surface() [2/2]

MirWindow* mir_test_framework::make_any_surface ( MirConnection connection,
MirWindowEventCallback  callback,
void *  context 
)

◆ make_stubbed_server_graphics_platform()

std::shared_ptr<mir::graphics::Platform> mir_test_framework::make_stubbed_server_graphics_platform ( std::vector< mir::geometry::Rectangle > const &  display_rects)

◆ make_surface()

MirWindow* mir_test_framework::make_surface ( MirConnection connection,
mir::geometry::Size  size,
MirPixelFormat  format 
)

◆ MATCHER()

mir_test_framework::MATCHER ( IsStubPlatformPackage  ,
""   
)

◆ operator<<() [1/2]

std::ostream& mir_test_framework::operator<< ( std::ostream &  os,
VisibleSurface const &  s 
)

◆ operator<<() [2/2]

std::ostream& mir_test_framework::operator<< ( std::ostream &  out,
const Result result 
)

◆ server_input_platform()

std::string mir_test_framework::server_input_platform ( std::string const &  name)

◆ server_platform()

std::string mir_test_framework::server_platform ( std::string const &  name)

◆ server_platform_path()

std::string mir_test_framework::server_platform_path ( )

◆ set_commandline()

void mir_test_framework::set_commandline ( int  argc,
char *  argv[] 
)

Note the commandline for use in the mir test framework.

The parameter list referenced by argv must remain valid during the tests.

◆ set_next_display_rects()

void mir_test_framework::set_next_display_rects ( std::unique_ptr< std::vector< mir::geometry::Rectangle >> &&  display_rects)

◆ set_next_preset_display()

void mir_test_framework::set_next_preset_display ( std::shared_ptr< mir::graphics::Display > const &  display)

◆ test_data_path()

std::string mir_test_framework::test_data_path ( )

◆ test_socket_file()

std::string const& mir_test_framework::test_socket_file ( )

Variable Documentation

◆ stub_data_guard

constexpr int mir_test_framework::stub_data_guard {0x0eadbeef}

◆ stub_data_size

constexpr int mir_test_framework::stub_data_size {21}

Copyright © 2012-2018 Canonical Ltd.
Generated on Sat Mar 31 14:22:42 UTC 2018