[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    Re: [PATCH xorg-gtest 1/3]  Added --xorg-logfile option.
From:       Chase Douglas <chase.douglas () canonical ! com>
Date:       2012-01-31 2:33:22
Message-ID: 4F2752F2.2040500 () canonical ! com
[Download RAW message or body]

On 01/30/2012 06:32 PM, Daniel d'Andrada wrote:
> And by default point to a location that doesn't require root privileges
> to be used. This is an enabler to make it possible to run Xorg without
> being root.
> 
> Signed-off-by: Daniel d'Andrada <daniel.dandrada@canonical.com>
> 
> diff --git a/include/xorg/gtest/environment.h 
> b/include/xorg/gtest/environment.h
> index fd550e7..65a28d5 100644
> --- a/include/xorg/gtest/environment.h
> +++ b/include/xorg/gtest/environment.h
> @@ -48,11 +48,13 @@ namespace testing {
>    * with the overall testing framework like
>    * @code
>    * std::string xorg_conf_path("conf/dummy.conf");
> + * std::string xorg_logfile_path("./MyXorg.log");
>    * int xorg_display = 133;
>    * std::string server("Xorg");
>    *
>    * xorg::testing::Environment* environment = new 
> xorg::testing::Environment(
>    *       xorg_conf_path,
> + *       xorg_logfile_path,
>    *       server,
>    *       xorg_display);
>    * testing::AddGlobalTestEnvironment(environment);
> @@ -64,10 +66,12 @@ class Environment : public ::testing::Environment {
>     /**
>      * Constructs an object to provide a global X server dummy environment.
>      * @param path_to_conf Path to xserver configuration.
> +   * @param path_to_logfile Path to xserver logfile.
>      * @param path_to_server Path to xserver executable.
>      * @param display Display port of dummy xserver instance.
>      */
>     Environment(const std::string& path_to_conf,
> +              const std::string& path_to_logfile = "/tmp/Xorg.GTest.log",
>                 const std::string& path_to_server = "Xorg", int display 

I thought about this some more, and I'm not sure I like adding an option
to the constructor. This will break API. Perhaps a better long-term
solution would be to leave the constructor as-is, and add properties to
the class instead.

Environment environment = new Environment("/etc/X11/gtest-dummy.conf");
environment->set_log_file("./MyXorg.log");
AddGlobalTestEnvironment(environment);

Before we have many users, perhaps we should convert all these
constructor parameters to properties?

-- Chase
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic