[Piglit] [PATCH 2/2] framework/summary/common.py: Add enabled, disabled, and skip to changes

Ilia Mirkin imirkin at alum.mit.edu
Wed Oct 21 10:29:44 PDT 2015


Please make sure that skip <-> notrun does *not* show up as a change.

On Wed, Oct 21, 2015 at 1:05 PM,  <baker.dylan.c at gmail.com> wrote:
> From: Dylan Baker <baker.dylan.c at gmail.com>
>
> This changes the changes category to include every case were the first
> status is not the same as the previous status, including
> <status> <-> notrun,  even when <status> is skip.
>
> This fixes the failing unit tests from the previous commit.
>
> cc: Michel Dänzer <michel at daenzer.net>
> Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> ---
>
> Michel, can you test this and make sure it does what you want?
>
>  framework/summary/common.py | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/framework/summary/common.py b/framework/summary/common.py
> index 95af02a..1409828 100644
> --- a/framework/summary/common.py
> +++ b/framework/summary/common.py
> @@ -101,7 +101,24 @@ class Names(object):
>
>      @lazy_property
>      def changes(self):
> -        return self.__diff(operator.ne)
> +        def handler(names, name, prev, cur):
> +            """Handle missing tests.
> +
> +            For changes we want literally anything where the first result
> +            isn't the same as the second result.
> +
> +            """
> +            def _get(res):
> +                try:
> +                    return res.get_result(name)
> +                except KeyError:
> +                    return so.NOTRUN
> +
> +            # Use 'is' to properly handle skip <-> notrun
> +            if _get(cur) is not _get(prev):
> +                names.add(name)
> +
> +        return self.__diff(operator.ne, handler=handler)
>
>      @lazy_property
>      def problems(self):
> --
> 2.6.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list