[PATCH xorg-gtest] xserver: if -config or -logfile is called with empty value, remove from args

Chase Douglas chase.douglas at ubuntu.com
Fri Oct 26 09:30:51 PDT 2012


On Mon, Oct 22, 2012 at 7:02 PM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> -logfile and -config are auto-filled for the default setup. A test that
> needs no config file or the default log file must be able to unset those
> defaults.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  src/xserver.cpp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/xserver.cpp b/src/xserver.cpp
> index 55efab1..29c0430 100644
> --- a/src/xserver.cpp
> +++ b/src/xserver.cpp
> @@ -496,7 +496,11 @@ void xorg::testing::XServer::RemoveLogFile(bool force) {
>  }
>
>  void xorg::testing::XServer::SetOption(const std::string &key, const std::string &value) {
> -  d_->options[key] = value;
> +  if (value.empty() &&
> +      (key.compare("-logfile") == 0 || key.compare("-config") == 0)) {
> +    d_->options.erase(key);
> +  } else
> +    d_->options[key] = value;
>  }
>
>  const std::string& xorg::testing::XServer::GetLogFilePath() {

IIUC, this would require passing:

--logfile ""

That's a bit unwieldy, and it's a non-obvious way to cause no log
file. Perhaps we should have a different set of options: --no-logfile
and --no-config?

-- Chase


More information about the xorg-devel mailing list