[Piglit] [PATCH] framework: Remove 'abort' and 'trap' results in favor of 'crash'.

Kenneth Graunke kenneth at whitecape.org
Fri Apr 20 14:08:54 PDT 2012


While distinguishing between 'fail' and 'crash' in extremely useful,
I've never encountered a situation where 'abort' or 'trap' offers more
insight than simply calling it a 'crash'.

We may as well simplify things a bit.

Cc: Marek Olšák <maraeo at gmail.com>
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 framework/exectest.py  |   28 +++++++++++++++-------------
 framework/summary.py   |   20 +++++++-------------
 piglit-summary-html.py |   10 ++--------
 templates/index.css    |    8 ++++----
 4 files changed, 28 insertions(+), 38 deletions(-)

That said, I don't think I've ever actually seen 'trap' or 'abort' on i965.
Is this a more useful distinction for the Radeon or Nouveau developers?

diff --git a/framework/exectest.py b/framework/exectest.py
index 7877adb..2052a4c 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -85,19 +85,21 @@ class ExecTest(Test):
 			results['result'] = 'fail'
 			out = self.interpretResult(out, results)
 
-			if proc.returncode == -5:
-				results['result'] = 'trap'
-			elif proc.returncode == -6:
-				results['result'] = 'abort'
-			elif proc.returncode in (-8, -10, -11):
-				results['result'] = 'crash'
-			elif proc.returncode == -1073741819:
-				# 0xc0000005
-				# Windows EXCEPTION_ACCESS_VIOLATION
-				results['result'] = 'crash'
-			elif proc.returncode == -1073741676:
-				# 0xc0000094
-				# Windows EXCEPTION_INT_DIVIDE_BY_ZERO
+			crash_codes = [
+				# Unix: terminated by a signal
+				-5,  # SIGTRAP
+				-6,  # SIGABRT
+				-8,  # SIGFPE  (Floating point exception)
+				-10, # SIGUSR1
+				-11, # SIGSEGV (Segmentation fault)
+				# Windows:
+				# EXCEPTION_ACCESS_VIOLATION (0xc0000005):
+				-1073741819,
+				# EXCEPTION_INT_DIVIDE_BY_ZERO (0xc0000094):
+				-1073741676
+			]
+
+			if proc.returncode in crash_codes:
 				results['result'] = 'crash'
 			elif proc.returncode != 0:
 				results['note'] = 'Returncode was %d' % (proc.returncode)
diff --git a/framework/summary.py b/framework/summary.py
index c97ae9f..50ba58b 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -27,13 +27,11 @@ import core
 ##### Vector indicating the number of subtests that have passed/failed/etc.
 #############################################################################
 class PassVector:
-	def __init__(self, p, w, f, s, t, a, c):
+	def __init__(self, p, w, f, s, 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):
@@ -41,8 +39,6 @@ class PassVector:
 		self.warnnr += o.warnnr
 		self.failnr += o.failnr
 		self.skipnr += o.skipnr
-		self.trapnr += o.trapnr
-		self.abortnr += o.abortnr
 		self.crashnr += o.crashnr
 
 
@@ -82,13 +78,11 @@ results is an array of TestResult instances, one per testrun
 				result.status = result['result']
 
 			vectormap = {
-				'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)
+				'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)
 			}
 
 			if result.status not in vectormap:
@@ -131,7 +125,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, 0, 0)
+			result.passvector = PassVector(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 d5ec0e5..d0e49f3 100755
--- a/piglit-summary-html.py
+++ b/piglit-summary-html.py
@@ -173,16 +173,10 @@ def buildGroupSummaryTestrun(groupresult):
 	warnnr = groupresult.passvector.warnnr
 	failnr = groupresult.passvector.failnr
 	skipnr = groupresult.passvector.skipnr
-	trapnr = groupresult.passvector.trapnr
-	abortnr = groupresult.passvector.abortnr
 	crashnr = groupresult.passvector.crashnr
-	totalnr = passnr + warnnr + failnr + trapnr + abortnr + crashnr # do not count skips
+	totalnr = passnr + warnnr + failnr + crashnr # do not count skips
 
-	if trapnr > 0:
-		status = 'trap'
-	elif abortnr > 0:
-		status = 'abort'
-	elif crashnr > 0:
+	if crashnr > 0:
 		status = 'crash'
 	elif failnr > 0:
 		status = 'fail'
diff --git a/templates/index.css b/templates/index.css
index a89bd1e..207465e 100644
--- a/templates/index.css
+++ b/templates/index.css
@@ -48,7 +48,7 @@ td {
 	background-color: #20ff20;
 }
 
-.trap, .abort, .crash {
+.crash {
 	text-align: right;
 	background-color: #000000;
 	color: #ffffff;
@@ -74,7 +74,7 @@ td {
 	background-color: #50ff50;
 }
 
-.trapa, .aborta, .crasha {
+.crasha {
 	text-align: right;
 	background-color: #141414;
 	color: #ffffff;
@@ -100,12 +100,12 @@ td {
 	background-color: #40ff40;
 }
 
-.trapb, .abortb, .crashb {
+.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 {
+td.crasha a, td.crashb a {
 	color: #ffffff;
 }
-- 
1.7.10



More information about the Piglit mailing list