[Piglit] [PATCH 2/2] core: add new status trap, abort, and crash printed as black lines in summary

Marek Olšák maraeo at gmail.com
Mon Apr 4 07:45:41 PDT 2011


To distiguish between 'fail' and unexpected termination.
---
 framework/exectest.py  |    8 +++++++-
 framework/gleantest.py |    9 ++++++++-
 framework/summary.py   |   21 +++++++++++++++------
 piglit-summary-html.py |   15 ++++++++++++---
 templates/index.css    |   22 ++++++++++++++++++++++
 5 files changed, 64 insertions(+), 11 deletions(-)

diff --git a/framework/exectest.py b/framework/exectest.py
index 114908c..a2f46f6 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -74,7 +74,13 @@ class PlainExecTest(Test):
 			if 'result' not in results:
 				results['result'] = 'fail'
 
-			if proc.returncode != 0:
+			if proc.returncode == -5:
+				results['result'] = 'trap'
+			elif proc.returncode == -6:
+				results['result'] = 'abort'
+			elif proc.returncode == -11:
+				results['result'] = 'crash'
+			elif proc.returncode != 0:
 				results['result'] = 'fail'
 				results['note'] = 'Returncode was %d' % (proc.returncode)
 
diff --git a/framework/gleantest.py b/framework/gleantest.py
index 1de4bba..27f0183 100644
--- a/framework/gleantest.py
+++ b/framework/gleantest.py
@@ -68,7 +68,14 @@ class GleanTest(Test):
 		out, err = glean.communicate()
 
 		results['result'] = 'pass'
-		if glean.returncode != 0 or out.find('FAIL') >= 0:
+
+		if glean.returncode == -5:
+			results['result'] = 'trap'
+		elif glean.returncode == -6:
+			results['result'] = 'abort'
+		elif glean.returncode == -11:
+			results['result'] = 'crash'
+		elif glean.returncode != 0 or out.find('FAIL') >= 0:
 			results['result'] = 'fail'
 
 		results['returncode'] = glean.returncode
diff --git a/framework/summary.py b/framework/summary.py
index 08dd13b..8938509 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -28,17 +28,23 @@ import core
 ##### Vector indicating the number of subtests that have passed/failed/etc.
 #############################################################################
 class PassVector:
-	def __init__(self, p, w, f, s):
+	def __init__(self, p, w, f, s, t, a, c):
 		self.passnr = p
 		self.warnnr = w
 		self.failnr = f
 		self.skipnr = s
+		self.trapnr = t
+		self.abortnr = a
+		self.crashnr = c
 
 	def add(self, o):
 		self.passnr += o.passnr
 		self.warnnr += o.warnnr
 		self.failnr += o.failnr
 		self.skipnr += o.skipnr
+		self.trapnr += o.trapnr
+		self.abortnr += o.abortnr
+		self.crashnr += o.crashnr
 
 
 #############################################################################
@@ -66,10 +72,13 @@ results is an array of TestResult instances, one per testrun
 				result.status = result['result']
 
 			vectormap = {
-				'pass': PassVector(1,0,0,0),
-				'warn': PassVector(0,1,0,0),
-				'fail': PassVector(0,0,1,0),
-				'skip': PassVector(0,0,0,1)
+				'pass': PassVector(1,0,0,0,0,0,0),
+				'warn': PassVector(0,1,0,0,0,0,0),
+				'fail': PassVector(0,0,1,0,0,0,0),
+				'skip': PassVector(0,0,0,1,0,0,0),
+				'trap': PassVector(0,0,0,0,1,0,0),
+				'abort': PassVector(0,0,0,0,0,1,0),
+				'crash': PassVector(0,0,0,0,0,0,1)
 			}
 
 			if result.status not in vectormap:
@@ -106,7 +115,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)
+			result.passvector = PassVector(0, 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 35e49e0..2fd7fb7 100755
--- a/piglit-summary-html.py
+++ b/piglit-summary-html.py
@@ -156,9 +156,18 @@ def buildGroupSummaryTestrun(groupresult):
 	warnnr = groupresult.passvector.warnnr
 	failnr = groupresult.passvector.failnr
 	skipnr = groupresult.passvector.skipnr
-	totalnr = passnr + warnnr + failnr # do not count skips
-
-	if failnr > 0:
+	trapnr = groupresult.passvector.trapnr
+	abortnr = groupresult.passvector.abortnr
+	crashnr = groupresult.passvector.crashnr
+	totalnr = passnr + warnnr + failnr + trapnr + abortnr + crashnr # do not count skips
+
+	if trapnr > 0:
+		status = 'trap'
+	elif abortnr > 0:
+		status = 'abort'
+	elif crashnr > 0:
+		status = 'crash'
+	elif failnr > 0:
 		status = 'fail'
 	elif warnnr > 0:
 		status = 'warn'
diff --git a/templates/index.css b/templates/index.css
index 3e10f8d..a89bd1e 100644
--- a/templates/index.css
+++ b/templates/index.css
@@ -48,6 +48,12 @@ td {
 	background-color: #20ff20;
 }
 
+.trap, .abort, .crash {
+	text-align: right;
+	background-color: #000000;
+	color: #ffffff;
+}
+
 .skipa {
 	text-align: right;
 	background-color: #d0d0d0;
@@ -68,6 +74,12 @@ td {
 	background-color: #50ff50;
 }
 
+.trapa, .aborta, .crasha {
+	text-align: right;
+	background-color: #141414;
+	color: #ffffff;
+}
+
 .skipb {
 	text-align: right;
 	background-color: #c0c0c0;
@@ -87,3 +99,13 @@ td {
 	text-align: right;
 	background-color: #40ff40;
 }
+
+.trapb, .abortb, .crashb {
+	text-align: right;
+	background-color: #0a0a0a;
+	color: #ffffff;
+}
+
+td.trapa a, td.trapb a, td.aborta a, td.abortb a, td.crasha a, td.crashb a {
+	color: #ffffff;
+}
-- 
1.7.1



More information about the Piglit mailing list