[Piglit] [PATCH] unittests: include new elapsed time from the console summary output

Brian Paul brian.e.paul at gmail.com
Sat Nov 4 19:14:47 UTC 2017


Looks OK to me.
Reviewed-by: Brian Paul <brianp at vmware.com>

On Fri, Nov 3, 2017 at 6:18 PM, Andres Gomez <agomez at igalia.com> wrote:

> Fixes: e76ecd048 ("framework: also print elapsed time with
> piglit-summary.py")
>
> Cc: Brian Paul <brianp at vmware.com>
> Cc: Dylan Baker <dylanx.c.baker at intel.com>
> Signed-off-by: Andres Gomez <agomez at igalia.com>
> ---
>  unittests/framework/summary/test_console.py | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/unittests/framework/summary/test_console.py
> b/unittests/framework/summary/test_console.py
> index 0f7b06772..6e6ae8a7d 100644
> --- a/unittests/framework/summary/test_console.py
> +++ b/unittests/framework/summary/test_console.py
> @@ -53,6 +53,7 @@ _ENUMS = {
>      13: 'fixes',
>      14: 'regressions',
>      15: 'total',
> +    16: 'time',
>  }
>
>  class TestPrintSummary(object):
> @@ -67,11 +68,11 @@ class TestPrintSummary(object):
>          """
>          names = [grouptools.join('foo', 'bar', 'oink', 'foobar', 'boink'),
>                   'foo', 'bar']
> -        template = '{: >20.20} {: >6.6}'
> +        template = '{: >20.20} {: >12.12}'
>
>          expected = console_._SUMMARY_TEMPLATE.format(
> -            names=' '.join(['this is a really rea', 'a name']),
> -            divider=' '.join(['--------------------', '------']),
> +            names=' '.join(['this is a really rea', 'another name']),
> +            divider=' '.join(['--------------------', '------------']),
>              pass_=template.format('1', '2'),
>              fail=template.format('2', '0'),
>              crash=template.format('0', '0'),
> @@ -84,7 +85,8 @@ class TestPrintSummary(object):
>              changes=template.format('0', '2'),
>              fixes=template.format('0', '1'),
>              regressions=template.format('0', '0'),
> -            total=template.format('3', '3')).split('\n')
> +            total=template.format('3', '3'),
> +            time=template.format('00:01:39', '02:14:05')).split('\n')
>
>          res1 = results.TestrunResult()
>          res1.name = 'this is a really really really really long name'
> @@ -92,14 +94,16 @@ class TestPrintSummary(object):
>          res1.tests[names[1]] = results.TestResult('fail')
>          res1.tests[names[2]] = results.TestResult('notrun')
>          res1.tests[names[2]].subtests['1'] = 'fail'
> +        res1.time_elapsed = results.TimeAttribute(1509747121.4873962,
> 1509747220.544042)
>          res1.calculate_group_totals()
>
>          res2 = results.TestrunResult()
> -        res2.name = 'a name'
> +        res2.name = 'another name'
>          res2.tests[names[0]] = results.TestResult('pass')
>          res2.tests[names[1]] = results.TestResult('pass')
>          res2.tests[names[2]] = results.TestResult('notrun')
>          res2.tests[names[2]].subtests['1'] = 'skip'
> +        res2.time_elapsed = results.TimeAttribute(1464820707.4581327,
> 1464828753.201948)
>          res2.calculate_group_totals()
>
>          reses = common.Results([res1, res2])
> --
> 2.14.2
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20171104/9ad763b1/attachment.html>


More information about the Piglit mailing list