[Piglit] [PATCH 5/5] framework: Add dummy logger that produces no output

Ilia Mirkin imirkin at alum.mit.edu
Tue Aug 12 14:56:14 PDT 2014


Patches 1-3, 5 are Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

I'd like to have another look at 4 after you fix the locking thing.
The diff is sufficiently hard to read that I'll want to just look at
the final product... please push it somewhere viewable when you do.

On Tue, Aug 12, 2014 at 5:34 PM, Dylan Baker <baker.dylan.c at gmail.com> wrote:
> From: Dylan Baker <baker.dylan.c at gmail.com>
>
> This adds a new logger option that produces no output. This is aimed at
> headless setups or for systems like jenkins where the output data isn't
> very useful.
>
> Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
> ---
>  framework/log.py             | 13 +++++++++++++
>  framework/tests/log_tests.py |  3 ++-
>  2 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/framework/log.py b/framework/log.py
> index 9fa3bbf..90a92bf 100644
> --- a/framework/log.py
> +++ b/framework/log.py
> @@ -219,6 +219,18 @@ class VerboseLog(QuietLog):
>              super(VerboseLog, self).log(value)
>
>
> +class DummyLog(BaseLog):
> +    """ A Logger that does nothing """
> +    def start(self, name):
> +        pass
> +
> +    def log(self, status):
> +        pass
> +
> +    def summary(self):
> +        pass
> +
> +
>  class LogManager(object):
>      """ Creates new log objects
>
> @@ -240,6 +252,7 @@ class LogManager(object):
>      LOG_MAP = {
>          'quiet': QuietLog,
>          'verbose': VerboseLog,
> +        'dummy': DummyLog,
>      }
>
>      def __init__(self, logger, total):
> diff --git a/framework/tests/log_tests.py b/framework/tests/log_tests.py
> index a71f3ca..9703b11 100644
> --- a/framework/tests/log_tests.py
> +++ b/framework/tests/log_tests.py
> @@ -37,7 +37,8 @@ def test_initialize():
>      check_initialize = lambda c, *a: c(*a)
>
>      for name, class_ in [('QuiteLog', log.QuietLog),
> -                         ('VerboseLog', log.VerboseLog)]:
> +                         ('VerboseLog', log.VerboseLog),
> +                         ('DummyLog', log.DummyLog)]:
>          check_initialize.description = "{} initializes".format(name)
>          yield check_initialize, class_, TEST_STATE
>
> --
> 2.0.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list