[Piglit] [Patch v2 03/13] gleantest.py: simplify interpret_result()

Ilia Mirkin imirkin at alum.mit.edu
Tue May 13 12:23:52 PDT 2014


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

Some of the later ones seem good too, but they're done after the code
motion, which seems suspect to me. But if everyone else loves it, I
certainly won't try to block it :)

  -ilia

On Tue, May 13, 2014 at 2:38 PM, Dylan Baker <baker.dylan.c at gmail.com> wrote:
> First, this replaces str.find() with 'if x in str', this is simpler and
> easier to read, and unlike find(), short-circuits on the first True.
> Second, it removes the check for skip. This isn't needed since if the
> test is skipped it will return before reaching the interpret_result()
> call, making this dead code.
>
> v2: - split this change out of the next patch
>
> Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
> ---
>  framework/gleantest.py | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/framework/gleantest.py b/framework/gleantest.py
> index 2f22c87..5229cf5 100644
> --- a/framework/gleantest.py
> +++ b/framework/gleantest.py
> @@ -40,10 +40,7 @@ class GleanTest(Test):
>          return super(GleanTest, self).command + self.globalParams
>
>      def interpret_result(self):
> -        if "{'result': 'skip'}" in self.result['out']:
> -            self.result['result'] = 'skip'
> -        elif (self.result['out'].find('FAIL') >= 0 or
> -                self.result['returncode'] != 0):
> +        if self.result['returncode'] != 0 or 'FAIL' in self.result['out']:
>              self.result['result'] = 'fail'
>          else:
>              self.result['result'] = 'pass'
> --
> 2.0.0.rc2
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list