[Piglit] [PATCH] framework: Try to fix the exclusions of llvmpipe test list.y

Dylan Baker baker.dylan.c at gmail.com
Fri Mar 6 10:55:18 PST 2015


On Fri, Mar 06, 2015 at 12:14:42PM +0000, Jose Fonseca wrote:
> The
> 
>   del profile.test_list[key]
> 
> statement was silently failing because the TestDict's key lowering magic
> was not happening for deleted items.
> 
> Unfortunately this still is not enough to fix the glean exclusions:
> somehow all glean test names are being munged with extra whitespace.
> For example:
> 
>   $ ./piglit-print-commands.py tests/llvmpipe.py | grep '^glean/p'
>   warning: test glean/pointAtten does not exist
>   warning: test glean/texCombine does not exist
>   [...]
>   glean/p o i n t a t t e n ::: bin/glean -o -v -v -v -t +pointAtten --quick
> 
> But couldn't find out where this happens.
> ---
>  framework/profile.py | 4 ++++
>  tests/llvmpipe.py    | 3 ++-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/framework/profile.py b/framework/profile.py
> index e8e8ba1..409b87e 100644
> --- a/framework/profile.py
> +++ b/framework/profile.py
> @@ -80,6 +80,10 @@ class TestDict(dict):  # pylint: disable=too-few-public-methods
>          """Lower the value before returning."""
>          return super(TestDict, self).__getitem__(key.lower())
>  
> +    def __delitem__(self, key):
> +        """Lower the value before returning."""
> +        return super(TestDict, self).__delitem__(key.lower())
> +

This is absolutely the right way to handle this, I should have done
this.

>  
>  class TestProfile(object):
>      """ Class that holds a list of tests for execution
> diff --git a/tests/llvmpipe.py b/tests/llvmpipe.py
> index 64c651d..d3c9e6d 100644
> --- a/tests/llvmpipe.py
> +++ b/tests/llvmpipe.py
> @@ -1,6 +1,7 @@
>  # -*- coding: utf-8 -*-
>  
>  import platform
> +import sys
>  
>  from framework.grouptools import join
>  from tests.gpu import profile
> @@ -12,7 +13,7 @@ def remove(key):
>      try:
>          del profile.test_list[key]
>      except KeyError:
> -        pass
> +        sys.stderr.write('warning: test %s does not exist\n' % key)

If you import print_function from __future__ you can do this:
print('warning: test {} does not exist\n'.format(key), file=sys.stderr)

Otherwise you'll need to add sys.stderr.flush() to ensure that it
actually makes it's way to the console.

With the print function change, this patch is:
Reviewed-by: Dylan Baker <baker.dylan.c at gmail.com>

>  
>  
>  # These take too long or too much memory
> -- 
> 2.1.0
> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20150306/25d6b767/attachment.sig>


More information about the Piglit mailing list