[Piglit] [PATCH v2] framework: add support for a "timeout" status
Thomas Wood
thomas.wood at intel.com
Mon Mar 31 02:57:21 PDT 2014
v2: use NoChangeStatus for the timeout class
Signed-off-by: Thomas Wood <thomas.wood at intel.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
---
framework/log.py | 2 +-
framework/status.py | 9 ++++++---
framework/tests/status_tests.py | 6 +++---
templates/index.css | 5 ++++-
4 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/framework/log.py b/framework/log.py
index 2835f1e..cdc3e94 100644
--- a/framework/log.py
+++ b/framework/log.py
@@ -39,7 +39,7 @@ 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.__output = "[{percent}] {summary} {running}\r"
diff --git a/framework/status.py b/framework/status.py
index bb7c594..a73caad 100644
--- a/framework/status.py
+++ b/framework/status.py
@@ -41,7 +41,6 @@ warn
dmesg-fail
fail
crash
-timeout
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
@@ -62,7 +61,8 @@ __all__ = ['NOTRUN',
'CRASH',
'DMESG_WARN',
'DMESG_FAIL',
- 'SKIP']
+ 'SKIP',
+ 'TIMEOUT']
def status_lookup(status):
""" Provided a string return a status object instance
@@ -79,7 +79,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]
@@ -220,6 +221,8 @@ class NoChangeStatus(Status):
NOTRUN = NoChangeStatus('Not Run')
+TIMEOUT = NoChangeStatus('timeout')
+
SKIP = NoChangeStatus('skip')
PASS = Status('pass', 0, (1, 1))
diff --git a/framework/tests/status_tests.py b/framework/tests/status_tests.py
index ad0630a..087e28a 100644
--- a/framework/tests/status_tests.py
+++ b/framework/tests/status_tests.py
@@ -69,7 +69,7 @@ def test_gen_lookup():
""" Generator that attempts to do a lookup on all statuses """
yieldable = check_lookup
- for stat in STATUSES + ['skip', 'notrun']:
+ for stat in STATUSES + ['skip', 'notrun', 'timeout']:
yieldable.description = "Lookup: {}".format(stat)
yield yieldable, stat
@@ -144,10 +144,10 @@ def check_not_change(new, old):
def test_not_change():
- """ Skip and NotRun should not count as changes """
+ """ Skip, NotRun and Timeout should not count as changes """
yieldable = check_not_change
- for nochange, stat in itertools.product(['skip', 'notrun'], STATUSES):
+ for nochange, stat in itertools.product(['skip', 'notrun', 'timeout'], STATUSES):
yieldable.description = "{0} -> {1} should not be a change".format(
nochange, stat)
yield yieldable, status.status_lookup(nochange), status.status_lookup(stat)
diff --git a/templates/index.css b/templates/index.css
index 577370c..3389738 100644
--- a/templates/index.css
+++ b/templates/index.css
@@ -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; }
--
1.9.0
More information about the Piglit
mailing list