public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/, pmstestsuite/output/
@ 2011-08-06 14:25 Michał Górny
  0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2011-08-06 14:25 UTC (permalink / raw
  To: gentoo-commits

commit:     70309748c5aed377605a27d6b0cca20465833e28
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  6 13:38:51 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Aug  6 13:51:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=70309748

Introduce the concept of undefined behavior assertions.

---
 pmstestsuite/library/case.py |   13 +++++++++++--
 pmstestsuite/output/html.py  |    5 +++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/pmstestsuite/library/case.py b/pmstestsuite/library/case.py
index f8f4ce3..538a050 100644
--- a/pmstestsuite/library/case.py
+++ b/pmstestsuite/library/case.py
@@ -60,11 +60,16 @@ def cleanup_test_case_name(classname):
 class AssertionResult(ABCObject, BoolCompat):
 	def __init__(self, name):
 		self._name = name
+		self._undefined = False
 
 	@property
 	def name(self):
 		return self._name
 
+	@property
+	def undefined(self):
+		return self._undefined
+
 	@abstractproperty
 	def expected(self):
 		pass
@@ -198,9 +203,13 @@ class TestCase(ABCObject):
 		"""
 		pass
 
-	def _append_assert(self, a):
+	def _append_assert(self, a, undefined = False):
+		all_eapis = itertools.chain.from_iterable(self.supported_eapis)
+		if undefined:
+			a._undefined = True
+
 		self.assertions.append(a)
-		if not a:
+		if not a.undefined and not a:
 			raise AssertionError(str(a))
 
 	def assertTrue(self, cond, msg):

diff --git a/pmstestsuite/output/html.py b/pmstestsuite/output/html.py
index 519209a..6de16f0 100644
--- a/pmstestsuite/output/html.py
+++ b/pmstestsuite/output/html.py
@@ -108,8 +108,9 @@ class HTMLOutput(OutputModule):
 				self._attrs.append('class="value %s"' % self._color_class)
 
 		class ColorValCell(ValCell):
-			def __init__(self, text, cond):
-				self._color_class = 'good' if cond else 'bad'
+			def __init__(self, text, a):
+				self._color_class = 'unknown' if a.undefined \
+						else 'good' if a else 'bad'
 				ValCell.__init__(self, text)
 
 		class BoolCell(ValCell):



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-06 14:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-06 14:25 [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/, pmstestsuite/output/ Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox