[Piglit] [PATCH 5/8] framework: Refactor a bit, reducing required cleverness.

Dylan Baker baker.dylan.c at gmail.com
Wed Sep 18 15:29:17 PDT 2013


On Wednesday 18 September 2013 15:00:30 Eric Anholt wrote:
> Now that the pages-list "optimization" is gone, we can move the
> changes list computation into an obvious place, avoiding any work in
> the single-results-file case.
> ---
>  framework/summary.py | 19 ++++++-------------
>  1 file changed, 6 insertions(+), 13 deletions(-)
> 
> diff --git a/framework/summary.py b/framework/summary.py
> index 8f6f5f7..be9c96e 100644
> --- a/framework/summary.py
> +++ b/framework/summary.py
> @@ -432,13 +432,6 @@ class Summary:
>                  status_text.append(s)
>                  status.append(find_regressions(s))
> 
> -            # Check and append self.tests['changes']
> -            # A set cannot contain duplicate entries, so creating a set
> -            # out the list will reduce it's length to 1 if all entries
> -            # are the same, meaning it is not a change
> -            if len(set(status)) > 1:
> -                self.tests['changes'].add(test)
> -
>              for i in status_text:
>                  if i not in ['pass', 'skip', 'special']:
>                      self.tests['problems'].add(test)
> @@ -446,13 +439,13 @@ class Summary:
>              if 'skip' in status_text:
>                  self.tests['skipped'].add(test)
> 
> -            # Find both fixes and regressions, and append them to the
> -            # proper lists
>              for i in xrange(len(status) - 1):
> -                if status[i] < status[i + 1] and status[i] != 0:
> -                    self.tests['regressions'].add(test)
> -                if status[i] > 1 and status[i + 1] == 1:
> -                    self.tests['fixes'].add(test)
> +                if status[i] != status[i + 1]:
> +                    self.tests['changes'].add(test)
> +                    if status[i] < status[i + 1] and status[i] != 0:
> +                        self.tests['regressions'].add(test)
> +                    if status[i] > 1 and status[i + 1] == 1:
> +                        self.tests['fixes'].add(test)
> 
>      def __find_totals(self):
>          """

again please see my set [PATCH 1/2] status.py: Adds a new status class and 
subclasses series
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130918/4439d92e/attachment.pgp>


More information about the Piglit mailing list