xorg-gtest 0.1
Xorg testing extension to Google Test
xorg::testing::Environment Class Reference

Global Google Test environment providing a dummy X server. More...

#include <xorg/gtest/environment.h>

List of all members.

Public Member Functions

 Environment (const std::string &path_to_conf, const std::string &path_to_server="Xorg", int display=133)
 Constructs an object to provide a global X server dummy environment.

Protected Member Functions

virtual void SetUp ()
 Starts the dummy X server.
virtual void TearDown ()
 Stops the dummy X server.

Detailed Description

Global Google Test environment providing a dummy X server.

Starts up a dummy X server for testing purposes. Either associate the environment manually with the overall testing framework like

 std::string xorg_conf_path("conf/dummy.conf");
 int xorg_display = 133;
 std::string server("Xorg");

 xorg::testing::Environment* environment = new xorg::testing::Environment(
       xorg_conf_path,
       server,
       xorg_display);
 testing::AddGlobalTestEnvironment(environment);

or link to libxorg-gtest_main.


Constructor & Destructor Documentation

xorg::testing::Environment::Environment ( const std::string &  path_to_conf,
const std::string &  path_to_server = "Xorg",
int  display = 133 
)

Constructs an object to provide a global X server dummy environment.

Parameters:
path_to_confPath to xserver configuration.
path_to_serverPath to xserver executable.
displayDisplay port of dummy xserver instance.

Member Function Documentation

virtual void xorg::testing::Environment::SetUp ( ) [protected, virtual]

Starts the dummy X server.

Reimplemented from ::testing::Environment. See Google Test documentation for details.

Exceptions:
std::runtime_errorif a dummy X server cannot be started.
Postcondition:
If successful: subsequent connections to the dummy X server succeed.
If successful: Environment variable DISPLAY contains the display port for connecting to the dummy X server.
virtual void xorg::testing::Environment::TearDown ( ) [protected, virtual]

Stops the dummy X server.

Reimplemented from ::testing::Environment. See Google Test documentation for details.

Postcondition:
Dummy X server stopped.

The documentation for this class was generated from the following file:
 All Classes Functions