diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-10-26 16:22:21 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-10-29 07:49:15 +1000 |
commit | b4eec086bb97cb206b0f83b8b31c467fa8c99701 (patch) | |
tree | dba8ca371d2ab83892b15e0b95e0b1cafcedd249 | |
parent | 21c170f3fc1895381046f627149dbcdd843a4b41 (diff) |
common/xit-server: add Start(config) for simpler server starting
This essentially obsoletes StartServer()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | tests/common/helpers.cpp | 6 | ||||
-rw-r--r-- | tests/common/helpers.h | 4 | ||||
-rw-r--r-- | tests/common/xit-server.cpp | 10 | ||||
-rw-r--r-- | tests/common/xit-server.h | 4 |
4 files changed, 19 insertions, 5 deletions
diff --git a/tests/common/helpers.cpp b/tests/common/helpers.cpp index b6c5691..0a66165 100644 --- a/tests/common/helpers.cpp +++ b/tests/common/helpers.cpp @@ -8,10 +8,8 @@ #include <X11/extensions/XInput2.h> #include <X11/extensions/Xrandr.h> -void StartServer(std::string prefix, ::xorg::testing::XServer &server, XOrgConfig &config) { - config.WriteConfig(); - server.SetDisplayNumber(133); - server.Start(); +void StartServer(std::string prefix, XITServer &server, XOrgConfig &config) { + server.Start(config); } int FindInputDeviceByName(Display *dpy, const std::string &device_name, int *deviceid) diff --git a/tests/common/helpers.h b/tests/common/helpers.h index a005716..9c176f2 100644 --- a/tests/common/helpers.h +++ b/tests/common/helpers.h @@ -8,10 +8,12 @@ #include <xorg/gtest/xorg-gtest.h> #include "xorg-conf.h" +#include "xit-server.h" + /** * Start the server after writing the config, with the prefix given. */ -void StartServer(std::string prefix, ::xorg::testing::XServer &server, XOrgConfig &config); +void StartServer(std::string prefix, XITServer &server, XOrgConfig &config); /** * Find the device in the input device list and return the number of diff --git a/tests/common/xit-server.cpp b/tests/common/xit-server.cpp index 6a70819..25dc683 100644 --- a/tests/common/xit-server.cpp +++ b/tests/common/xit-server.cpp @@ -12,3 +12,13 @@ XITServer::XITServer() : XServer::XServer() { SetOption("-config", GetDefaultConfigFile()); SetDisplayNumber(133); } + +void XITServer::Start() { + XServer::Start(); +} + +void XITServer::Start(XOrgConfig &config) { + config.WriteConfig(); + SetOption("-config", config.GetPath()); + Start(); +} diff --git a/tests/common/xit-server.h b/tests/common/xit-server.h index cc7a16f..34d02ef 100644 --- a/tests/common/xit-server.h +++ b/tests/common/xit-server.h @@ -7,6 +7,8 @@ #include <xorg/gtest/xorg-gtest.h> +#include "xorg-conf.h" + /** * Wrapper around the xorg-gtest XServer class that provides default setup * routines for the XIT suite @@ -14,6 +16,8 @@ class XITServer : public xorg::testing::XServer { public: XITServer(); + void Start(); + void Start(XOrgConfig &config); }; #endif |