summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Gomez <agomez@igalia.com>2017-11-04 02:18:40 +0200
committerAndres Gomez <agomez@igalia.com>2017-11-13 22:38:10 +0200
commitffda066847b5815b1c780609ce11f50e02b05a8f (patch)
treeb273123cca5a5ba22eae17ae2c344b10ba0548c9
parentbf09589c798710333b079480d9ae5c6cbcde486e (diff)
unittests: include new elapsed time from the console summary output
Fixes: e76ecd048 ("framework: also print elapsed time with piglit-summary.py") Cc: Brian Paul <brianp@vmware.com> Cc: Dylan Baker <dylanx.c.baker@intel.com> Signed-off-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--unittests/framework/summary/test_console.py14
1 files 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])