[Piglit] [PATCH 1/2] framework: add support for a "timeout" status

Thomas Wood thomas.wood at intel.com
Wed Mar 19 08:43:14 PDT 2014


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             | 20 ++++++++++++--------
 framework/tests/status_tests.py |  4 ++--
 templates/index.css             |  5 ++++-
 4 files changed, 19 insertions(+), 12 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 e34e4af..66bddff 100644
--- a/framework/status.py
+++ b/framework/status.py
@@ -38,12 +38,12 @@ Status ordering from best to worst:
 NotRun
 skip
 pass
+timeout
 dmesg-warn
 warn
 dmesg-fail
 fail
 crash
-timeout
 
 (NotRun, pass, skip) are considered equivalent for regression testing.
 
@@ -69,7 +69,8 @@ __all__ = ['NOTRUN',
            'CRASH',
            'DMESG_WARN',
            'DMESG_FAIL',
-           'SKIP']
+           'SKIP',
+           'TIMEOUT']
 
 def status_lookup(status):
     """ Provided a string return a status object instance
@@ -86,7 +87,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]
@@ -197,12 +199,14 @@ SKIP = Status('skip', 10, (0, 0))
 
 PASS = Status('pass', 20, (1, 1))
 
-DMESG_WARN = Status('dmesg-warn', 30)
+TIMEOUT = Status('timeout', 30)
+
+DMESG_WARN = Status('dmesg-warn', 40)
 
-WARN = Status('warn', 40)
+WARN = Status('warn', 50)
 
-DMESG_FAIL = Status('dmesg-fail', 50)
+DMESG_FAIL = Status('dmesg-fail', 60)
 
-FAIL = Status('fail', 60)
+FAIL = Status('fail', 70)
 
-CRASH = Status('crash', 70)
+CRASH = Status('crash', 80)
diff --git a/framework/tests/status_tests.py b/framework/tests/status_tests.py
index 9280bd5..7772d14 100644
--- a/framework/tests/status_tests.py
+++ b/framework/tests/status_tests.py
@@ -30,8 +30,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 = ["notrun", "pass", "dmesg-warn", "warn", "dmesg-fail", "fail",
-            "crash"]
+STATUSES = ["notrun", "pass", "timeout", "dmesg-warn", "warn", "dmesg-fail",
+            "fail", "crash"]
 
 # Create lists of fixes and regressions programmatically based on the STATUSES
 # list. This means less code, and easier expansion changes.
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.8.5.3



More information about the Piglit mailing list