Commit eb28f829 authored by Thomas Wood's avatar Thomas Wood

framework: add support for a "timeout" status

Signed-off-by: default avatarThomas Wood <thomas.wood@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Dylan Baker's avatarDylan Baker <baker.dylan.c@gmail.com>
parent 6cb822d1
......@@ -39,7 +39,8 @@ class Log(object):
self.__generator = (x for x in xrange(self.__total))
self.__pad = len(str(self.__total))
self.__summary_keys = set(['pass', 'fail', 'warn', 'crash', 'skip',
'dmesg-warn', 'dmesg-fail', 'dry-run'])
'dmesg-warn', 'dmesg-fail', 'dry-run',
'timeout'])
self.__summary = collections.defaultdict(lambda: 0)
self.__lastlength = 0
......
......@@ -40,8 +40,8 @@ dmesg-warn
warn
dmesg-fail
fail
crash
timeout
crash
SKIP and NOTRUN are not factored into regressions and fixes, they are counted
seperately. They also derive from a sublcass of Status, which always returns
......@@ -63,6 +63,7 @@ __all__ = ['NOTRUN',
'DMESG_WARN',
'DMESG_FAIL',
'SKIP',
'TIMEOUT',
'ALL']
......@@ -81,7 +82,8 @@ def status_lookup(status):
'crash': CRASH,
'dmesg-warn': DMESG_WARN,
'dmesg-fail': DMESG_FAIL,
'notrun': NOTRUN}
'notrun': NOTRUN,
'timeout': TIMEOUT}
try:
return status_dict[status]
......@@ -223,7 +225,9 @@ FAIL = Status('fail', 30)
DMESG_FAIL = Status('dmesg-fail', 40)
CRASH = Status('crash', 50)
TIMEOUT = Status('timeout', 50)
CRASH = Status('crash', 60)
# A tuple (ordered, immutable) of all statuses in this module
ALL = (PASS, WARN, DMESG_WARN, FAIL, DMESG_FAIL, CRASH, SKIP, NOTRUN)
ALL = (PASS, WARN, DMESG_WARN, FAIL, DMESG_FAIL, TIMEOUT, CRASH, SKIP, NOTRUN)
......@@ -342,8 +342,9 @@ class Summary:
Private: Find the total number of pass, fail, crash, skip, and warn in
the *last* set of results stored in self.results.
"""
self.totals = {'pass': 0, 'fail': 0, 'crash': 0, 'skip': 0, 'warn': 0,
'dmesg-warn': 0, 'dmesg-fail': 0}
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():
self.totals[str(test['result'])] += 1
......@@ -472,6 +473,7 @@ class Summary:
" fail: {fail}\n"
" crash: {crash}\n"
" skip: {skip}\n"
" timeout: {timeout}\n"
" warn: {warn}\n"
" dmesg-warn: {dmesg-warn}\n"
" dmesg-fail: {dmesg-fail}".format(**self.totals))
......
......@@ -31,7 +31,8 @@ import framework.status as status
# Statuses from worst to last. NotRun is intentionally not in this list and
# tested separately because of upcoming features for it
STATUSES = ["pass", "warn", "dmesg-warn", "fail", "dmesg-fail", "crash"]
STATUSES = ["pass", "warn", "dmesg-warn", "fail", "dmesg-fail", "timeout",
"crash"]
# all statuses except pass are problems
PROBLEMS = STATUSES[1:]
......
......@@ -51,7 +51,10 @@ def test_summary_add_to_set():
('skip', 'skip', 'skipped'),
('notrun', 'fail', 'problems'),
('fail', 'notrun', 'problems'),
('pass', 'fail', 'problems')]:
('pass', 'fail', 'problems'),
('timeout', 'pass', 'fixes'),
('pass', 'timeout', 'regressions'),
('pass', 'timeout', 'problems')]:
check_sets.description = "{0} -> {1} should be added to {2}".format(
ostat, nstat, set_)
......
......@@ -36,7 +36,7 @@ td:first-child > div {
background-color: #c8c838
}
td.skip, td.warn, td.fail, td.pass, td.trap, td.abort, td.crash, td.dmesg-warn, td.dmesg-fail {
td.skip, td.warn, td.fail, td.pass, td.trap, td.abort, td.crash, td.dmesg-warn, td.dmesg-fail, td.timeout {
text-align: right;
}
......@@ -67,6 +67,9 @@ tr:nth-child(even) td.fail { background-color: #e00505; }
tr:nth-child(odd) td.dmesg-fail { background-color: #ff2020; }
tr:nth-child(even) td.dmesg-fail { background-color: #e00505; }
tr:nth-child(odd) td.timeout { background-color: #83bdf6; }
tr:nth-child(even) td.timeout { background-color: #4a9ef2; }
tr:nth-child(odd) td.trap { background-color: #111111; }
tr:nth-child(even) td.trap { background-color: #000000; }
tr:nth-child(odd) td.abort { background-color: #111111; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment