xorg/gtest/xorg-gtest-environment.h
More...
#include <environment.h>
|
| | Environment () |
| | Constructs an object to provide a global X server dummy environment.
|
| |
| void | SetLogFile (const std::string &path_to_log_file) |
| | Sets the path where the server log file will be created.
|
| |
| const std::string & | GetLogFile () const |
| | Returns the path where the server log file will be created.
|
| |
| void | SetConfigFile (const std::string &path_to_conf_file) |
| | Sets the path to the desired server configuration file.
|
| |
| const std::string & | GetConfigFile () const |
| | Returns the path of the server configuration file to be used.
|
| |
| void | SetServerPath (const std::string &path_to_server) |
| | Sets the path to the server executable.
|
| |
| const std::string & | GetServerPath () const |
| | Returns the path of the server executable to be used.
|
| |
| void | SetDisplayNumber (int display_num) |
| | Sets the display number that the server will use.
|
| |
| int | GetDisplayNumber () const |
| | Returns the display number of the server instance.
|
| |
| void | Kill () |
| | Kill the dummy Xorg server with SIGKILL.
|
| |
| void | set_log_file (const std::string &path_to_log_file) |
| |
| const std::string & | log_file () const |
| |
| void | set_conf_file (const std::string &path_conf_file) |
| |
| const std::string & | conf_file () const |
| |
| void | set_server (const std::string &path_to_server) |
| |
| const std::string & | server () const |
| |
| void | set_display (int display_num) |
| |
| int | display () const |
| |
|
| virtual void | SetUp () |
| | Starts the dummy X server.
|
| |
| virtual void | TearDown () |
| | Stops the dummy X server.
|
| |
xorg/gtest/xorg-gtest-environment.h
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
testing::AddGlobalTestEnvironment(environment);
xorg/gtest/xorg-gtest-environment.h
Definition xorg-gtest-environment.h:67
void set_server(const std::string &path_to_server)
void set_display(int display_num)
void set_conf_file(const std::string &path_conf_file)
void set_log_file(const std::string &path_to_log_file)
or link to libxorg-gtest_main.
◆ Environment()
| xorg::testing::Environment::Environment |
( |
| ) |
|
Constructs an object to provide a global X server dummy environment.
◆ conf_file()
| const std::string & xorg::testing::Environment::conf_file |
( |
| ) |
const |
◆ display()
| int xorg::testing::Environment::display |
( |
| ) |
const |
◆ GetConfigFile()
| const std::string & xorg::testing::Environment::GetConfigFile |
( |
| ) |
const |
Returns the path of the server configuration file to be used.
- Returns
- File path of the server configuration currently set
◆ GetDisplayNumber()
| int xorg::testing::Environment::GetDisplayNumber |
( |
| ) |
const |
Returns the display number of the server instance.
- Returns
- Display number of the server.
◆ GetLogFile()
| const std::string & xorg::testing::Environment::GetLogFile |
( |
| ) |
const |
Returns the path where the server log file will be created.
- Returns
- Path to server logfile.
◆ GetServerPath()
| const std::string & xorg::testing::Environment::GetServerPath |
( |
| ) |
const |
Returns the path of the server executable to be used.
- Returns
- Path to server executable.
◆ Kill()
| void xorg::testing::Environment::Kill |
( |
| ) |
|
Kill the dummy Xorg server with SIGKILL.
◆ log_file()
| const std::string & xorg::testing::Environment::log_file |
( |
| ) |
const |
◆ server()
| const std::string & xorg::testing::Environment::server |
( |
| ) |
const |
◆ set_conf_file()
| void xorg::testing::Environment::set_conf_file |
( |
const std::string & |
path_conf_file | ) |
|
◆ set_display()
| void xorg::testing::Environment::set_display |
( |
int |
display_num | ) |
|
◆ set_log_file()
| void xorg::testing::Environment::set_log_file |
( |
const std::string & |
path_to_log_file | ) |
|
◆ set_server()
| void xorg::testing::Environment::set_server |
( |
const std::string & |
path_to_server | ) |
|
◆ SetConfigFile()
| void xorg::testing::Environment::SetConfigFile |
( |
const std::string & |
path_to_conf_file | ) |
|
Sets the path to the desired server configuration file.
The path will be passed on to the server via the command line argument "-config". The default value is "[datadir]/xorg/gtest/dummy.conf".
- Parameters
-
| path_to_conf_file | Path to a Xorg X server .conf file. |
◆ SetDisplayNumber()
| void xorg::testing::Environment::SetDisplayNumber |
( |
int |
display_num | ) |
|
Sets the display number that the server will use.
The display number will be passed on to the server via the command line. The default value is 133.
- Parameters
-
| display_num | A display number. |
◆ SetLogFile()
| void xorg::testing::Environment::SetLogFile |
( |
const std::string & |
path_to_log_file | ) |
|
Sets the path where the server log file will be created.
The path will be passed on to the server via the command line argument "-logfile". The default value is "/tmp/Xorg.GTest.log".
- Parameters
-
| path_to_log_file | Path to server logfile. |
◆ SetServerPath()
| void xorg::testing::Environment::SetServerPath |
( |
const std::string & |
path_to_server | ) |
|
Sets the path to the server executable.
The default value is "Xorg".
- Parameters
-
| path_to_server | Path to an X.org server executable |
◆ SetUp()
| virtual void xorg::testing::Environment::SetUp |
( |
| ) |
|
|
protectedvirtual |
Starts the dummy X server.
Reimplemented from ::testing::Environment. See Google Test documentation for details.
- Exceptions
-
| std::runtime_error | if 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.
◆ TearDown()
| virtual void xorg::testing::Environment::TearDown |
( |
| ) |
|
|
protectedvirtual |
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:
- /build/xorg-gtest-jzajSq/xorg-gtest-0.7.1/include/xorg/gtest/xorg-gtest-environment.h