[Piglit] [PATCH 3/8] exectest.py: add path to mark a test as always skipped

Jordan Justen jordan.l.justen at intel.com
Tue Oct 9 16:42:27 PDT 2012


check_for_skip_scenario allows a test to be marked as 'always skip'

Currently it doesn't mark any test for skipping.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 framework/core.py     |    1 +
 framework/exectest.py |   19 ++++++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/framework/core.py b/framework/core.py
index b20fd89..48771cf 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -405,6 +405,7 @@ class Test:
 			(i.e. the main thread) or from the ConcurrentTestPool threads.
 		'''
 		self.runConcurrent = runConcurrent
+		self.skip_test = False
 
 	def run(self):
 		raise NotImplementedError
diff --git a/framework/exectest.py b/framework/exectest.py
index 68333d4..3172a7e 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -40,6 +40,8 @@ class ExecTest(Test):
 		if isinstance(self.command, basestring):
 			self.command = shlex.split(str(self.command))
 
+		self.skip_test = self.check_for_skip_scenario(command)
+
 	def interpretResult(self, out, results):
 		raise NotImplementedError
 		return out
@@ -57,7 +59,13 @@ class ExecTest(Test):
 
 			i = 0
 			while True:
-				(out, err, returncode) = self.get_command_result(command, fullenv)
+				if self.skip_test:
+					out = "PIGLIT: {'result': 'skip'}\n"
+					err = ""
+					returncode = None
+				else:
+					(out, err, returncode) = \
+						self.get_command_result(command, fullenv)
 
 				# https://bugzilla.gnome.org/show_bug.cgi?id=680214 is
 				# affecting many developers.  If we catch it
@@ -88,8 +96,11 @@ class ExecTest(Test):
 
 			results = TestResult()
 
-			results['result'] = 'fail'
-			out = self.interpretResult(out, results)
+			if self.skip_test:
+				results['result'] = 'skip'
+			else:
+				results['result'] = 'fail'
+				out = self.interpretResult(out, results)
 
 			crash_codes = [
 				# Unix: terminated by a signal
@@ -141,6 +152,8 @@ class ExecTest(Test):
 
 		return results
 
+	def check_for_skip_scenario(self, command):
+		return False
 
 	def get_command_result(self, command, fullenv):
 		try:
-- 
1.7.9.5



More information about the Piglit mailing list