[Piglit] [PATCH] test/gleantest: fix missing --quick property from quick profile

Dylan Baker dylan at pnwbakers.com
Tue May 30 17:07:54 UTC 2017


Quoting Timothy Arceri (2017-05-18 23:21:13)
> ---
>  framework/test/gleantest.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/framework/test/gleantest.py b/framework/test/gleantest.py
> index b2d56f3..0220c1a 100644
> --- a/framework/test/gleantest.py
> +++ b/framework/test/gleantest.py
> @@ -49,21 +49,21 @@ class GleanTest(Test):
>  
>      def __init__(self, name, **kwargs):
>          super(GleanTest, self).__init__(
>              [self._EXECUTABLE, "-o", "-v", "-v", "-v", "-t", "+" + name],
>              **kwargs)
>  
>      @Test.command.getter
>      def command(self):
>          return super(GleanTest, self).command + self.GLOBAL_PARAMS
>  
> -    @Test.command.setter
> +    @command.setter
>      def command(self, new):
>          self._command = [n for n in new if not n in self.GLOBAL_PARAMS]
>  
>      def interpret_result(self):
>          if self.result.returncode != 0 or 'FAIL' in self.result.out:
>              self.result.result = 'fail'
>          else:
>              self.result.result = 'pass'
>          super(GleanTest, self).interpret_result()
>  
> -- 
> 2.9.4

I know this already landed, but:

Oops. I fixed the other instances of that. That is the correct fix I think, and
it does make sense, but it's a pretty obscure case in the python class model.
property is actually a special kind of class called a descriptor, basically it
provides a getter, setter, and deleter method that get called when you query,
assign, or delete the attribute. When the subclass overrides @Test.command.getter
you actually create a new instance, so if you call
@Test.command.{getter,setter,deleter} twice only one of the new instances is
kept.

Dylan

> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20170530/f3ad2086/attachment.sig>


More information about the Piglit mailing list