[PATCH xorg-gtest 2/5] xserver: add getters and setters for config and log file
Chase Douglas
chase.douglas at canonical.com
Mon Aug 13 09:39:23 PDT 2012
On 08/09/2012 10:38 PM, Peter Hutterer wrote:
> 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"];
> +}
>
Fine by me.
Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
And pushed as 340c07db1cbaa5fab10985d270fb30a2751abf61.
Thanks!
More information about the xorg-devel
mailing list