[Piglit] [PATCH 19/20] framework: Add support for a "timeout" result code.

Jon Severinsson jon at severinsson.net
Wed Apr 17 09:14:58 PDT 2013


Nothing generates it yet, that is comming in a later patch.
---
 framework/exectest.py  |    4 ++--
 framework/summary.py   |   17 ++++++++++-------
 piglit-summary-html.py |    5 ++++-
 templates/index.css    |    8 ++++----
 4 filer ändrade, 20 tillägg(+), 14 borttagningar(-)

diff --git a/framework/exectest.py b/framework/exectest.py
index c6a4707..388c3c7 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -71,8 +71,8 @@ class ExecTest(Test):
 		"""
 		Run a test.  The return value will be a dictionary with keys
 		including 'result', 'info', 'returncode' and 'command'.
-		* For 'result', the value may be one of 'pass', 'fail', 'skip',
-		  'crash', or 'warn'.
+		* For 'result', the value may be one of 'pass', 'warn', 'fail',
+		  'skip', 'crash', or 'timeout'.
 		* For 'info', the value will include stderr/out text.
 		* For 'returncode', the value will be the numeric exit code/value.
 		* For 'command', the value will be command line program and arguments.
diff --git a/framework/summary.py b/framework/summary.py
index c2a7f00..f07c578 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -27,12 +27,13 @@ import .core
 ##### Vector indicating the number of subtests that have passed/failed/etc.
 #############################################################################
 class PassVector:
-	def __init__(self, p, w, f, s, c):
+	def __init__(self, p, w, f, s, c, t):
 		self.passnr = p
 		self.warnnr = w
 		self.failnr = f
 		self.skipnr = s
 		self.crashnr = c
+		self.timeoutnr = t
 
 	def add(self, o):
 		self.passnr += o.passnr
@@ -40,6 +41,7 @@ class PassVector:
 		self.failnr += o.failnr
 		self.skipnr += o.skipnr
 		self.crashnr += o.crashnr
+		self.timeoutnr += o.timeoutnr
 
 
 #############################################################################
@@ -78,11 +80,12 @@ results is an array of TestResult instances, one per testrun
 				result.status = result['result']
 
 			vectormap = {
-				'pass': PassVector(1,0,0,0,0),
-				'warn': PassVector(0,1,0,0,0),
-				'fail': PassVector(0,0,1,0,0),
-				'skip': PassVector(0,0,0,1,0),
-				'crash': PassVector(0,0,0,0,1)
+				'pass': PassVector(1,0,0,0,0,0),
+				'warn': PassVector(0,1,0,0,0,0),
+				'fail': PassVector(0,0,1,0,0,0),
+				'skip': PassVector(0,0,0,1,0,0),
+				'crash': PassVector(0,0,0,0,1,0),
+				'timeout': PassVector(0,0,0,0,0,1)
 			}
 
 			if result.status not in vectormap:
@@ -132,7 +135,7 @@ results is an array of GroupResult instances, one per testrun
 		# Perform some initial annotations
 		for j in range(len(self.results)):
 			result = self.results[j]
-			result.passvector = PassVector(0, 0, 0, 0, 0)
+			result.passvector = PassVector(0, 0, 0, 0, 0, 0)
 			result.testrun = self.summary.testruns[j]
 
 		# Collect, create and annotate children
diff --git a/piglit-summary-html.py b/piglit-summary-html.py
index cabf84a..98be624 100755
--- a/piglit-summary-html.py
+++ b/piglit-summary-html.py
@@ -182,10 +182,13 @@ def buildGroupSummaryTestrun(groupresult):
 	failnr = groupresult.passvector.failnr
 	skipnr = groupresult.passvector.skipnr
 	crashnr = groupresult.passvector.crashnr
-	totalnr = passnr + warnnr + failnr + crashnr # do not count skips
+	timeoutnr = groupresult.passvector.timeoutnr
+	totalnr = passnr + warnnr + failnr + crashnr + timeoutnr # do not count skips
 
 	if crashnr > 0:
 		status = 'crash'
+	elif timeoutnr > 0:
+		status = 'timeout'
 	elif failnr > 0:
 		status = 'fail'
 	elif warnnr > 0:
diff --git a/templates/index.css b/templates/index.css
index 207465e..eeb0ec8 100644
--- a/templates/index.css
+++ b/templates/index.css
@@ -48,7 +48,7 @@ td {
 	background-color: #20ff20;
 }
 
-.crash {
+.crash, .timeout {
 	text-align: right;
 	background-color: #000000;
 	color: #ffffff;
@@ -74,7 +74,7 @@ td {
 	background-color: #50ff50;
 }
 
-.crasha {
+.crasha, .timeouta {
 	text-align: right;
 	background-color: #141414;
 	color: #ffffff;
@@ -100,12 +100,12 @@ td {
 	background-color: #40ff40;
 }
 
-.crashb {
+.crashb, .timeoutb {
 	text-align: right;
 	background-color: #0a0a0a;
 	color: #ffffff;
 }
 
-td.crasha a, td.crashb a {
+td.crasha a, td.crashb a, td.timeouta a, td.timeoutb a {
 	color: #ffffff;
 }
-- 
1.7.10.4



More information about the Piglit mailing list