[PATCH xorg-gtest 2/5] xserver: add getters and setters for config and log file

Peter Hutterer peter.hutterer at who-t.net
Thu Aug 9 22:38:12 PDT 2012


A GetOption() call would be more generic here, but for log and config file
it's more intuitive to have actual methods instead of having to pass
"-config" to a generic GetOption() call.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 include/xorg/gtest/xorg-gtest-xserver.h | 16 ++++++++++++++++
 src/xserver.cpp                         |  8 ++++++++
 2 files changed, 24 insertions(+)

diff --git a/include/xorg/gtest/xorg-gtest-xserver.h b/include/xorg/gtest/xorg-gtest-xserver.h
index 0776d36..ee2b0e3 100644
--- a/include/xorg/gtest/xorg-gtest-xserver.h
+++ b/include/xorg/gtest/xorg-gtest-xserver.h
@@ -143,6 +143,22 @@ class XServer : public xorg::testing::Process {
     const std::string& GetVersion();
 
     /**
+     * Get the server's log file path. If this path is empty, the server
+     * will use it's built-in log file path.
+     *
+     * @return The log file path this server will use, is using or has used.
+     */
+    const std::string& GetLogFilePath();
+
+    /**
+     * Get the server's config file path. If this path is empty, the server
+     * will use it's built-in config file path.
+     *
+     * @return The config file path this server will use, is using or has used.
+     */
+    const std::string& GetConfigPath();
+
+    /**
      * Set startup options for the server.
      *
      * For arguments that do not take/need a value, use the empty string as
diff --git a/src/xserver.cpp b/src/xserver.cpp
index 08ff864..244a96e 100644
--- a/src/xserver.cpp
+++ b/src/xserver.cpp
@@ -362,3 +362,11 @@ bool xorg::testing::XServer::Kill(unsigned int timeout) {
 void xorg::testing::XServer::SetOption(const std::string &key, const std::string &value) {
   d_->options[key] = value;
 }
+
+const std::string& xorg::testing::XServer::GetLogFilePath() {
+  return d_->options["-logfile"];
+}
+
+const std::string& xorg::testing::XServer::GetConfigPath() {
+  return d_->options["-config"];
+}
-- 
1.7.11.2



More information about the xorg-devel mailing list