summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-08-10 15:38:12 +1000
committerChase Douglas <chase.douglas@canonical.com>2012-08-13 09:35:11 -0700
commit340c07db1cbaa5fab10985d270fb30a2751abf61 (patch)
tree239df4614479af99b9c3c4d1c2e8d632d0451da9
parentf81f463289acd79d4b9521a8d5dfc344093f7b83 (diff)
xserver: add getters and setters for config and log file
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@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
-rw-r--r--include/xorg/gtest/xorg-gtest-xserver.h16
-rw-r--r--src/xserver.cpp8
2 files changed, 24 insertions, 0 deletions
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"];
+}