[Piglit] [PATCH] framework: fix summary totals when multiple results are specified

Dylan Baker baker.dylan.c at gmail.com
Mon Jul 14 06:08:42 PDT 2014


On Monday, July 14, 2014 10:51:07 AM Thomas Wood wrote:
> Ensure the correct totals are displayed for each result summary when
> multiple results are specified.
> 
> Signed-off-by: Thomas Wood <thomas.wood at intel.com>
> ---
>  framework/summary.py | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/framework/summary.py b/framework/summary.py
> index 0db2a80..332aa40 100644
> --- a/framework/summary.py
> +++ b/framework/summary.py
> @@ -410,16 +410,16 @@ class Summary:
>                      self.tests['fixes'].add(test)
>                      self.tests['changes'].add(test)
> 
> -    def __find_totals(self):
> +    def __find_totals(self, results):
>          """
>          Private: Find the total number of pass, fail, crash, skip, and warn
> in -        the *last* set of results stored in self.results.
> +        the specified results.
>          """
>          self.totals = {'pass': 0, 'fail': 0, 'crash': 0, 'skip': 0,
>                         'timeout': 0, 'warn': 0, 'dmesg-warn': 0,
>                         'dmesg-fail': 0}
> 
> -        for test in self.results[-1].tests.itervalues():
> +        for test in results.tests.itervalues():
>              self.totals[str(test['result'])] += 1
> 
>      def generate_html(self, destination, exclude):
> @@ -461,7 +461,7 @@ class Summary:
>              else:
>                  time = None
> 
> -            self.__find_totals()
> +            self.__find_totals(each)
> 
>              with open(path.join(destination, each.name, "index.html"), 'w')
> as out: out.write(testindex.render(name=each.name,
> @@ -533,7 +533,7 @@ class Summary:
> 
>      def generate_text(self, diff, summary):
>          """ Write summary information to the console """
> -        self.__find_totals()
> +        self.__find_totals(self.results[-1])
> 
>          # Print the name of the test and the status from each test run
>          if not summary:

This is fine, but could you update the commit message to mention that that is 
needed to fix the HTML output? With that change this is
Reviewed-by: Dylan Baker <baker.dylan.c at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140714/fa9039c2/attachment.sig>


More information about the Piglit mailing list